From 3b764ec9bcfb6c84e3cccafa6a2fa83d3d1d373f Mon Sep 17 00:00:00 2001 From: Will Smith Date: Fri, 13 Aug 2021 13:46:17 -0400 Subject: [PATCH 1/3] Include accepted defaults for CLI actions Goes with linode/linode-cli#257 The POST /support/tickets endpoint began accepting "region", but it was only allowed for a specific type of ticket. If configured with a default region, the Linode CLI would automatically include this with every request when running `linode-cli tickets create`, causing many to fail with 400 errors. The linked CLI PR causes the CLI to only include defaults the endpoint says it accepts in the spec, using the new `x-linode-cli-allowed-defaults` extension. This PR includes what endpoints should accept what defaults to preserve existing behavior. --- README.md | 1 + openapi.yaml | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 2283b03eb..167d42a27 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,4 @@ Attribute | Location | Type | Supported By | Explanation `x-linode-cli-rows`| media type | array | linode-cli | A list of JSON paths where the CLI can find the value it should treat as table rows. Only needed for irregular endpoints. `x-linode-cli-use-schema` | media type | schema or $ref | linode-cli | The schema the CLI should use when showing a row for this response. Use with `x-linode-cli-rows`. `x-linode-cli-nested-list` | media type | string | linode-cli | The name of the property defined by this response body's schema that is a nested list. Items in the list will be broken out into rows in the CLI's output. +`x-linode-cli-allowed-defaults` | requestBody | list of string | linode-cli | A list of defaults this action should accept from the CLI. Valid values are "region", "type", and "image" diff --git a/openapi.yaml b/openapi.yaml index d6724c927..9aafa70e1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4153,6 +4153,10 @@ paths: requestBody: description: The requested initial state of a new Linode. required: true + x-linode-cli-allowed-defaults: + - region + - image + - type content: application/json: schema: @@ -4870,6 +4874,9 @@ paths: requestBody: description: The requested state your Linode will be cloned into. required: true + x-linode-cli-allowed-defaults: + - region + - type content: application/json: schema: @@ -7405,6 +7412,8 @@ paths: are ready. requestBody: description: Configuration for the Kubernetes cluster + x-linode-cli-allowed-defaults: + - region content: application/json: schema: @@ -11192,6 +11201,8 @@ paths: requestBody: description: Information about the NodeBalancer to create. required: true + x-linode-cli-allowed-defaults: + - region content: application/json: schema: @@ -15190,6 +15201,8 @@ paths: requestBody: description: The requested initial state of a new Volume. required: true + x-linode-cli-allowed-defaults: + - region content: application/json: schema: From 83425545c1fea086ccc0f1398b75c38e3693f9b3 Mon Sep 17 00:00:00 2001 From: nmelehan Date: Fri, 13 Aug 2021 15:16:15 -0400 Subject: [PATCH 2/3] Fix a broken link that refers to /docs/apilinode-instances/ --- openapi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index d6724c927..df0569fb9 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1821,7 +1821,7 @@ paths: '200': description: Payment Method deactivated. content: - application/json: + application/json: schema: type: object default: @@ -7756,7 +7756,7 @@ paths: "autoscaler": { "enabled": true, "max": 12, - "min": 3 + "min": 3 } }' \ https://api.linode.com/v4/lke/clusters/12345/pools @@ -11086,7 +11086,7 @@ paths: There are several ways to detach a VLAN from a Linode: - [Update](/docs/api/linode-instances/#configuration-profile-update) the active Configuration Profile to remove the VLAN interface, then [reboot](/docs/api/linode-instances/#linode-reboot) the Linode. - - [Create](/docs/api/linode-instances/#configuration-profile-create) a new Configuration Profile without the VLAN interface, then [reboot](/docs/apilinode-instances/#linode-reboot) the Linode into the new Configuration Profile. + - [Create](/docs/api/linode-instances/#configuration-profile-create) a new Configuration Profile without the VLAN interface, then [reboot](/docs/api/linode-instances/#linode-reboot) the Linode into the new Configuration Profile. - [Delete](/docs/api/linode-instances/#linode-delete) the Linode. **Note:** Only Next Generation Network (NGN) data centers support VLANs. Use the Regions ([/regions](/docs/api/regions/)) endpoint to view the capabilities of data center regions. From bd771b9065271c5ea59a791b281d0351fa0d3804 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Mon, 16 Aug 2021 15:49:06 -0400 Subject: [PATCH 3/3] Bump version to 4.101.1 --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index cf8b50f2b..2dd6c8d34 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.1 info: - version: 4.101.0 + version: 4.101.1 title: Linode API description: |