From b10cf84e15bb933ba573797f4b2303a044323172 Mon Sep 17 00:00:00 2001 From: hzoppetti Date: Wed, 8 Jul 2020 15:51:57 -0400 Subject: [PATCH 1/3] added new endpoint and schema object for account/maintenance --- openapi.yaml | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 05b7b6182..46b77b696 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -957,6 +957,50 @@ paths: - lang: CLI source: > linode-cli account login-view 1234 + /account/maintenance: + x-linode-cli-command: maintenance + get: + x-linode-grant: read_only + tags: + - Maintenance + summary: List Maintenance + description: > + Returns a collection of Maintenance objects for any entity + a user has permissions to view. + operationId: getMaintenance + x-linode-cli-action: maintenance-list + security: + - personalAccessToken: [] + - oauth: + - maintenance:read_only + responses: + '200': + description: Returns a paginated list of Maintenance objects. + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Maintenance' + page: + $ref: '#/components/schemas/PaginationEnvelope/properties/page' + pages: + $ref: '#/components/schemas/PaginationEnvelope/properties/pages' + results: + $ref: '#/components/schemas/PaginationEnvelope/properties/results' + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Authorization: Bearer $TOKEN" \ + https://api.linode.com/v4/account/maintenance + - lang: CLI + source: > + linode-cli account maintenance-list /account/notifications: x-linode-cli-command: account get: @@ -16274,6 +16318,69 @@ components: The value must be a [Longview Subscription ID](/api/v4/longview-subscriptions) or `null`. Note that a value of `null` will cancel the Longview subscription. example: longview-30 x-linode-cli-display: 1 + Maintenance: + type: object + description: > + Information about maintenance affecting an entity. + properties: + type: + type: string + enum: + - reboot + - cold_migration + - live_migration + description: > + The type of maintenance. + example: reboot + status: + type: string + enum: + - pending + - ticketed + - scheduled + - ready + - started + - completed + - cancelled + description: > + The maintenance status. + example: started + reason: + type: string + description: > + The reason maintenance is being performed. + example: This maintenance will allow us to update the BIOS on the host’s motherboard. + when: + type: string + description: > + When the maintenance will begin. + format: date-time + example: 2020-07-09T00:01:01 + entity: + type: object + description: > + The entity being affected by maintenance. + properties: + label: + type: string + description: > + The label of the entity being affected by maintenance. + example: demo-linode + id: + type: number + description: > + The id of the entity being affected by maintenance. + example: 1234 + type: + type: string + description: > + The type of entity. + example: Linode + url: + type: string + description: > + The API endpoint prefix to use in combination with the entity id to find specific information about the entity. + example: https://api.linode.com/v4/linode/instances/{linodeId} ManagedContact: type: object description: > From 9b4514d9f26c793de81776524e37361a25da742b Mon Sep 17 00:00:00 2001 From: hzoppetti Date: Fri, 10 Jul 2020 09:37:21 -0400 Subject: [PATCH 2/3] updates from comments --- openapi.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 46b77b696..5ac5eb708 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -961,12 +961,17 @@ paths: x-linode-cli-command: maintenance get: x-linode-grant: read_only + servers: + - url: https://api.linode.com/v4beta tags: - Maintenance summary: List Maintenance description: > Returns a collection of Maintenance objects for any entity a user has permissions to view. + + + Currently, Linodes are the only entities available for viewing. operationId: getMaintenance x-linode-cli-action: maintenance-list security: @@ -997,7 +1002,7 @@ paths: - lang: Shell source: > curl -H "Authorization: Bearer $TOKEN" \ - https://api.linode.com/v4/account/maintenance + https://api.linode.com/v4beta/account/maintenance - lang: CLI source: > linode-cli account maintenance-list @@ -16324,6 +16329,7 @@ components: Information about maintenance affecting an entity. properties: type: + x-linode-filterable: true type: string enum: - reboot @@ -16333,15 +16339,13 @@ components: The type of maintenance. example: reboot status: + x-linode-filterable: true type: string enum: - pending - - ticketed - - scheduled - ready - started - completed - - cancelled description: > The maintenance status. example: started From 1ee47f9a6924432f21aa1a5b0d37074f4adcc7c6 Mon Sep 17 00:00:00 2001 From: hzoppetti Date: Thu, 16 Jul 2020 11:12:59 -0400 Subject: [PATCH 3/3] keep with account group --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 5ac5eb708..512402224 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -964,7 +964,7 @@ paths: servers: - url: https://api.linode.com/v4beta tags: - - Maintenance + - Account summary: List Maintenance description: > Returns a collection of Maintenance objects for any entity