Using a copy of the DigitalOcean OpenAPI spec, stored in the /data
folder in the repo, as well as the YAML metadata of the doctl
CLI reference, you can insert detailed instructions into a doc on how to perform actions via the API and CLI, by passing in a few parameters to this shortcode.
Here is the example for how to create a Droplet:
{{< automation-instructions action="create a Droplet" command="doctl compute droplet create" path="/v2/droplets" operation="droplets_create" verb="post" >}}
Renders to:
action
- In English, the action being taken. This should be written in lowercase, as shown in the example, as this phrase is inserted into descriptive sentences in the generated output.command
- The full doctl
command that performs the action
. If set to API Only
, then no instructions for doctl
are generated.path
- The API Endpoint that performs the action
. You can find this in the right column of the API reference docs; for example, the blue badge that says POST next to the Create a New Droplet API action has the path of /v2/droplets
, which should be entered here. If set to doctl Only
, then no instructions for the API are generated.operation
- The anchor link to the API reference doc that covers the selected action, which comes after /#operation/
in the URL; in the Create a New Droplet API action, this is droplets_create
.verb
- The HTTP verb that corresponds with the action. Can be one of: get
, post
, delete
, put
, or patch
.{{< notice note >}}
. For an example, see the Droplet resizing docs, which call out that the Droplet must be powered down before resizing.{{< notice note >}}
. For an example, see the Droplet creation docs, which call out how to retrieve valid region, machine, and image slugs.doctl
, and you have to set the action type to rebuild
within the general droplet-action
call. Also see the Droplet metrics docs, for which there are only API instructions, as doctl
does not currently have a way to monitor things like CPU and memory usage.You cannot currently use this shortcode for the Spaces or Metadata APIs.