cvm — Cloud Virtual Machine
cvm · 2017-03-12
CreateImage
POST
Create a new image with the system disk of an instance. The image can be used to create new instances.
Wire call
Converge Cloud is RPC over HTTP. There is one path — / — and the action travels in the X-TC-Action header. The /cvm/CreateImage path used in the OpenAPI document is a documentation convenience so each action is addressable; it is not a route on the server.
curl
curl -sS https://cvm.api3.convergecloud.com/ \
-H 'Authorization: TC3-HMAC-SHA256 Credential=<SecretId>/<YYYY-MM-DD>/cvm/tc3_request, SignedHeaders=content-type;host;x-tc-action, Signature=<sig>' \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Host: cvm.api3.convergecloud.com' \
-H 'X-TC-Action: CreateImage' \
-H 'X-TC-Version: 2017-03-12' \
-H 'X-TC-Timestamp: <unix-seconds>' \
-H 'X-TC-Region: luzon' \
-d '{"ImageName":"<ImageName>"}'Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| ImageName | string | Yes | Image name. |
| InstanceId | string | No | ID of the instance from which an image will be created. This parameter is required when using instance to create an image. |
| ImageDescription | string | No | Image description. |
| ForcePoweroff | string | No | Whether to perform forced power-off operation to create an image. |
| Sysprep | string | No | Whether to enable Sysprep when creating a Windows image. |
| DataDiskIds | string[] | No | IDs of data disks included in the image. |
| SnapshotIds | string[] | No | Specified snapshot ID used to create an image. A system disk snapshot must be included. It cannot be passed together with `InstanceId`. |
| DryRun | boolean | No | Success status of this request, without affecting the resources involved |
| TagSpecification | TagSpecification[] | No | Tag description list. This parameter is used to bind a tag to a custom image. |
| ImageFamily | string | No | Image family |
Response
Fields are returned inside the Response envelope. Converge Cloud answers HTTP 200 for errors as well as successes, so read Response.Error rather than the status code — and test for the presence of that object, because Code is occasionally the empty string.
| Field | Type | Description |
|---|---|---|
| ImageId | string | Image ID. |
| RequestId | string | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Success
{
"Response": {
"ImageId": …,
"RequestId": "…"
}
}Error
{
"Response": {
"Error": { "Code": "…", "Message": "…" },
"RequestId": "…"
}
}Try it
CredentialThe key never leaves this tab — it signs the request here. The signed request goes to /api-relay/cvm.
Request bodyvalid JSONPOST cvm.api3.convergecloud.com · CreateImage
