From 932e7882ecc07d282a53f8f0084108203056de06 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Fri, 30 Oct 2020 16:27:29 -0400 Subject: [PATCH 01/11] /object-storage/buckets/{clusterId}/{bucket}/access is now PUT Endpoint still supports POST method, but docs now show it as PUT for consistency with API convention and new GET method for this endpoint. --- openapi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index b75247485..41853b418 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11121,12 +11121,12 @@ paths: required: true schema: type: string - post: + put: operationId: modifyObjectStorageBucketAccess x-linode-cli-skip: true servers: - url: https://api.linode.com/v4 - summary: Object Storage Bucket Access Modify + summary: Object Storage Bucket Access Update description: | Allows changing basic Cross-origin Resource Sharing (CORS) and Access Control Level (ACL) settings. Only allows enabling/disabling CORS for all origins, and/or setting canned ACLs. @@ -11178,7 +11178,7 @@ paths: source: > curl -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ - -X POST -d '{ + -X PUT -d '{ "cors_enabled": true, "acl": "private" }' \ From 4ad7b11b9c2c718b3c20a49f18184443c80d822a Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Fri, 30 Oct 2020 16:56:26 -0400 Subject: [PATCH 02/11] Add GET /object-storage/transfer/ --- openapi.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index b75247485..9fe61bc20 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11850,6 +11850,46 @@ paths: source: > linode-cli object-storage ssl-delete \ us-east-1 example-bucket + /object-storage/transfer: + get: + operationId: getObjectStorageTransfer + x-linode-cli-skip: true + servers: + - url: https://api.linode.com/v4 + summary: Object Storage Transfer View + description: | + The amount of outbound data transfer used by your account's Object Storage buckets. + Object Storage adds 1 terabyte of outbound data transfer to your data transfer pool. + See the [Object Storage Pricing and Limitations](/docs/guides/pricing-and-limitations/) + guide for details on Object Storage transfer quotas. + + tags: + - Object Storage + security: + - personalAccessToken: [] + - oauth: + - object_storage:read_write + responses: + '200': + description: A paginated list of buckets you own. + content: + application/json: + schema: + properties: + used: + type: integer + description: > + The amount of outbound data transfer used by your account's Object Storage buckets, + in GB, for the current month’s billing cycle. + example: 12956600198 + readOnly: true + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Authorization: Bearer $TOKEN" \ + https://api.linode.com/v4/object-storage/transfer/ /profile: x-linode-cli-command: profile get: From ac7b8ed063d04647f84031c11d7553fe86744bcd Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Mon, 2 Nov 2020 12:00:48 -0500 Subject: [PATCH 03/11] Update oauth scope and description --- openapi.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 9fe61bc20..a67951ff1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11868,10 +11868,11 @@ paths: security: - personalAccessToken: [] - oauth: - - object_storage:read_write + - object_storage:read_only responses: '200': - description: A paginated list of buckets you own. + description: > + Returns the amount of outbound data transfer used by your account's Object Storage buckets. content: application/json: schema: From 1d893fc1598cac676f0895b494f355ce91c8c69d Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Mon, 2 Nov 2020 12:46:24 -0500 Subject: [PATCH 04/11] Add objects field to bucket endpoints --- openapi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 61c802245..bf8df3c6c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -18894,6 +18894,11 @@ components: type: integer description: The size of the bucket in bytes. example: 188318981 + objects: + type: integer + description: > + The number of objects stored in this bucket. + example: 4 ObjectStorageObject: type: object description: > From 351d4d05dbc5a6f0b48cd739b06addb48e2ff450 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Mon, 2 Nov 2020 14:27:40 -0500 Subject: [PATCH 05/11] Add POST method back Spec should display both methods, since both methods can modify this resource. --- openapi.yaml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 41853b418..1d3daf3b4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11121,6 +11121,69 @@ paths: required: true schema: type: string + post: + operationId: modifyObjectStorageBucketAccess + x-linode-cli-skip: true + servers: + - url: https://api.linode.com/v4 + summary: Object Storage Bucket Access Modify + description: | + Allows changing basic Cross-origin Resource Sharing (CORS) and Access Control Level (ACL) settings. + Only allows enabling/disabling CORS for all origins, and/or setting canned ACLs. + For more fine-grained control of both systems, please use the S3 API directly. + + + + This endpoint is available for convenience. It is recommended that instead you + use the more more [fully-featured S3 API](https://docs.ceph.com/docs/mimic/radosgw/s3/bucketops/#put-bucket-acl) directly. + tags: + - Object Storage + security: + - personalAccessToken: [] + - oauth: + - object_storage:read_write + requestBody: + description: The changes to make to the bucket's access controls. + content: + application/json: + schema: + properties: + cors_enabled: + type: boolean + description: > + If true, the bucket will be created with CORS enabled for all + origins. For more fine-grained controls of CORS, use the S3 + API directly. + example: true + acl: + type: string + enum: + - private + - public-read + - authenticated-read + description: > + The Access Control Level of the bucket, as a canned ACL string. + For more fine-grained control of ACLs, use the S3 API directly. + example: private + responses: + '200': + description: Access controls updated. + content: + application/json: + schema: + type: object + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X POST -d '{ + "cors_enabled": true, + "acl": "private" + }' \ + https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/access put: operationId: modifyObjectStorageBucketAccess x-linode-cli-skip: true From a7f8261d32fe775f67621e2123a9ac17190dcc0f Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Fri, 30 Oct 2020 16:15:10 -0400 Subject: [PATCH 06/11] Add GET Object ACL --- openapi.yaml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 52e8658e5..bd4deb97b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11246,6 +11246,70 @@ paths: "acl": "private" }' \ https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/access + /object-storage/buckets/{clusterId}/{bucket}/object-acl: + parameters: + - name: clusterId + in: path + description: The ID of the cluster this bucket exists in. + required: true + schema: + type: string + - name: bucket + in: path + description: The bucket name. + required: true + schema: + type: string + get: + operationId: viewObjectStorageBucketAccess + x-linode-cli-skip: true + servers: + - url: https://api.linode.com/v4 + summary: Object Storage Object ACL Config View + description: | + This Object Storage bucket's currently configured Access Control List (ACL). + ACLs define who can access your buckets and objects and specify the level of access + granted to those users. + + + This endpoint is available for convenience. It is recommended that instead you + use the more more [fully-featured S3 API](https://docs.ceph.com/docs/mimic/radosgw/s3/bucketops/#put-bucket-acl) directly. + tags: + - Object Storage + security: + - personalAccessToken: [] + - oauth: + - object_storage:read_only + responses: + '200': + description: The Object's canned ACL and policy. + content: + application/json: + schema: + type: object + properties: + acl: + type: string + enum: + - private + - public-read + - authenticated-read + description: > + The Access Control Level of the bucket, as a canned ACL string. + For more fine-grained control of ACLs, use the S3 API directly. + example: public-read + acl_xml: + type: string + description: > + The full XML of the object's ACL policy. + example: "..." + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Authorization: Bearer $TOKEN" \ + https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/object-acl /object-storage/buckets/{clusterId}/{bucket}/object-list: parameters: - name: clusterId From f748af45035a00c48a34745627a194fad1324dc2 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Tue, 3 Nov 2020 10:43:25 -0500 Subject: [PATCH 07/11] Add name query parameter --- openapi.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index bd4deb97b..c43c708c5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11280,6 +11280,16 @@ paths: - personalAccessToken: [] - oauth: - object_storage:read_only + parameters: + - name: name + in: query + required: true + description: > + The `name` of the object for which to retrieve its Access Control List (ACL). + Use the [Object Storage Bucket Contents List](/docs/api/object-storage/#object-storage-bucket-contents-list) + endpoint to access all object names in a bucket. + schema: + type: string responses: '200': description: The Object's canned ACL and policy. @@ -11309,7 +11319,7 @@ paths: - lang: Shell source: > curl -H "Authorization: Bearer $TOKEN" \ - https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/object-acl + https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/object-acl?name=example.txt /object-storage/buckets/{clusterId}/{bucket}/object-list: parameters: - name: clusterId From 744b8730d4c09d5cb0ab1bbe16ecee2e9a5dac13 Mon Sep 17 00:00:00 2001 From: Josh Sager Date: Tue, 3 Nov 2020 13:05:23 -0500 Subject: [PATCH 08/11] bug: Added `@` to ticket attachment curl example It's required in order to use the API to add a file attachment. Confirmed in manual testing in alpha env. --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 52e8658e5..2aca44f91 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -13347,7 +13347,7 @@ paths: source: > curl -H "Authorization: Bearer $TOKEN" \ -X POST \ - -F 'file=/Users/LinodeGuy/pictures/screen_shot.jpg' \ + -F 'file=@/Users/LinodeGuy/pictures/screen_shot.jpg' \ https://api.linode.com/v4/support/tickets/11223344/attachments /support/tickets/{ticketId}/close: parameters: From 77e8d6881ec357ef7be1a88baa9d7bd2e6d93bde Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Tue, 3 Nov 2020 17:18:02 -0500 Subject: [PATCH 09/11] Add missing ACL options --- openapi.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index c43c708c5..2e8ceb160 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11161,6 +11161,8 @@ paths: - private - public-read - authenticated-read + - public-read-write + - custom description: > The Access Control Level of the bucket, as a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. @@ -11223,6 +11225,8 @@ paths: - private - public-read - authenticated-read + - public-read-write + - custom description: > The Access Control Level of the bucket, as a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. @@ -11304,6 +11308,8 @@ paths: - private - public-read - authenticated-read + - public-read-write + - custom description: > The Access Control Level of the bucket, as a canned ACL string. For more fine-grained control of ACLs, use the S3 API directly. From e6eb5b0b6242308a29ec67867aea8eea2ebec3d9 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Wed, 4 Nov 2020 09:33:19 -0500 Subject: [PATCH 10/11] Bump version to 4.79.0 --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 4e5259592..cd77356a3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.1 info: - version: 4.78.3 + version: 4.79.0 title: Linode API description: | From 3175b73595e70cd773676b993b65242bec205ac7 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Wed, 4 Nov 2020 12:01:19 -0500 Subject: [PATCH 11/11] Add PUT Object Storage Object ACL Config Update --- openapi.yaml | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index cd77356a3..90f960eba 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11277,7 +11277,7 @@ paths: This endpoint is available for convenience. It is recommended that instead you - use the more more [fully-featured S3 API](https://docs.ceph.com/docs/mimic/radosgw/s3/bucketops/#put-bucket-acl) directly. + use the more more [fully-featured S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object-acl.html) directly. tags: - Object Storage security: @@ -11326,6 +11326,90 @@ paths: source: > curl -H "Authorization: Bearer $TOKEN" \ https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/object-acl?name=example.txt + put: + operationId: viewObjectStorageBucketAccess + x-linode-cli-skip: true + servers: + - url: https://api.linode.com/v4 + summary: Object Storage Object ACL Config Update + description: | + Update an Object's configured Access Control List (ACL) in this Object Storage bucket. + ACLs define who can access your buckets and objects and specify the level of access + granted to those users. + + + This endpoint is available for convenience. It is recommended that instead you + use the more more [fully-featured S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object-acl.html) directly. + tags: + - Object Storage + security: + - personalAccessToken: [] + - oauth: + - object_storage:read_write + parameters: + - name: name + in: query + required: true + description: > + The `name` of the object for which to update its Access Control List (ACL). + Use the [Object Storage Bucket Contents List](/docs/api/object-storage/#object-storage-bucket-contents-list) + endpoint to access all object names in a bucket. + schema: + type: string + requestBody: + description: The changes to make to this Object's access controls. + content: + application/json: + schema: + properties: + acl: + type: string + enum: + - private + - public-read + - authenticated-read + - public-read-write + - custom + description: > + The Access Control Level of the bucket, as a canned ACL string. + For more fine-grained control of ACLs, use the S3 API directly. + example: public-read + responses: + '200': + description: The Object's canned ACL and policy. + content: + application/json: + schema: + type: object + properties: + acl: + type: string + enum: + - private + - public-read + - authenticated-read + - public-read-write + - custom + description: > + The Access Control Level of the bucket, as a canned ACL string. + For more fine-grained control of ACLs, use the S3 API directly. + example: public-read + acl_xml: + type: string + description: > + The full XML of the object's ACL policy. + example: "..." + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X PUT -d '{ + "acl": "public-read" + }' \ + https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/object-acl?name=example.txt /object-storage/buckets/{clusterId}/{bucket}/object-list: parameters: - name: clusterId