From 44e08286eca2d524c5b540d2b54bf62255d58b4f Mon Sep 17 00:00:00 2001 From: John Dutton Date: Mon, 18 Dec 2023 10:04:14 -0500 Subject: [PATCH 1/4] Updated API spec with Account Availability endpoints --- openapi.yaml | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index c6db17431..346432350 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -538,6 +538,91 @@ paths: --state PA \ --tax_id ATU99999999 \ --zip 19102 + /account/availability: + x-linode-cli-command: availability + get: + tags: + - account + summary: Account Availability + description: | + Returns service availability depending on region. + + Only authorized Users can access this. + operationId: + servers: + - url: + security: + - personalAccessToken: [] + - oauth: + - + x-linode-cli-action: getAvailability + x-linode-grant: read_only + parameters: + - $ref: '#/components/parameters/pageOffset' + - $ref: '#/components/parameters/pageSize' + responses: + '200': + description: Returns a paginated list of regions and their unavailable resources. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountAvailability' + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl https://api.linode.com/v4/account/availability \ + -H "Authorization: Bearer $TOKEN" + - lang: CLI + source: > + linode-cli account availability getAvailability + /account/availability/{id}: + x-linode-cli-command: availability + parameters: + - name: id + in: path + description: The id of the data center. + required: true + schema: + type: string + get: + tags: + - account + summary: Region Service Availability + description: | + Returns a single region's service availability. + + Only authorized Users can access this. + operationId: + servers: + - url: + security: + - personalAccessToken: [] + - oauth: + - + x-linode-cli-action: getRegionAvailability + x-linode-grant: read_only + parameters: + - $ref: '#/components/parameters/pageOffset' + - $ref: '#/components/parameters/pageSize' + responses: + '200': + description: Returns an object of a region and its unavailable resources. + content: + application/json: + schema: + $ref: '#/components/schemas/AccountAvailability' + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl https://api.linode.com/v4/account/availability/us-east \ + -H "Authorization: Bearer $TOKEN" + - lang: CLI + source: > + linode-cli account availability getRegionAvailability us-east /account/betas: x-linode-cli-command: betas get: @@ -19468,6 +19553,24 @@ components: - May only consist of letters, numbers, spaces, and hyphens. - Must not contain more than 9 letter or number characters. example: 19102-1234 + AccountAvailability: + type: object + description: Account Service Availability object + properties: + region: + type: string + readOnly: true + description: > + Displays the data center represented by a slug. + example: us-east + x-linode-cli-display: 1 + unavailable: + type: list + readOnly: true + description: > + A list of strings of unavailable services. + example: ["Linodes", "Block Storage"] + x-linode-cli-display: 2 AccountSettings: type: object description: Account Settings object From d8e0fb0999ae02014ade22f32ad7515e7c9e427e Mon Sep 17 00:00:00 2001 From: Andy Stevens Date: Mon, 18 Dec 2023 13:48:53 -0500 Subject: [PATCH 2/4] copy edits --- openapi.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 346432350..fdaae4b2b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -545,28 +545,33 @@ paths: - account summary: Account Availability description: | - Returns service availability depending on region. + Returns service unavailability for all available regions. - Only authorized Users can access this. - operationId: - servers: - - url: + Only authorized Users can access this endpoint. + + *This endpoint is currently in **Beta**, and should not be used for production workloads.* + operationId: getAvailability security: - personalAccessToken: [] - oauth: - - + - account:read_only x-linode-cli-action: getAvailability x-linode-grant: read_only - parameters: - - $ref: '#/components/parameters/pageOffset' - - $ref: '#/components/parameters/pageSize' responses: '200': - description: Returns a paginated list of regions and their unavailable resources. + description: | + Returns a paginated list of regions and their unavailable resources. content: application/json: schema: - $ref: '#/components/schemas/AccountAvailability' + allOf: + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/AccountAvailability' + - $ref: '#/components/schemas/PaginationEnvelope' default: $ref: '#/components/responses/ErrorResponse' x-code-samples: @@ -594,21 +599,16 @@ paths: Returns a single region's service availability. Only authorized Users can access this. - operationId: - servers: - - url: + operationId: getRegionAvailability security: - personalAccessToken: [] - oauth: - - + - account:read_only x-linode-cli-action: getRegionAvailability x-linode-grant: read_only - parameters: - - $ref: '#/components/parameters/pageOffset' - - $ref: '#/components/parameters/pageSize' responses: '200': - description: Returns an object of a region and its unavailable resources. + description: Returns an object with a region and the region's unavailable resources. content: application/json: schema: From 13e74a76cffaa866bab5a1442c18ac7f29d3fd4a Mon Sep 17 00:00:00 2001 From: Andy Stevens Date: Mon, 18 Dec 2023 13:54:42 -0500 Subject: [PATCH 3/4] change operationid / x-linode-cli-action --- openapi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index fdaae4b2b..83818ed19 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -599,12 +599,12 @@ paths: Returns a single region's service availability. Only authorized Users can access this. - operationId: getRegionAvailability + operationId: getAccountAvailability security: - personalAccessToken: [] - oauth: - account:read_only - x-linode-cli-action: getRegionAvailability + x-linode-cli-action: getAccountAvailability x-linode-grant: read_only responses: '200': @@ -622,7 +622,7 @@ paths: -H "Authorization: Bearer $TOKEN" - lang: CLI source: > - linode-cli account availability getRegionAvailability us-east + linode-cli account availability getAccountAvailability us-east /account/betas: x-linode-cli-command: betas get: From cab438f519086914d6c4b0243963bbf3f6fce6cc Mon Sep 17 00:00:00 2001 From: Andy Stevens Date: Tue, 19 Dec 2023 12:50:16 -0500 Subject: [PATCH 4/4] Update spec number --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 83818ed19..df111a3c7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.1 info: - version: 4.168.0 + version: 4.169.0 title: Linode API license: name: Apache 2.0