Skip to main content
Resource Center/Resource Pool/Auto-Scaling Group Operations
POSTAuto-Scaling Group OperationsSince 3.1.0SynchronousAuth Required

CreateAutoScalingVmTemplate

CreateAutoScalingVmTemplate

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • vmInstanceNameStringRequired

      The VM instance name.

    • vmInstanceDescriptionString

      Optional. The detailed description of the VM instance.

    • vmInstanceOfferingUuidStringRequired

      The instance offering of the VM instance.

    • imageUuidStringRequired

      The image UUID of the VM instance.

    • l3NetworkUuidsListRequired

      The L3 networks of the VM instance.

    • rootDiskOfferingUuidString

      Optional. The disk offering of the VM instance root volume.

    • dataDiskOfferingUuidsList

      Optional. The disk offerings of the VM instance data volumes.

    • vmInstanceZoneUuidString

      Optional. The zone to which the VM instance belongs.

    • vmInstanceClusterUuidString

      Optional. The cluster to which the VM instance belongs.

    • hostUuidString

      Optional. The host UUID.

    • primaryStorageUuidForRootVolumeString

      Optional. The UUID of the primary storage where the root volume locates.

    • defaultL3NetworkUuidStringRequired

      The default L3 network of the VM instance.

    • nameStringRequired

      The resource name.

    • descriptionString

      Optional. The detailed description of the resource.

    • typeString

      Optional. The template type.

    • resourceUuidString

      Optional. The resource UUID.

    • tagUuidsList

      Optional. The tag UUID list.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryAutoScalingTemplateInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • typeStringRequired

      The template type.

    • stateStringRequired

      The state of the template.

    • systemTagsListRequired

      系统标签。

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

Endpoint

POST/zstack/v1/autoscaling/vmtemplate

/zstack/v1/autoscaling/vmtemplate

Operation ID

CreateAutoScalingVmTemplate

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/autoscaling/vmtemplate' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"vmInstanceName":"<vmInstanceName>","vmInstanceDescription":"<vmInstanceDescription>","vmInstanceOfferingUuid":"<vmInstanceOfferingUuid>","imageUuid":"<imageUuid>","l3NetworkUuids":["<l3NetworkUuids>"],"rootDiskOfferingUuid":"<rootDiskOfferingUuid>","dataDiskOfferingUuids":["<dataDiskOfferingUuids>"],"vmInstanceZoneUuid":"<vmInstanceZoneUuid>","vmInstanceClusterUuid":"<vmInstanceClusterUuid>","hostUuid":"<hostUuid>","primaryStorageUuidForRootVolume":"<primaryStorageUuidForRootVolume>","defaultL3NetworkUuid":"<defaultL3NetworkUuid>","name":"<name>","description":"<description>","type":"<type>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "name": "template", "description": "desc", "state": "Enabled" } }

Change History

This API has no change history records yet.

View all change history