Update a Vultr instance template's plan, OS, SSH keys, or label using the API. Changes apply only to new instances.
Updating an instance template changes its configuration, such as the plan, OS, SSH keys, or label. The request must include at least one field accepted by the Create Instance Template endpoint. Omitting plan leaves it at its existing value instead of clearing it. Updated templates apply to new instances created from the template, and existing instances are not affected.
This guide explains how to update an instance template using the Vultr API.
Send a GET request to the List Instance Templates endpoint to retrieve all templates.
Note the id of the template you want to update.
Send a PUT request to the Update Instance Template endpoint to update the template. Replace {template-id} with the template's ID, NEW_TEMPLATE_LABEL with the new label, OS_ID with the new operating system ID, and SSH_KEY_ID with an SSH key's ID. Include only the fields you want to change.
A successful update returns an HTTP 202 Accepted response. ssh_key_ids replaces the template's existing keys. Send [] to remove all keys.
Send a GET request to the Get Instance Template endpoint to retrieve the updated template details.
Verify that the template details reflect the new values.
0 Comments
Be the first to comment and share your perspective with the community.