From 3a04f37be1d87da810ac8689b169b72da3fa54ab Mon Sep 17 00:00:00 2001 From: hzoppetti Date: Thu, 3 Sep 2020 12:39:04 -0400 Subject: [PATCH 1/6] added POST /linode/instances/{linodeId}/password --- openapi.yaml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 61390d6bc..296dcfbf0 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5325,6 +5325,72 @@ paths: - lang: CLI source: > linode-cli linodes upgrade 123 + /linode/instances/{linodeId}/password: + parameters: + - name: linodeId + in: path + description: ID of the linode to reboot. + required: true + schema: + type: integer + x-linode-cli-command: linodes + post: + x-linode-grant: read_write + summary: Reset Linode Root Password + description: > + Resets the root password for a Linode. + + + **Note:** A root password can only be reset using this method + if it has only one non-swap disk. + tags: + - Linode Instances + operationId: resetLinodePassword + x-linode-cli-action: linode-reset-password + security: + - personalAccessToken: [] + - oauth: + - linodes:read_write + requestBody: + description: The new root password. + content: + 'application/json': + schema: + required: + - root_pass + properties: + root_pass: + type: string + description: > + The root user's password on the Linode. Linode passwords + have the following constraints: + + + Must meet a password strength score requirement that is calculated internally + by the API. If the strength requirement is not met, you will receive a + Password does not meet strength requirement error. + example: a$eCure4assw0rd!43v51 + responses: + '200': + description: Password Reset. + content: + application/json: + schema: + type: object + default: + $ref: '#/components/responses/ErrorResponse' + x-code-samples: + - lang: Shell + source: > + curl -H "Content-Type: application/json" \ + -H "Authorization: Bearer $TOKEN" \ + -X POST -d '{ + "root_pass": "a$eCure4assw0rd!43v51" + }' \ + https://api.linode.com/v4/linode/instances/123/password + - lang: CLI + source: > + linode-cli linodes linode-reset-password 123 a$eCure4assw0rd!43v51 /linode/instances/{linodeId}/reboot: parameters: - name: linodeId From c3a0de036caae8af9e05e0cbc7767f0b6eceea59 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Thu, 3 Sep 2020 17:22:41 -0400 Subject: [PATCH 2/6] copy edit --- openapi.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 296dcfbf0..25930cd95 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5329,7 +5329,7 @@ paths: parameters: - name: linodeId in: path - description: ID of the linode to reboot. + description: ID of the Linode for which to reset it's root password. required: true schema: type: integer @@ -5338,11 +5338,12 @@ paths: x-linode-grant: read_write summary: Reset Linode Root Password description: > - Resets the root password for a Linode. + Resets the root password for this Linode. + - **Note:** A root password can only be reset using this method - if it has only one non-swap disk. + **Note:** If your Linode has more than one disk (not counting its swap disk), use the + [Reset Disk Root Password](/api/v4/linode-instances-linode-id-disks-disk-id-password/#post) endpoint to update a specific disk's root password. tags: - Linode Instances operationId: resetLinodePassword @@ -5352,7 +5353,7 @@ paths: - oauth: - linodes:read_write requestBody: - description: The new root password. + description: This Linode's new root password. content: 'application/json': schema: @@ -5362,7 +5363,7 @@ paths: root_pass: type: string description: > - The root user's password on the Linode. Linode passwords + The root user's password on this Linode. Linode passwords have the following constraints: From 007ae04467b705f6225364b3b9fe98b701c80cb8 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Thu, 3 Sep 2020 17:27:07 -0400 Subject: [PATCH 3/6] Add reset root password event to Event schema --- openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi.yaml b/openapi.yaml index 25930cd95..5153f762d 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -14381,6 +14381,7 @@ components: - password_reset - payment_submitted - profile_update + - reset_root_password - stackscript_create - stackscript_delete - stackscript_update From 12f90208952981a6d0318d422ebbe93ef0af92c0 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Thu, 3 Sep 2020 17:35:52 -0400 Subject: [PATCH 4/6] Add note about root_password_reset event There is a password_reset event, so wanted to make it clear which one corresponds to this endpoint. --- openapi.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 5153f762d..3493626d8 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5344,6 +5344,9 @@ paths: **Note:** If your Linode has more than one disk (not counting its swap disk), use the [Reset Disk Root Password](/api/v4/linode-instances-linode-id-disks-disk-id-password/#post) endpoint to update a specific disk's root password. + + + A `reset_root_password` event is generated when a root password reset is successful. tags: - Linode Instances operationId: resetLinodePassword From d95589b10127e39827f5753a45e1df74b6c310c0 Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Thu, 3 Sep 2020 18:18:27 -0400 Subject: [PATCH 5/6] The event is password_reset Kept note about the event in the /linode/instances/{linodeId}/password description. --- openapi.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 3493626d8..6cbe51775 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5346,7 +5346,7 @@ paths: [Reset Disk Root Password](/api/v4/linode-instances-linode-id-disks-disk-id-password/#post) endpoint to update a specific disk's root password. - A `reset_root_password` event is generated when a root password reset is successful. + A `password_reset` event is generated when a root password reset is successful. tags: - Linode Instances operationId: resetLinodePassword @@ -14384,7 +14384,6 @@ components: - password_reset - payment_submitted - profile_update - - reset_root_password - stackscript_create - stackscript_delete - stackscript_update From cf786498244fcaebb6e692b0462353de4e9b507b Mon Sep 17 00:00:00 2001 From: leslitagordita Date: Mon, 7 Sep 2020 19:42:15 -0400 Subject: [PATCH 6/6] Add info about shutdown requirements --- openapi.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 6cbe51775..a3c1a72e7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5340,13 +5340,12 @@ paths: description: > Resets the root password for this Linode. + * Your Linode must be [shut down](/api/v4/linode-instances-linode-id-shutdown/#post) for a password reset to complete. - - **Note:** If your Linode has more than one disk (not counting its swap disk), use the + * If your Linode has more than one disk (not counting its swap disk), use the [Reset Disk Root Password](/api/v4/linode-instances-linode-id-disks-disk-id-password/#post) endpoint to update a specific disk's root password. - - A `password_reset` event is generated when a root password reset is successful. + * A `password_reset` event is generated when a root password reset is successful. tags: - Linode Instances operationId: resetLinodePassword