From d35f9a812bc23246dce330a24225cf0048c7ab7d Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 31 Jul 2020 13:23:56 -0400 Subject: [PATCH 01/10] Update Longview plan descriptions for clarity --- openapi.yaml | 65 ++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 9a0d3791f..08453a927 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1669,7 +1669,7 @@ paths: - lang: CLI source: > linode-cli account settings-update \ - --longview_subscription longview-30 \ + --longview_subscription longview-3 \ --network_helper false /account/settings/managed-enable: x-linode-cli-command: account @@ -7184,8 +7184,11 @@ paths: - Longview summary: View Longview Plan description: > - Returns the Longview subscription plan for this account. You can send a request to the - [View Longview Subscription](/api/v4/longview-subscriptions-subscription-id) endpoint for details on each particular subscription plan. + Get the details of your current Longview plan. This returns a LongviewSubscription object + for your current Longview Pro plan, or an empty set `{}` if your current plan is Longview Free. + + + To update your subscription plan, send a request to [Update Longview Plan](/api/v4/longview-plan/#put). operationId: getLongviewPlan x-linode-cli-action: plan-view security: @@ -7194,11 +7197,11 @@ paths: - longview:read_only responses: '200': - description: The Longview Subscription plan for this account. + description: The Longview plan details for this account. content: application/json: schema: - $ref: '#/components/schemas/LongviewPlan' + $ref: '#/components/schemas/LongviewSubscription' default: $ref: '#/components/responses/ErrorResponse' x-code-samples: @@ -7214,8 +7217,12 @@ paths: - Longview summary: Update Longview Plan description: > - Updates the Longview subscription plan for this account. You can send a request to the - [View Longview Subscription](/api/v4/longview-subscriptions-subscription-id) endpoint for details on each particular subscription plan. + Update your Longview plan to that of the given subcription ID. This returns a LongviewSubscription object for + the updated Longview Pro plan, or an empty set `{}` if the updated plan is Longview Free. + + + You can send a request to the [List Longview Subscriptions](/api/v4/longview-subscriptions/) + endpoint to receive the details, including `id`'s, of each plan. operationId: updateLongviewPlan x-linode-cli-action: plan-update security: @@ -7231,22 +7238,11 @@ paths: $ref: '#/components/schemas/LongviewPlan' responses: '200': - description: The requested Longview Subscription. + description: The updated Longview plan details for this account. content: application/json: schema: - properties: - longview_subscription: - type: string - description: > - The Longview subscription plan you are currently subscribed to. - - - - To update your subscription plan send a request to [Update Longview Plan](/api/v4/longview-plan/#put). - 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-10 - x-linode-cli-display: 1 + $ref: '#/components/schemas/LongviewSubscription' default: $ref: '#/components/responses/ErrorResponse' x-code-samples: @@ -7271,8 +7267,8 @@ paths: - Longview summary: List Longview Subscriptions description: > - Returns a paginated list of available Longview Subscriptions. This is - a public endpoint and requires no authentication. + Get the details of all available Longview Subscriptions as a paginated list of + LongviewSubscriptions objects. This is a public endpoint and requires no authentication. operationId: getLongviewSubscriptions x-linode-cli-action: subscriptions-list responses: @@ -7317,13 +7313,13 @@ paths: - Longview summary: View Longview Subscription description: > - Returns a single LongviewSubscription object. This is a public - endpoint and requires no authentication. + Get the Longview plan details as a single LongviewSubscription object for the provided subscription ID. This is a public endpoint + and requires no authentication. operationId: getLongviewSubscription x-linode-cli-action: subscription-view responses: '200': - description: The requested Longview Subscription. + description: The requested Longview Subscription details. content: application/json: schema: @@ -13427,10 +13423,10 @@ components: longview_subscription: type: string description: > - The Longview Pro tier you are currently subscribed to. The value must + The Longview Pro tier you are currently subscribed to. The value must be a [Longview Subscription](/api/v4/longview-subscriptions) - ID or `null`. - example: longview-30 + ID or `null` for Longview Free. + example: longview-3 x-linode-cli-display: 2 network_helper: type: boolean @@ -16319,7 +16315,7 @@ components: LongviewSubscription: type: object description: > - A Longview Subscriptions represents a tier of Longview service you + A Longview Subscription represents a tier of Longview service you can subscribe to. properties: id: @@ -16354,7 +16350,7 @@ components: type: string description: > A display name for this Subscription tier. - example: Longivew Pro 10 pack + example: Longview Pro 10 pack readOnly: true x-linode-cli-display: 2 clients_included: @@ -16372,13 +16368,12 @@ components: longview_subscription: type: string description: > - The Longview subscription plan you are currently subscribed to. - + The LongviewSubscription object `id` for a particular Longview plan. `null` corresponds to Longview Free. - To update your subscription plan send a request to [Update Longview Plan](/api/v4/longview-plan/#put). - 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 + You can send a request to the [List Longview Subscriptions](/api/v4/longview-subscriptions/) + endpoint to receive the details, including `id`'s, of each plan. + example: longview-10 x-linode-cli-display: 1 ManagedContact: type: object From 6553d17691bacf896d8e9e63f6205d03e5dcb665 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 6 Aug 2020 11:22:37 -0400 Subject: [PATCH 02/10] Add enum and nullable to longview subscriptions --- openapi.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 08453a927..5ff7d5a1b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -16320,6 +16320,7 @@ components: properties: id: type: string + enum: ['longview-3', 'longview-10', 'longview-40', 'longview-100'] description: > The unique ID of this Subscription tier. example: longview-10 @@ -16367,6 +16368,8 @@ components: properties: longview_subscription: type: string + enum: ['longview-3', 'longview-10', 'longview-40', 'longview-100'] + nullable: True description: > The LongviewSubscription object `id` for a particular Longview plan. `null` corresponds to Longview Free. From 44b6e8916f6df95f7a53660050471072679b3107 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 7 Aug 2020 08:33:32 -0400 Subject: [PATCH 03/10] Revise LongviewPlan schema description --- openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 5ff7d5a1b..ff9285d74 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -16371,11 +16371,11 @@ components: enum: ['longview-3', 'longview-10', 'longview-40', 'longview-100'] nullable: True description: > - The LongviewSubscription object `id` for a particular Longview plan. `null` corresponds to Longview Free. + The subscription ID for a particular Longview plan. A value of `null` corresponds to Longview Free. You can send a request to the [List Longview Subscriptions](/api/v4/longview-subscriptions/) - endpoint to receive the details, including `id`'s, of each plan. + endpoint to receive the details of each plan. example: longview-10 x-linode-cli-display: 1 ManagedContact: From 4ac71f1731015705b005a25f9f4ed62398fa8ae6 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 7 Aug 2020 10:44:58 -0400 Subject: [PATCH 04/10] Revert List Longview Subscriptions revision --- openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index ff9285d74..bae0a3524 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7267,8 +7267,8 @@ paths: - Longview summary: List Longview Subscriptions description: > - Get the details of all available Longview Subscriptions as a paginated list of - LongviewSubscriptions objects. This is a public endpoint and requires no authentication. + Returns a paginated list of available Longview Subscriptions. This is + a public endpoint and requires no authentication. operationId: getLongviewSubscriptions x-linode-cli-action: subscriptions-list responses: From 10a45f7e83853ff5553d205f724297dbb3842a54 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Mon, 10 Aug 2020 16:25:23 -0400 Subject: [PATCH 05/10] Remove Longview from update Account Settings request --- openapi.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index bae0a3524..f4b39ce00 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1663,13 +1663,11 @@ paths: -H "Authorization: Bearer $TOKEN" \ -X PUT -d '{ "network_helper": true, - "longview_subscription": "longview-10" }' \ https://api.linode.com/v4/account/settings - lang: CLI source: > linode-cli account settings-update \ - --longview_subscription longview-3 \ --network_helper false /account/settings/managed-enable: x-linode-cli-command: account @@ -13422,6 +13420,7 @@ components: x-linode-cli-display: 3 longview_subscription: type: string + readOnly: true description: > The Longview Pro tier you are currently subscribed to. The value must be a [Longview Subscription](/api/v4/longview-subscriptions) From d465ef339e954f9b08937de4384a525665ae81fb Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Wed, 12 Aug 2020 10:23:42 -0400 Subject: [PATCH 06/10] Revise update account settings with longview endpoint link --- openapi.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index f4b39ce00..e5e3858da 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1634,6 +1634,9 @@ paths: summary: Update Account Settings description: > Updates your Account settings. + + + To update your Longview subscription plan, send a request to [Update Longview Plan](/api/v4/longview-plan/#put). operationId: updateAccountSettings x-linode-cli-action: settings-update security: @@ -1649,7 +1652,8 @@ paths: $ref: '#/components/schemas/AccountSettings' responses: '200': - description: The updated Account settings. + description: > + The updated Account settings. content: application/json: schema: From 7ca11c0cf043d8fedde92c68787fb1cfb2099c8c Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Wed, 12 Aug 2020 10:26:24 -0400 Subject: [PATCH 07/10] Revert update account setting description change --- openapi.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index e5e3858da..a403a4cdd 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1652,8 +1652,7 @@ paths: $ref: '#/components/schemas/AccountSettings' responses: '200': - description: > - The updated Account settings. + description: The updated Account settings. content: application/json: schema: From 5d73762a8271d4ca0b556bffd865cf50f48db285 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Wed, 12 Aug 2020 10:33:30 -0400 Subject: [PATCH 08/10] Copy edit --- openapi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index a403a4cdd..1f83c345b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7185,7 +7185,7 @@ paths: - Longview summary: View Longview Plan description: > - Get the details of your current Longview plan. This returns a LongviewSubscription object + Get the details of your current Longview plan. This returns a `LongviewSubscription` object for your current Longview Pro plan, or an empty set `{}` if your current plan is Longview Free. @@ -7218,7 +7218,7 @@ paths: - Longview summary: Update Longview Plan description: > - Update your Longview plan to that of the given subcription ID. This returns a LongviewSubscription object for + Update your Longview plan to that of the given subcription ID. This returns a `LongviewSubscription` object for the updated Longview Pro plan, or an empty set `{}` if the updated plan is Longview Free. @@ -7314,7 +7314,7 @@ paths: - Longview summary: View Longview Subscription description: > - Get the Longview plan details as a single LongviewSubscription object for the provided subscription ID. This is a public endpoint + Get the Longview plan details as a single `LongviewSubscription` object for the provided subscription ID. This is a public endpoint and requires no authentication. operationId: getLongviewSubscription x-linode-cli-action: subscription-view From 6fc73ac4c6af1f758eacdf09095bfd028fa2ee36 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Wed, 12 Aug 2020 14:11:18 -0400 Subject: [PATCH 09/10] Change update longview plan oauth scope --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 1f83c345b..fb6243043 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7229,7 +7229,7 @@ paths: security: - personalAccessToken: [] - oauth: - - account:read_write + - longview:read_write requestBody: description: Update your Longview subscription plan. required: true From d221b443fb00395f7f40ecd15312f8fe1f7f6965 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Wed, 12 Aug 2020 14:57:29 -0400 Subject: [PATCH 10/10] Add global user grant reqs for Longview plan endpoints --- openapi.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index fb6243043..5cfb4cb0b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7189,6 +7189,15 @@ paths: for your current Longview Pro plan, or an empty set `{}` if your current plan is Longview Free. + You must have at least one of the following `global` [User Grants](/api/v4/account-users-username-grants/) + in order to access this endpoint: + + - `"account_access": read_write` + - `"account_access": read_only` + - `"longview_subscription": true` + - `"add_longview": true` + + To update your subscription plan, send a request to [Update Longview Plan](/api/v4/longview-plan/#put). operationId: getLongviewPlan x-linode-cli-action: plan-view @@ -7222,6 +7231,10 @@ paths: the updated Longview Pro plan, or an empty set `{}` if the updated plan is Longview Free. + You must have `"longview_subscription": true` configured as a `global` + [User Grant](/api/v4/account-users-username-grants/) in order to access this endpoint. + + You can send a request to the [List Longview Subscriptions](/api/v4/longview-subscriptions/) endpoint to receive the details, including `id`'s, of each plan. operationId: updateLongviewPlan