The 201 status code and the cluster ID are returned:

POST /clusters?IdempotentToken={IdempotentToken}

{
    "Name": "test-ubuntu",
    "Description": "demo",
    "ImageId": "m-2309yqb5n",
    "InstanceType": "bcs.a2.large",
    "UserData": {
        "key1": "value1"
    },
    "Notification": {
        "Topic": {
            "Name": "test-topic",
            "Endpoint": "http://[UserId].mns.[Region].aliyuncs.com/",
            "Events": [
                    "OnClusterDeleted",
                    "OnInstanceCreated",
                    "OnInstanceActive"
            ]
        }
    },
    "Configs": {
        "Disks": {
            "SystemDisk": {
                "Type": "cloud",
                "Size": 500
            },
            "DataDisk": {
                "Type": "cloud",
                "Size": 500,
                "MountPoint": "/path/to/mount"
            }
        },
        "Mounts": {
            "Entries": [
                {
                    "Destination": "/home/admin/mount-dest",
                    "Source": "oss://your-bucket/mount-source",
                    "WriteSupport": true
                }
            ],
            "Locale": "GBK",
            "Lock": false,
            "CacheSupport": true,
            "NAS": {
                "AccessGroup": [
                    "group1",
                    "group2"
                ],
                "FileSystem": [
                    "filesystem1",
                    "filesystem2"
                ]
            },
            "OSS": {
                "AccessKeyId": "",
                "AccessKeySecret": "",
                "AccessSecurityToken": ""
            }
        },
        "Networks": {
            "Classic": {
                "AllowIpAddress": [],
                "AllowIpAddressEgress": [],
                "AllowSecurityGroup": [],
                "AllowSecurityGroupEgress": []
            },
            "VPC": {
                "CidrBlock": "10.0.0.0/8"
            }
        }
    },
    "Groups": {
        "group1": {
            "DesiredVMCount": 3,
            "InstanceType": "",
            "ResourceType": "OnDemand",
            "SpotStrategy": "SpotAsPriceGo",
            "SpotPriceLimit": 0.0
        }
    }
}

Attribute description

AttributeTypeRequiredDescription
NameStringYesCluster name.
ImageIdStringYesImage ID.
InstanceTypestringYesType of an instance for setting up a cluster.
GroupsobjectYesInformation about instance groups in the cluster.
DescriptionstringNoDescription of the cluster.
UserDataobjectNoKey-Value mapping. It is user-defined and can be obtained by using metaserver of the ECS.
NotificationobjectNoNotification message configuration.
ConfigsobjectNoCluster configurations, such as the disk configuration of the instance.
IdempotentTokenStringNoIdempotence used to guarantee the request. The value is generated by a client. It must be unique among all requests and can contain a maximum of 64 characters, including letters, numbers, and underscores.

Response

Success

{
    "Id":"usr-cluster-1"
}

Attribute description

AttributeTypeDescription
IdStringJob ID.

Error codes

IdempotentTokenMismatchSpecified idempotent token mismatch.400The token has been used and different from that in the previous request.
InvalidJsonFormatThe request body has an invalid json format.400The request body has an invalid JSON format.
InvalidHttpBodySpecified parameter HttpBody is not valid. Its type must be object.400Http Body must be an object.
MissingNameName is mandatory for this action.400The parameter Name is missing.
MissingConfigs.Networks.VPC.OppositeRouterIdConfigs.Networks.VPC.OppositeRouterId is mandatory for this action.400The parameter Configs.Networks.VPC.OppositeRouterId is missing.
MissingConfigs.Networks.VPC.OppositeAccessPointIdConfigs.Networks.VPC.OppositeAccessPointId is mandatory for this action.400The parameter Configs.Networks.VPC.OppositeAccessPointId is missing.
MissingConfigs.Networks.VPC.OppositeRegionIdConfigs.Networks.VPC.OppositeRegionId is mandatory for this action.400The parameter Configs.Networks.VPC.OppositeRegionId is missing.
InvalidNameSpecified parameter Name is not valid. Its type must be string.400Name must be a string.
InvalidNameSpecified parameter Name is not valid. Its length must be in [1, 64].400The length of Name must be in the range of [1, 64].
InvalidNameSpecified parameter Name is not valid. It must only contain characters within [a-zA-Z0-9_-], and must not start with [0-9].400Name can contain only letters, numbers, underscores, and hyphens, and cannot start with a number.
InvalidDescriptionSpecified parameter Description is not valid. Its type must be string.400Description must be a string.
InvalidDescriptionSpecified parameter Description is not valid. Its length must be in [0, 1024].400The length of Description must be in the range of [0, 1024].
MissingImageIdImageId is mandatory for this action.400The parameter ImageId is missing.
InvalidImageIdSpecified parameter ImageId is not valid. Its type must be string.400ImageId must be a string.
InvalidImageIdSpecified parameter ImageId is not valid. Its length must be in [1, 256].400The ImageId length must be in the range of [1, 256].
InvalidUserDataSpecified parameter UserData is not valid. Its type must be object.400UserData must be an object.
InvalidUserDataSpecified parameter UserData is not valid. Its size must be in [0, 64].400The UserData size must be in the range of [0, 64].
InvalidUserData.{key}Specified parameter UserData.{key} is not valid. Its length must be in [1, 128].400The size of UserData.{key} must be in the range of [1, 128].
InvalidUserData.{key}.valueSpecified parameter UserData.{key}.value is not valid. Its type must be string.400The value of UserData.{key} must be a string.
InvalidUserData.{key}.valueSpecified parameter UserData.{key}.value is not valid. Its length must be in [0, 1024].400The length of UserData.{key} must be in the range of [0, 1024].
InvalidGroupsSpecified parameter Groups is not valid. Its type must be object.400Groups must be an object.
InvalidGroups.{key}Specified parameter Groups.{key} is not valid. Its type must be object.400Groups.{key} must be an object.
InvalidGroups.{key}Specified parameter Groups.{key} is not valid. Its size must be in [1, 64].400The value of Groups.{key} must be in the range of [1, 64].
MissingDesiredVMCountDesiredVMCount is mandatory for this action.400The parameter DesiredVMCount is missing.
InvalidDesiredVMCountSpecified parameter DesiredVMCount is not valid. Its type must be integer.400DesiredVMCount must be an integer.
InvalidDesiredVMCountSpecified parameter DesiredVMCount is not valid. It must be in [1, 65536].400The value of DesiredVMCount must be in the range of [1, 65536].
InvalidCidrBlockSpecified parameter CidrBlock is not valid. Configs.Networks.VPC.CidrBlock is not valid.400The CIDRBlock is invalid.
QuotaExhausted.MaxClusterCountThe MaxClusterCount ({value}) quota is exhausted.403The number of clusters cannot exceed {value}.
QuotaExhausted.MaxClusterGroupCountThe MaxClusterGroupCount ({value}) quota is exhausted.403The number of groups in a cluster cannot exceed {value}.
QuotaExhausted.MaxClusterGroupDesiredVMCountThe MaxClusterGroupDesiredVMCount ({value}) quota is exhausted.403DesiredVMCount of a group in a cluster cannot exceed {value}.
QuotaExhausted.Configs.Networks.VPC.OppositeRouterTypeThe Configs.Networks.VPC.OppositeRouterType ({value}) is forbidden.403The value of Configs.Networks.VPC.OppositeRouterType cannot be {value}.
MissingInstanceTypeInstanceType is mandatory for this action.400The parameter InstanceType is missing.
InvalidInstanceTypeSpecified parameter InstanceType is not valid.400The value of InstanceType is invalid.
MissingResourceTypeResourceType is mandatory for this action.400The parameter ResourceType is missing.
InvalidResourceTypeSpecified parameter ResourceType is not valid.400The value of ResourceType is invalid.
Invalid{Parameter}Specified parameter {Parameter} is not valid.400The {Parameter} parameter is invalid.