From 8d45abd2f8a78c857fbec29511d7f8b72dd12d5a Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Mon, 17 Apr 2023 10:02:55 -0400 Subject: [PATCH 1/6] Added Metadata service --- openapi.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 0f110d078..fa5c7a08f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6826,6 +6826,10 @@ paths: * Disks and Configs must be created manually. * This is only recommended for advanced use cases. + * **BETA** Using cloud-init with [Metadata](/docs/products/compute/compute-instances/guides/metadata/). + * Automate system configuration and software installation by providing a base-64 encoded [cloud-config](/docs/products/compute/compute-instances/guides/metadata-cloud-config/) file. + * This feature is in beta and is currently limited to certain Regions and distributions. Please be aware that this feature may receive breaking updates in the future. This notice will be removed when this feature is out of beta. + **Important**: You must be an unrestricted User in order to add or modify tags on Linodes. tags: @@ -22207,6 +22211,17 @@ components: The "+order_by" and "+order" operators are not available for [filtering](/docs/api/#filtering-and-sorting) on this key. example: available + capabilities: + type: array + readOnly: true + items: + type: object + description: A list of capabilities of this Image. + properties: + cloud-init: + type: boolean + example: false + description: Whether this Image supports cloud-init with [Metadata](/docs/products/compute/compute-instances/guides/metadata/). Only applies to public Images. Invoice: type: object description: Account Invoice object @@ -23388,6 +23403,22 @@ components: If it is deployed from an Image or a Backup and you wish it to remain `offline` after deployment, set this to `false`. default: true + metadata: + type: object + writeOnly: true + description: | + An object containing user-defined data relevant to the creation of Linodes. + properties: + user_data: + type: string + format: byte + description: | + Base64-encoded [cloud-config](/docs/products/compute/compute-instances/guides/metadata-cloud-config/) data. + + Must not be included when cloing to an existing Linode. + + Unencoded data must not exceed 65535 bytes, or about 16kb encoded. + example: I2Nsb3VkLWNvbmZpZwpwYWNrYWdlX3VwZGF0ZTogdHJ1ZQpwYWNrYWdlX3VwZ3JhZGU6IHRydWU= LinodeStats: type: object description: > From b20d603cc62675a5c4ee2fc2a8265cef012cad49 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 24 Aug 2023 12:21:57 -0400 Subject: [PATCH 2/6] Fixed Images cloud-init --- openapi.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index fa5c7a08f..069b20ea1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6828,6 +6828,7 @@ paths: * **BETA** Using cloud-init with [Metadata](/docs/products/compute/compute-instances/guides/metadata/). * Automate system configuration and software installation by providing a base-64 encoded [cloud-config](/docs/products/compute/compute-instances/guides/metadata-cloud-config/) file. + * Requires a compatible Image. You can determine compatible Images by checking for `cloud-init` under `capabilities` when using Images List ([GET /images](/docs/api/images/#images-list)). * This feature is in beta and is currently limited to certain Regions and distributions. Please be aware that this feature may receive breaking updates in the future. This notice will be removed when this feature is out of beta. **Important**: You must be an unrestricted User in order to add or modify @@ -22212,16 +22213,17 @@ components: The "+order_by" and "+order" operators are not available for [filtering](/docs/api/#filtering-and-sorting) on this key. example: available capabilities: + x-linode-cli-display: 8 type: array readOnly: true + description: | + A list containing the following possible capabilities of this Image: + + `cloud-init`: This Image supports cloud-init with [Metadata](/docs/products/compute/compute-instances/guides/metadata/). Only applies to public Images. items: - type: object - description: A list of capabilities of this Image. - properties: - cloud-init: - type: boolean - example: false - description: Whether this Image supports cloud-init with [Metadata](/docs/products/compute/compute-instances/guides/metadata/). Only applies to public Images. + type: string + example: + - cloud-init Invoice: type: object description: Account Invoice object From b513d3d4b199f5b323f02336288a1b885322465a Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 24 Aug 2023 12:30:47 -0400 Subject: [PATCH 3/6] Fixed typo --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 069b20ea1..1a5ff7cc7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -23417,7 +23417,7 @@ components: description: | Base64-encoded [cloud-config](/docs/products/compute/compute-instances/guides/metadata-cloud-config/) data. - Must not be included when cloing to an existing Linode. + Must not be included when cloning to an existing Linode. Unencoded data must not exceed 65535 bytes, or about 16kb encoded. example: I2Nsb3VkLWNvbmZpZwpwYWNrYWdlX3VwZGF0ZTogdHJ1ZQpwYWNrYWdlX3VwZ3JhZGU6IHRydWU= From 2eaa275c8c490dae5c2dda59169fece3a126f7d9 Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 24 Aug 2023 13:04:19 -0400 Subject: [PATCH 4/6] Added has_user_data to Linode --- openapi.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 1a5ff7cc7..7be38a903 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6933,7 +6933,7 @@ paths: "backup_id": 1234, "backups_enabled": true, "swap_size": 512, - "image": "linode/debian9", + "image": "linode/ubuntu22.04", "root_pass": "aComplexP@ssword", "stackscript_id": 10079, "stackscript_data": { @@ -6962,7 +6962,10 @@ paths: "label": "linode123", "type": "g6-standard-2", "region": "us-east", - "group": "Linode-Group" + "group": "Linode-Group", + "metadata": { + "user_data": "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlX3VwZGF0ZTogdHJ1ZQpwYWNrYWdlX3VwZ3JhZGU6IHRydWU=" + } }' \ https://api.linode.com/v4/linode/instances - lang: CLI @@ -23202,6 +23205,11 @@ components: description: The Linode's host machine, as a UUID. readOnly: true example: 3a3ddd59d9a78bb8de041391075df44de62bfec8 + has_user_data: + type: boolean + description: Whether this compute instance was provisioned utilizing `user_data` provided via the Metadata service. See the [Linode Create](/docs/api/linode-instances/#linode-create) description for more information on Metadata. + readOnly: true + example: true LinodeConfig: type: object properties: From 59957e7d3239c9bb7e73e1966d4641c5bbf4cebe Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 24 Aug 2023 13:11:27 -0400 Subject: [PATCH 5/6] Added Regions insruction to description --- openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi.yaml b/openapi.yaml index 7be38a903..aa936e49b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6829,6 +6829,7 @@ paths: * **BETA** Using cloud-init with [Metadata](/docs/products/compute/compute-instances/guides/metadata/). * Automate system configuration and software installation by providing a base-64 encoded [cloud-config](/docs/products/compute/compute-instances/guides/metadata-cloud-config/) file. * Requires a compatible Image. You can determine compatible Images by checking for `cloud-init` under `capabilities` when using Images List ([GET /images](/docs/api/images/#images-list)). + * Requires a compatible Region. You can determine compatible Regions by checking for `Metadata` under `capabilities` when using Regions List ([GET /regions](/docs/api/regions/#regions-list)). * This feature is in beta and is currently limited to certain Regions and distributions. Please be aware that this feature may receive breaking updates in the future. This notice will be removed when this feature is out of beta. **Important**: You must be an unrestricted User in order to add or modify From 298bbb16186e0ebe758229e6636a50de64ad8ddc Mon Sep 17 00:00:00 2001 From: bbiggerr Date: Thu, 24 Aug 2023 15:31:33 -0400 Subject: [PATCH 6/6] Update Linode Create CLI example --- openapi.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index aa936e49b..59f16a69a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6965,7 +6965,7 @@ paths: "region": "us-east", "group": "Linode-Group", "metadata": { - "user_data": "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlX3VwZGF0ZTogdHJ1ZQpwYWNrYWdlX3VwZ3JhZGU6IHRydWU=" + "user_data": "I2Nsb3VkLWNvbmZpZw==" } }' \ https://api.linode.com/v4/linode/instances @@ -6979,9 +6979,10 @@ paths: --stackscript_data '{"gh_username": "linode"}' \ --region us-east \ --type g6-standard-2 \ - --authorized_keys "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" - --authorized_users "myUser" - --authorized_users "secondaryUser" + --authorized_keys "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" \ + --authorized_users "myUser" \ + --authorized_users "secondaryUser" \ + --metadata.user_data "I2Nsb3VkLWNvbmZpZw==)" /linode/instances/{linodeId}: parameters: - name: linodeId