{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To initiate an action on a Droplet send a POST request to\n`/v2/droplets/$DROPLET_ID/actions`. In the JSON body to the request,\nset the `type` attribute to one of the supported action types:\n\n| Action                                   | Details | Required Permissions |\n| ---------------------------------------- | ----------- | ----------- |\n| <nobr>`enable_backups`</nobr>            | Enables backups for a Droplet | <nobr>`droplet:update`</nobr> |\n| <nobr>`disable_backups`</nobr>           | Disables backups for a Droplet | <nobr>`droplet:update`</nobr> |\n| <nobr>`change_backup_policy`</nobr>      | Update the backup policy for a Droplet | <nobr>`droplet:update`</nobr> |\n| <nobr>`reboot`</nobr>                    | Reboots a Droplet. A `reboot` action is an attempt to reboot the Droplet in a graceful way, similar to using the `reboot` command from the console. | <nobr>`droplet:update`</nobr> |\n| <nobr>`power_cycle`</nobr>               | Power cycles a Droplet. A `powercycle` action is similar to pushing the reset button on a physical machine, it's similar to booting from scratch. | <nobr>`droplet:update`</nobr> |\n| <nobr>`shutdown`</nobr>                  | Shuts down a Droplet. A shutdown action is an attempt to shutdown the Droplet in a graceful way, similar to using the `shutdown` command from the console. Since a `shutdown` command can fail, this action guarantees that the command is issued, not that it succeeds. The preferred way to turn off a Droplet is to attempt a shutdown, with a reasonable timeout, followed by a `power_off` action to ensure the Droplet is off. | <nobr>`droplet:update`</nobr> |\n| <nobr>`power_off`</nobr>                 | Powers off a Droplet. A `power_off` event is a hard shutdown and should only be used if the `shutdown` action is not successful. It is similar to cutting the power on a server and could lead to complications. | <nobr>`droplet:update`</nobr> |\n| <nobr>`power_on`</nobr>                  | Powers on a Droplet. | <nobr>`droplet:update`</nobr> |\n| <nobr>`restore`</nobr>                   | Restore a Droplet using a backup image. The image ID that is passed in must be a backup of the current Droplet instance. The operation will leave any embedded SSH keys intact. | <nobr>`droplet:update`</nobr><br><nobr>`droplet:admin`</nobr> |\n| <nobr>`password_reset`</nobr>            | Resets the root password for a Droplet. A new password will be provided via email. It must be changed after first use. | <nobr>`droplet:update`</nobr><br><nobr>`droplet:admin`</nobr> |\n| <nobr>`resize`</nobr>                    | Resizes a Droplet. Set the `size` attribute to a size slug. If a permanent resize with disk changes included is desired, set the `disk` attribute to `true`. | <nobr>`droplet:update`</nobr><br><nobr>`droplet:create`</nobr> |\n| <nobr>`rebuild`</nobr>                   | Rebuilds a Droplet from a new base image. Set the `image` attribute to an image ID or slug. | <nobr>`droplet:update`</nobr><br><nobr>`droplet:admin`</nobr> |\n| <nobr>`rename`</nobr>                    | Renames a Droplet. | <nobr>`droplet:update`</nobr> |\n| <nobr>`change_kernel`</nobr>             | Changes a Droplet's kernel. Only applies to Droplets with externally managed kernels. All Droplets created after March 2017 use internal kernels by default. | <nobr>`droplet:update`</nobr> |\n| <nobr>`enable_ipv6`</nobr>               | Enables IPv6 for a Droplet. Once enabled for a Droplet, IPv6 can not be disabled. **Warning:** The Droplet must be powered off before enabling IPv6 on an existing Droplet. When enabling IPv6 on an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets) is required. | <nobr>`droplet:update`</nobr> |\n| <nobr>`snapshot`</nobr>                  | Takes a snapshot of a Droplet. | <nobr>`droplet:update`</nobr><br><nobr>`image:create`</nobr> |\n","properties":{"path":{"type":"object","properties":{"droplet_id":{"type":"integer","minimum":1,"examples":[3164444],"description":"A unique identifier for a Droplet instance."}},"required":["droplet_id"],"additionalProperties":false},"body":{"anyOf":[{"$ref":"#/definitions/droplet_action"},{"$ref":"#/definitions/droplet_action_enable_backups"},{"$ref":"#/definitions/droplet_action_change_backup_policy"},{"$ref":"#/definitions/droplet_action_restore"},{"$ref":"#/definitions/droplet_action_resize"},{"$ref":"#/definitions/droplet_action_rebuild"},{"$ref":"#/definitions/droplet_action_rename"},{"$ref":"#/definitions/droplet_action_change_kernel"},{"$ref":"#/definitions/droplet_action_snapshot"}]}},"required":["path"],"additionalProperties":false,"definitions":{"droplet_action":{"required":["type"],"type":"object","description":"Specifies the action that will be taken on the Droplet.","properties":{"type":{"type":"string","enum":["enable_backups","disable_backups","reboot","power_cycle","shutdown","power_off","power_on","restore","password_reset","resize","rebuild","rename","change_kernel","enable_ipv6","snapshot"],"description":"The type of action to initiate for the Droplet.","examples":["reboot"]}}},"droplet_action_enable_backups":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"backup_policy":{"allOf":[{"$ref":"#/definitions/droplet_backup_policy"},{"description":"An object specifying the backup policy for the Droplet. If omitted, the backup plan will default to daily."}]}}}],"examples":[{"type":"enable_backups","backup_policy":{"plan":"daily","hour":20}}]},"droplet_action_change_backup_policy":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"backup_policy":{"allOf":[{"$ref":"#/definitions/droplet_backup_policy"},{"description":"An object specifying the backup policy for the Droplet."}]}}}],"required":["backup_policy"],"examples":[{"type":"enable_backups","backup_policy":{"plan":"weekly","day":"SUN","hour":20}}]},"droplet_action_restore":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"image":{"type":"integer","description":"The ID of a backup of the current Droplet instance to restore from.","examples":[12389723]}}}]},"droplet_action_resize":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"disk":{"type":"boolean","description":"When `true`, the Droplet's disk will be resized in addition to its RAM and CPU. This is a permanent change and cannot be reversed as a Droplet's disk size cannot be decreased.","examples":[true]},"size":{"type":"string","description":"The slug identifier for the size to which you wish to resize the Droplet.","examples":["s-2vcpu-2gb"]}}}]},"droplet_action_rebuild":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"image":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"The image ID of a public or private image or the slug identifier for a public image. The Droplet will be rebuilt using this image as its base.","examples":["ubuntu-20-04-x64"]}}}]},"droplet_action_rename":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"name":{"type":"string","description":"The new name for the Droplet.","examples":["nifty-new-name"]}}}]},"droplet_action_change_kernel":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"kernel":{"type":"integer","description":"A unique number used to identify and reference a specific kernel.","examples":[12389723]}}}]},"droplet_action_snapshot":{"allOf":[{"$ref":"#/definitions/droplet_action"},{"type":"object","properties":{"name":{"type":"string","description":"The name to give the new snapshot of the Droplet.","examples":["Nifty New Snapshot"]}}}]},"droplet_backup_policy":{"type":"object","properties":{"plan":{"type":"string","enum":["daily","weekly"],"description":"The backup plan used for the Droplet. The plan can be either `daily` or `weekly`.","examples":["daily"]},"weekday":{"type":"string","enum":["SUN","MON","TUE","WED","THU","FRI","SAT"],"description":"The day of the week on which the backup will occur.","examples":["SUN"]},"hour":{"type":"integer","enum":[0,4,8,12,16,20],"description":"The hour of the day that the backup window will start.","examples":[0]}}}}},"name":"Initiate a Droplet Action","id":"digitalocean.dropletactions_post","example":{"path":{"droplet_id":3164444}},"maxRequests":1,"summary":false}}