From 66fedcb9e3ebed4a54be2b39260f13bf88187202 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 25 Jun 2021 13:03:20 -0400 Subject: [PATCH 1/3] Add tags property and refactor NodePool schema --- openapi.yaml | 108 +++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 59 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 79e24634b..c529c07c5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7522,17 +7522,7 @@ paths: application/json: schema: type: object - properties: - type: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/type' - count: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/count' - disks: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/disks' - id: - $ref: '#/components/schemas/LKENodePool/properties/id' - nodes: - $ref: '#/components/schemas/LKENodePool/properties/nodes' + $ref: '#/components/schemas/LKENodePool' default: $ref: '#/components/responses/ErrorResponse' x-code-samples: @@ -7542,14 +7532,16 @@ paths: -H "Authorization: Bearer $TOKEN" \ -X POST -d '{ "type": "g6-standard-4", - "count": 6 + "count": 6, + "tags": ["example-tag"] }' \ https://api.linode.com/v4/lke/clusters/12345/pools - lang: CLI source: > linode-cli lke pool-create 12345 \ --type g6-standard-4 \ - --count 6 + --count 6 \ + --tags example-tag /lke/clusters/{clusterId}/recycle: parameters: - name: clusterId @@ -7627,18 +7619,7 @@ paths: content: application/json: schema: - type: object - properties: - type: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/type' - count: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/count' - disks: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/disks' - id: - $ref: '#/components/schemas/LKENodePool/properties/id' - nodes: - $ref: '#/components/schemas/LKENodePool/properties/nodes' + $ref: '#/components/schemas/LKENodePool' x-code-samples: - lang: Shell source: > @@ -7677,18 +7658,7 @@ paths: content: application/json: schema: - type: object - properties: - type: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/type' - count: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/count' - disks: - $ref: '#/components/schemas/LKENodePoolRequestBody/properties/disks' - id: - $ref: '#/components/schemas/LKENodePool/properties/id' - nodes: - $ref: '#/components/schemas/LKENodePool/properties/nodes' + $ref: '#/components/schemas/LKENodePool' x-code-samples: - lang: Shell source: > @@ -18961,24 +18931,17 @@ components: cluster. properties: type: - type: string - description: A Linode Type for all of the nodes in the Node Pool. - example: g6-standard-4 + $ref: '#/components/schemas/LKENodePool/properties/type' count: - type: integer - description: The number of nodes in the Node Pool. - minimum: 1 - maximum: 100 - example: 6 + $ref: '#/components/schemas/LKENodePool/properties/count' disks: type: array x-linode-cli-format: json - description: > + description: | **Note**: This field should be omitted except for special use cases. The disks specified here are partitions in *addition* to the primary partition and reduce the size of the primary partition, which can lead to stability problems for the Node. - This Node Pool's custom disk layout. Each item in this array will create a new disk partition for each node in this Node Pool. @@ -18986,6 +18949,34 @@ components: * The maximum number of custom disk partitions that can be configured is 7. * Once the requested disk paritions are allocated, the remaining disk space is allocated to the node's boot disk. * A Node Pool's custom disk layout is immutable over the lifetime of the Node Pool. + items: + $ref: '#/components/schemas/LKENodePool/properties/disks/items' + tags: + $ref: '#/components/schemas/LKENodePool/properties/tags' + LKENodePool: + # Note that LKENodePool inherits all properties of + # LKENodePoolRequestBody and then overrides some of the sub-properties + type: object + description: > + The set of Node Pools which are members of the Kubernetes cluster. + Node Pools consist of a Linode type, the number of Linodes to + deploy of that type, and additional status information. + properties: + type: + type: string + description: The Linode Type for all of the nodes in the Node Pool. + example: g6-standard-4 + count: + type: integer + description: The number of nodes in the Node Pool. + minimum: 1 + maximum: 100 + example: 6 + disks: + type: array + x-linode-cli-format: json + description: | + This Node Pool's custom disk layout. items: type: object description: > @@ -19006,18 +18997,6 @@ components: - raw - ext4 example: ext-4 - LKENodePool: - # Note that LKENodePool inherits all properties of - # LKENodePoolRequestBody and then overrides some of the sub-properties - type: object - allOf: - - $ref: '#/components/schemas/LKENodePoolRequestBody' - - type: object - description: > - The set of Node Pools which are members of the Kubernetes cluster. - Node Pools consist of a Linode type, the number of Linodes to - deploy of that type, and additional status information. - properties: id: type: integer description: > @@ -19032,6 +19011,17 @@ components: the instance_id will be returned as null. items: $ref: '#/components/schemas/LKENodeStatus' + tags: + x-linode-filterable: true + description: > + An array of tags applied to this object. Tags are for organizational + purposes only. + type: array + items: + type: string + example: + - example tag + - another example LKENodeStatus: type: object description: > From 0ee37d807c9cc4c678a42223deebec9be37b63bc Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 25 Jun 2021 13:23:25 -0400 Subject: [PATCH 2/3] Fix response schema error --- openapi.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index c529c07c5..e9b5a4942 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7521,7 +7521,6 @@ paths: content: application/json: schema: - type: object $ref: '#/components/schemas/LKENodePool' default: $ref: '#/components/responses/ErrorResponse' From 60f31bbc35aa8a1635ed3b95d48aedc2d27c52de Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Fri, 25 Jun 2021 14:45:34 -0400 Subject: [PATCH 3/3] Remove NodePool comments --- openapi.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index e9b5a4942..ea1475959 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -18953,8 +18953,6 @@ components: tags: $ref: '#/components/schemas/LKENodePool/properties/tags' LKENodePool: - # Note that LKENodePool inherits all properties of - # LKENodePoolRequestBody and then overrides some of the sub-properties type: object description: > The set of Node Pools which are members of the Kubernetes cluster.