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

FieldTypeRequiredDescription
ImageNamestringYesImage name.
InstanceIdstringNoID of the instance from which an image will be created. This parameter is required when using instance to create an image.
ImageDescriptionstringNoImage description.
ForcePoweroffstringNoWhether to perform forced power-off operation to create an image.
SysprepstringNoWhether to enable Sysprep when creating a Windows image.
DataDiskIdsstring[]NoIDs of data disks included in the image.
SnapshotIdsstring[]NoSpecified snapshot ID used to create an image. A system disk snapshot must be included. It cannot be passed together with `InstanceId`.
DryRunbooleanNoSuccess status of this request, without affecting the resources involved
TagSpecificationTagSpecification[]NoTag description list. This parameter is used to bind a tag to a custom image.
ImageFamilystringNoImage 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.

FieldTypeDescription
ImageIdstringImage ID.
RequestIdstringThe 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