Skip to main content

Create Snapshot

https://infrahub-api.nexgencloud.com/v1/core/virtual-machines/{id}/snapshots

Creates a snapshot for the specific virtual machine. For more information about snapshots, click here.


Body parameters


name string   Required

Name of the snapshot.
A string with a maximum length of 50 characters.


description string   Optional

A brief description of the snapshot.


is_image boolean  optional

Specify whether the snapshot will be used as an image for future VM deployments. Defaults to false.


labels array of strings  optional

An optional array of labels can be applied to the snapshot for organizational and identification purposes.


Attributes


status boolean

Indicates the result of the request to create the snapshot. true signifies success, while false indicates an error.


message string

A description of the status of the request.


snapshot object

An object containing details about the created snapshot.

Example request
curl -X POST "https://infrahub-api.nexgencloud.com/v1/core/virtual-machines/{id}/snapshots" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"\
-H "content-type: application/json" \
-d '{
"name": "example-snapshot",
"description": "Snapshot before upgrade",
"is_image": false
}'
Response
{
"status": true,
"message": "Snapshot creation scheduled.",
"snapshot": {
"id": 12345,
"name": "example-snapshot",
"vm_id": 2786,
"region_id": 1,
"size": 20,
"description": "Snapshot before upgrade",
"status": "CREATING",
"is_image": false,
"labels": []
}
}

Back to top