Rename Deckhand bucket endpoint to buckets for consistency
According to guides like [0] RESTful resource name should use pluralization for nouns, for the sake of consistency. As such, this PS renames PUT bucket/{bucket_name}/documents to PUT buckets/{bucket_name}/documents Required renames have also been made to the following UCP projects: - Shipyard -> https://review.gerrithub.io/#/c/384121/ [0] https://restfulapi.net/resource-naming/ Change-Id: Icb01e29db0b8b12e66895135baa9be525ba7d72b
This commit is contained in:
parent
90a77d4278
commit
c729cd930d
2
AUTHORS
2
AUTHORS
@ -3,7 +3,9 @@ Anthony Lin <anthony.jclin@gmail.com>
|
|||||||
Bryan Strassner <bryan.strassner@gmail.com>
|
Bryan Strassner <bryan.strassner@gmail.com>
|
||||||
Felipe Monteiro <felipe.monteiro@att.com>
|
Felipe Monteiro <felipe.monteiro@att.com>
|
||||||
Felipe Monteiro <fmontei@users.noreply.github.com>
|
Felipe Monteiro <fmontei@users.noreply.github.com>
|
||||||
|
Kochetov, Mikhail (mk899x) <mk899x@us.att.com>
|
||||||
Mark Burnett <mark.m.burnett@gmail.com>
|
Mark Burnett <mark.m.burnett@gmail.com>
|
||||||
|
Mike Kochetov <mike.nycmoma@gmail.com>
|
||||||
Pete Birley <pete@port.direct>
|
Pete Birley <pete@port.direct>
|
||||||
Scott Hussey <sh8121@att.com>
|
Scott Hussey <sh8121@att.com>
|
||||||
Tin Lam <tin@irrational.io>
|
Tin Lam <tin@irrational.io>
|
||||||
|
@ -28,7 +28,7 @@ the new revision.""",
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
'method': 'PUT',
|
'method': 'PUT',
|
||||||
'path': '/api/v1.0/bucket/{bucket_name}/documents'
|
'path': '/api/v1.0/buckets/{bucket_name}/documents'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
@ -50,7 +50,7 @@ the request body have a ``metadata.storagePolicy`` of "encrypted".""",
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
'method': 'PUT',
|
'method': 'PUT',
|
||||||
'path': '/api/v1.0/bucket/{bucket_name}/documents'
|
'path': '/api/v1.0/buckets/{bucket_name}/documents'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
|
@ -36,7 +36,7 @@ LOG = log.getLogger(__name__)
|
|||||||
def configure_app(app, version=''):
|
def configure_app(app, version=''):
|
||||||
|
|
||||||
v1_0_routes = [
|
v1_0_routes = [
|
||||||
('bucket/{bucket_name}/documents', buckets.BucketsResource()),
|
('buckets/{bucket_name}/documents', buckets.BucketsResource()),
|
||||||
('health', health.HealthResource()),
|
('health', health.HealthResource()),
|
||||||
('revisions', revisions.RevisionsResource()),
|
('revisions', revisions.RevisionsResource()),
|
||||||
('revisions/{revision_id}', revisions.RevisionsResource()),
|
('revisions/{revision_id}', revisions.RevisionsResource()),
|
||||||
|
@ -19,12 +19,12 @@ tests:
|
|||||||
|
|
||||||
- name: create
|
- name: create
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/a/documents
|
PUT: /api/v1.0/buckets/a/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/sample-doc.yaml
|
data: <@resources/sample-doc.yaml
|
||||||
|
|
||||||
- name: error
|
- name: error
|
||||||
desc: Trigger error case
|
desc: Trigger error case
|
||||||
PUT: /api/v1.0/bucket/b/documents
|
PUT: /api/v1.0/buckets/b/documents
|
||||||
status: 409
|
status: 409
|
||||||
data: <@resources/sample-doc.yaml
|
data: <@resources/sample-doc.yaml
|
||||||
|
@ -27,7 +27,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_a
|
- name: create_a
|
||||||
desc: Create documents in one bucket (a)
|
desc: Create documents in one bucket (a)
|
||||||
PUT: /api/v1.0/bucket/a/documents
|
PUT: /api/v1.0/buckets/a/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/layering-needs-substitution-source.yaml
|
data: <@resources/layering-needs-substitution-source.yaml
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_b
|
- name: create_b
|
||||||
desc: Create documents in a second bucket (b)
|
desc: Create documents in a second bucket (b)
|
||||||
PUT: /api/v1.0/bucket/b/documents
|
PUT: /api/v1.0/buckets/b/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/passphrase.yaml
|
data: <@resources/passphrase.yaml
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ tests:
|
|||||||
|
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ tests:
|
|||||||
|
|
||||||
- name: ignore_duplicate
|
- name: ignore_duplicate
|
||||||
desc: Push a duplicate bucket of documents
|
desc: Push a duplicate bucket of documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ tests:
|
|||||||
|
|
||||||
- name: update_single_document
|
- name: update_single_document
|
||||||
desc: Update a single document, ignore other documents in the bucket
|
desc: Update a single document, ignore other documents in the bucket
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample-with-update.yaml
|
data: <@resources/design-doc-layering-sample-with-update.yaml
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ tests:
|
|||||||
|
|
||||||
- name: delete_document
|
- name: delete_document
|
||||||
desc: Delete a single document
|
desc: Delete a single document
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample-with-delete.yaml
|
data: <@resources/design-doc-layering-sample-with-delete.yaml
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ tests:
|
|||||||
|
|
||||||
- name: add_bucket_a
|
- name: add_bucket_a
|
||||||
desc: Create documents for bucket a
|
desc: Create documents for bucket a
|
||||||
PUT: /api/v1.0/bucket/a/documents
|
PUT: /api/v1.0/buckets/a/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-substitution-sample-split-bucket-a.yaml
|
data: <@resources/design-doc-substitution-sample-split-bucket-a.yaml
|
||||||
|
|
||||||
- name: add_bucket_b
|
- name: add_bucket_b
|
||||||
desc: Create documents for bucket b
|
desc: Create documents for bucket b
|
||||||
PUT: /api/v1.0/bucket/b/documents
|
PUT: /api/v1.0/buckets/b/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-substitution-sample-split-bucket-b.yaml
|
data: <@resources/design-doc-substitution-sample-split-bucket-b.yaml
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ tests:
|
|||||||
|
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-substitution-sample.yaml
|
data: <@resources/design-doc-substitution-sample.yaml
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ tests:
|
|||||||
# Asserts that status code and response headers are correct.
|
# Asserts that status code and response headers are correct.
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_a
|
- name: create_a
|
||||||
desc: Create documents in bucket a
|
desc: Create documents in bucket a
|
||||||
PUT: /api/v1.0/bucket/bucket_a/documents
|
PUT: /api/v1.0/buckets/bucket_a/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
@ -46,7 +46,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_b
|
- name: create_b
|
||||||
desc: Create documents in bucket b
|
desc: Create documents in bucket b
|
||||||
PUT: /api/v1.0/bucket/bucket_b/documents
|
PUT: /api/v1.0/buckets/bucket_b/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
@ -63,7 +63,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_c
|
- name: create_c
|
||||||
desc: Create documents in bucket c
|
desc: Create documents in bucket c
|
||||||
PUT: /api/v1.0/bucket/bucket_c/documents
|
PUT: /api/v1.0/buckets/bucket_c/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
@ -80,7 +80,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_d
|
- name: create_d
|
||||||
desc: Create documents in bucket d
|
desc: Create documents in bucket d
|
||||||
PUT: /api/v1.0/bucket/bucket_d/documents
|
PUT: /api/v1.0/buckets/bucket_d/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
@ -142,7 +142,7 @@ tests:
|
|||||||
|
|
||||||
- name: update_c
|
- name: update_c
|
||||||
desc: Update document in bucket c
|
desc: Update document in bucket c
|
||||||
PUT: /api/v1.0/bucket/bucket_c/documents
|
PUT: /api/v1.0/buckets/bucket_c/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
@ -170,13 +170,13 @@ tests:
|
|||||||
|
|
||||||
- name: delete_b
|
- name: delete_b
|
||||||
desc: Delete documents from bucket b
|
desc: Delete documents from bucket b
|
||||||
PUT: /api/v1.0/bucket/bucket_b/documents
|
PUT: /api/v1.0/buckets/bucket_b/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: ""
|
data: ""
|
||||||
|
|
||||||
- name: create_mistake
|
- name: create_mistake
|
||||||
desc: Create documents in bucket mistake
|
desc: Create documents in bucket mistake
|
||||||
PUT: /api/v1.0/bucket/bucket_mistake/documents
|
PUT: /api/v1.0/buckets/bucket_mistake/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
@ -193,7 +193,7 @@ tests:
|
|||||||
|
|
||||||
- name: delete_mistake
|
- name: delete_mistake
|
||||||
desc: Delete documents from bucket mistake
|
desc: Delete documents from bucket mistake
|
||||||
PUT: /api/v1.0/bucket/bucket_mistake/documents
|
PUT: /api/v1.0/buckets/bucket_mistake/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: ""
|
data: ""
|
||||||
# Verification for whether a bucket_name was returned even though all the
|
# Verification for whether a bucket_name was returned even though all the
|
||||||
@ -214,7 +214,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_e
|
- name: create_e
|
||||||
desc: Create documents in bucket e
|
desc: Create documents in bucket e
|
||||||
PUT: /api/v1.0/bucket/bucket_e/documents
|
PUT: /api/v1.0/buckets/bucket_e/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
---
|
---
|
||||||
|
@ -20,7 +20,7 @@ tests:
|
|||||||
|
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ tests:
|
|||||||
|
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ tests:
|
|||||||
|
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ tests:
|
|||||||
# Create a revision implicitly by creating a document.
|
# Create a revision implicitly by creating a document.
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
|
@ -26,19 +26,19 @@ tests:
|
|||||||
|
|
||||||
- name: initialize
|
- name: initialize
|
||||||
desc: Create initial documents
|
desc: Create initial documents
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample.yaml
|
data: <@resources/design-doc-layering-sample.yaml
|
||||||
|
|
||||||
- name: update_single_document
|
- name: update_single_document
|
||||||
desc: Update a single document, ignore other documents in the bucket
|
desc: Update a single document, ignore other documents in the bucket
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample-with-update.yaml
|
data: <@resources/design-doc-layering-sample-with-update.yaml
|
||||||
|
|
||||||
- name: delete_document
|
- name: delete_document
|
||||||
desc: Delete a single document
|
desc: Delete a single document
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/design-doc-layering-sample-with-delete.yaml
|
data: <@resources/design-doc-layering-sample-with-delete.yaml
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ tests:
|
|||||||
|
|
||||||
- name: create_schema
|
- name: create_schema
|
||||||
desc: Add example schema
|
desc: Add example schema
|
||||||
PUT: /api/v1.0/bucket/mop/documents
|
PUT: /api/v1.0/buckets/mop/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: <@resources/sample-schema.yaml
|
data: <@resources/sample-schema.yaml
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ tests:
|
|||||||
|
|
||||||
- name: add_valid_document
|
- name: add_valid_document
|
||||||
desc: Add a document that follows the schema
|
desc: Add a document that follows the schema
|
||||||
PUT: /api/v1.0/bucket/good/documents
|
PUT: /api/v1.0/buckets/good/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
schema: example/Doc/v1
|
schema: example/Doc/v1
|
||||||
@ -80,7 +80,7 @@ tests:
|
|||||||
|
|
||||||
- name: add_invalid_document
|
- name: add_invalid_document
|
||||||
desc: Add a document that does not follow the schema
|
desc: Add a document that does not follow the schema
|
||||||
PUT: /api/v1.0/bucket/bad/documents
|
PUT: /api/v1.0/buckets/bad/documents
|
||||||
status: 200
|
status: 200
|
||||||
data: |-
|
data: |-
|
||||||
schema: example/Doc/v1
|
schema: example/Doc/v1
|
||||||
|
@ -74,7 +74,7 @@ class TestApi(test_base.DeckhandTestCase):
|
|||||||
api.init_application()
|
api.init_application()
|
||||||
|
|
||||||
mock_falcon_api.add_route.assert_has_calls([
|
mock_falcon_api.add_route.assert_has_calls([
|
||||||
mock.call('/api/v1.0/bucket/{bucket_name}/documents',
|
mock.call('/api/v1.0/buckets/{bucket_name}/documents',
|
||||||
self.buckets_resource()),
|
self.buckets_resource()),
|
||||||
mock.call('/api/v1.0/health', self.health_resource()),
|
mock.call('/api/v1.0/health', self.health_resource()),
|
||||||
mock.call('/api/v1.0/revisions', self.revisions_resource()),
|
mock.call('/api/v1.0/revisions', self.revisions_resource()),
|
||||||
|
@ -42,7 +42,7 @@ class TestBucketsController(test_base.BaseControllerTest):
|
|||||||
payload = documents_factory.gen_test(document_mapping)
|
payload = documents_factory.gen_test(document_mapping)
|
||||||
|
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all(payload))
|
body=yaml.safe_dump_all(payload))
|
||||||
self.assertEqual(200, resp.status_code)
|
self.assertEqual(200, resp.status_code)
|
||||||
@ -57,7 +57,7 @@ class TestBucketsController(test_base.BaseControllerTest):
|
|||||||
def test_put_bucket_with_secret(self):
|
def test_put_bucket_with_secret(self):
|
||||||
def _do_test(payload):
|
def _do_test(payload):
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all(payload))
|
body=yaml.safe_dump_all(payload))
|
||||||
self.assertEqual(200, resp.status_code)
|
self.assertEqual(200, resp.status_code)
|
||||||
@ -129,7 +129,7 @@ schema:
|
|||||||
|
|
||||||
for idx, payload in enumerate(invalid_payloads):
|
for idx, payload in enumerate(invalid_payloads):
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=payload)
|
body=payload)
|
||||||
self.assertEqual(400, resp.status_code)
|
self.assertEqual(400, resp.status_code)
|
||||||
@ -143,7 +143,7 @@ schema:
|
|||||||
|
|
||||||
# Create the first layering policy.
|
# Create the first layering policy.
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all([payload]))
|
body=yaml.safe_dump_all([payload]))
|
||||||
self.assertEqual(200, resp.status_code)
|
self.assertEqual(200, resp.status_code)
|
||||||
@ -154,7 +154,7 @@ schema:
|
|||||||
'the system.' % payload['metadata']['name'])
|
'the system.' % payload['metadata']['name'])
|
||||||
payload['metadata']['name'] = test_utils.rand_name('layering-policy')
|
payload['metadata']['name'] = test_utils.rand_name('layering-policy')
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all([payload]))
|
body=yaml.safe_dump_all([payload]))
|
||||||
self.assertEqual(409, resp.status_code)
|
self.assertEqual(409, resp.status_code)
|
||||||
@ -175,7 +175,7 @@ class TestBucketsControllerNegativeRBAC(test_base.BaseControllerTest):
|
|||||||
payload = documents_factory.gen_test({})
|
payload = documents_factory.gen_test({})
|
||||||
|
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all(payload))
|
body=yaml.safe_dump_all(payload))
|
||||||
self.assertEqual(403, resp.status_code)
|
self.assertEqual(403, resp.status_code)
|
||||||
@ -188,7 +188,7 @@ class TestBucketsControllerNegativeRBAC(test_base.BaseControllerTest):
|
|||||||
payload = [secrets_factory.gen_test('Certificate', 'cleartext')]
|
payload = [secrets_factory.gen_test('Certificate', 'cleartext')]
|
||||||
|
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all(payload))
|
body=yaml.safe_dump_all(payload))
|
||||||
self.assertEqual(403, resp.status_code)
|
self.assertEqual(403, resp.status_code)
|
||||||
@ -201,7 +201,7 @@ class TestBucketsControllerNegativeRBAC(test_base.BaseControllerTest):
|
|||||||
payload = [secrets_factory.gen_test('Certificate', 'encrypted')]
|
payload = [secrets_factory.gen_test('Certificate', 'encrypted')]
|
||||||
|
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all(payload))
|
body=yaml.safe_dump_all(payload))
|
||||||
self.assertEqual(403, resp.status_code)
|
self.assertEqual(403, resp.status_code)
|
||||||
|
@ -35,7 +35,7 @@ class TestErrorFormatting(test_base.BaseControllerTest):
|
|||||||
as m_enforce_rbac:
|
as m_enforce_rbac:
|
||||||
m_enforce_rbac.side_effect = Exception
|
m_enforce_rbac.side_effect = Exception
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/test/documents',
|
'/api/v1.0/buckets/test/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'}, body=None)
|
headers={'Content-Type': 'application/x-yaml'}, body=None)
|
||||||
|
|
||||||
expected = {
|
expected = {
|
||||||
@ -75,7 +75,7 @@ class TestErrorFormatting(test_base.BaseControllerTest):
|
|||||||
m_enforce_rbac.side_effect = falcon.HTTPForbidden(
|
m_enforce_rbac.side_effect = falcon.HTTPForbidden(
|
||||||
description=expected_msg)
|
description=expected_msg)
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/test/documents',
|
'/api/v1.0/buckets/test/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'}, body=None)
|
headers={'Content-Type': 'application/x-yaml'}, body=None)
|
||||||
|
|
||||||
expected = {
|
expected = {
|
||||||
|
@ -62,7 +62,7 @@ class TestValidationsController(test_base.BaseControllerTest):
|
|||||||
documents_factory = factories.DocumentFactory(2, [1, 1])
|
documents_factory = factories.DocumentFactory(2, [1, 1])
|
||||||
payload = documents_factory.gen_test({})
|
payload = documents_factory.gen_test({})
|
||||||
resp = self.app.simulate_put(
|
resp = self.app.simulate_put(
|
||||||
'/api/v1.0/bucket/mop/documents',
|
'/api/v1.0/buckets/mop/documents',
|
||||||
headers={'Content-Type': 'application/x-yaml'},
|
headers={'Content-Type': 'application/x-yaml'},
|
||||||
body=yaml.safe_dump_all(payload))
|
body=yaml.safe_dump_all(payload))
|
||||||
self.assertEqual(200, resp.status_code)
|
self.assertEqual(200, resp.status_code)
|
||||||
|
@ -29,8 +29,8 @@ does not provide an official media type for YAML, this API will use
|
|||||||
This is a description of the ``v1.0`` API. Documented paths are considered
|
This is a description of the ``v1.0`` API. Documented paths are considered
|
||||||
relative to ``/api/v1.0``.
|
relative to ``/api/v1.0``.
|
||||||
|
|
||||||
PUT ``/bucket/{bucket_name}/documents``
|
PUT ``/buckets/{bucket_name}/documents``
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Accepts a multi-document YAML body and creates a new revision that updates the
|
Accepts a multi-document YAML body and creates a new revision that updates the
|
||||||
contents of the ``bucket_name`` bucket. Documents from the specified bucket that
|
contents of the ``bucket_name`` bucket. Documents from the specified bucket that
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# revision history, whereby the target revision's documents are re-
|
# revision history, whereby the target revision's documents are re-
|
||||||
# created for
|
# created for
|
||||||
# the new revision.
|
# the new revision.
|
||||||
# PUT /api/v1.0/bucket/{bucket_name}/documents
|
# PUT /api/v1.0/buckets/{bucket_name}/documents
|
||||||
# POST /api/v1.0/rollback/{target_revision_id}
|
# POST /api/v1.0/rollback/{target_revision_id}
|
||||||
#"deckhand:create_cleartext_documents": "rule:admin_api"
|
#"deckhand:create_cleartext_documents": "rule:admin_api"
|
||||||
|
|
||||||
@ -23,7 +23,7 @@
|
|||||||
# Conditionally enforced for the endpoints below if the any of the
|
# Conditionally enforced for the endpoints below if the any of the
|
||||||
# documents in
|
# documents in
|
||||||
# the request body have a ``metadata.storagePolicy`` of "encrypted".
|
# the request body have a ``metadata.storagePolicy`` of "encrypted".
|
||||||
# PUT /api/v1.0/bucket/{bucket_name}/documents
|
# PUT /api/v1.0/buckets/{bucket_name}/documents
|
||||||
# POST /api/v1.0/rollback/{target_revision_id}
|
# POST /api/v1.0/rollback/{target_revision_id}
|
||||||
#"deckhand:create_encrypted_documents": "rule:admin_api"
|
#"deckhand:create_encrypted_documents": "rule:admin_api"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user