edit-icon download-icon

API for clusters

Last Updated: Aug 02, 2018

This API is used to create a cluster.

Request parameter

Field Type Required Default value Description
Action String Yes - Operation interface name. Value: CreateCluster.
RegionId String Yes - Region ID.
ZoneId String No - Zone ID.
Name String Yes - Cluster name. It can contain 2 to 64 characters. It must begin either with an English letter or a Chinese character, and can contain Chinese characters, English letters, numbers, “-“, and “_“.
Description String No Null Cluster description. It can contain 2 to 128 characters.
EhpcVersion String Yes - E-HPC version.
OsTag String Yes - Operating system image tag, which can be queried using the ListImages API.
SchedulerType String No pbs Scheduler type. Currently, PBS is supported.
AccountType String No nis Service type of the domain account. Currently, NIS is supported.
Application.n.Tag String Yes - Tag of the nth application software, which is identified as a SoftwareTag and can be queried using the ListSoftware API, for example, OpenMPI_11.1.
SecurityGroupId String No None ID of an existing security group.
SecurityGroupName String No None If the existing security group is not used (SecurityGroupId is null), a new security group is created using this name and a default policy is applied to this security group. The value of SecurityGroupName must comply with the ECS security group name format.
VSwitchId String Yes - ID of the switch in VPC. Currently, only the VPC network type is supported.
VolumeType String No nas Shared network storage type. Currently, only Alibaba Cloud NAS is supported.
VolumeId String Yes - Alibaba Cloud NAS instance ID. Currently, automatic creation of Alibaba Cloud NAS instances is not supported.
VolumeProtocol String No nfs Shared network storage protocol. Currently, only NFS is supported.
VolumeMountpoint String Yes - NAS VPC mount point. Currently, automatic creation of Alibaba Cloud NAS mount points is not supported.
RemoteDirectory String No - Remote directory mounted with a shared storage. The final mount path is a combination of the mount point and remote directory, and is in NasMountpoint:/RemoteDirectory format.
HaEnable Boolean No false Whether to enable high availability. If it is enabled, each control role in the cluster uses two instances working in the master or a backup mode.
EcsChargeType String No PostPaid Billing method of ECS instances applied to the cluster. Optional values: PostPaid (Pay-As-You-Go) and PrePaid (Subscription). If Subscription is selected, automatic renewal is enabled by default. After nodes are released, automatic renewal is disabled. Currently, only the Pay-As-You-Go option is supported.
EcsOrder.Manager.InstanceType String Yes - Instance type of the control nodes in the cluster.
EcsOrder.Compute.Count Integer Yes - Number of computing nodes in the cluster. The value is an integer ranging from 1 to 99.
EcsOrder.Compute.InstanceType String Yes - Instance type of the computing nodes in the cluster.
EcsOrder.Login.Count Integer Yes None Number of logon nodes in the cluster. The value is an integer ranging from 1 to 99.
EcsOrder.Login.InstanceType String Yes - Instance type of the logon nodes in the cluster.
Password String No (Password and KeyPairName are mutually exclusive.) None Root password of the stepping stone instance (logon node). The password is a string of 8 to 30 characters and must contain uppercase or lowercase letters, numbers, and special characters. Call API by HTTPS to prevent password leakage.
KeyPairName String No (Password and KeyPairName are mutually exclusive.) None Name of AccessKey. To use the ECS AccessKey function, create an AccessKey in the ECS console.

Return parameter

Except for the public return parameters, the following parameter returns:

Field Type Description
ClusterId String Cluster ID

Error code

Code Description HTTP Code
InvalidParams Invalid parameters 400
InvalidVpc Invalid VPC information 400
InvalidVolume Invalid storage volume 400
TooManyClusters Quota limit of E-HPC cluster quantity exceeded 403
TooManyNodes Quota limit of node quantity exceeded 403
EcsError ECS API call failed 406
NotAuthorized RAM not authorized 407
UnknownError Unknown error 500

DeleteCluster

This API is used to delete a cluster.

Request parameter

Field Type Required Default value Description
Action String Yes - Operation interface name. Value: DeleteCluster.
RegionId String Yes - Region ID.
ClusterId String Yes - Cluster ID.
ReleaseInstance String No true Whether to release instances created by E-HPC.

Return parameter

Public return parameters.

Error code

Code Description
InvalidParams Invalid parameters.
InvalidStatus Operation not allowed in the current cluster status.
EcsError ECS API call failed.
UnknownError Unknown error.

ModifyClusterAttribute

The ModifyClusterAttributes API modifies the attributes of an existing cluster. Currently, only the cluster name can be modified.

Request parameter

Field Type Required Default value Description
Action String Yes - Operation interface name. Value: ModifyClusterAttributes.
RegionId String Yes - Region ID.
ClusterId String Yes - Cluster ID.
Name String No None New name of the cluster.
Description String No None Cluster description, a string of 2 to 128 characters.

Return parameter

Public return parameters.

Error code

Code Description
InvalidParams Invalid parameters
UnknownError Unknown error

ListCluster

This API is used to list the existing clusters in the system.

Request parameter

Field Type Required Default value Description
Action String Yes - Operation interface name. Value: ListClusters.
RegionId String Yes - Region ID.
PageNumber Integer No 1 Displayed page number; initial value: 1.
PageSize Integer No 10 Number of entries per page; value range: 1 to 50.

Return parameter

Public return parameters and the following parameters:

Field Type Description
Clusters Array\ Array of brief cluster information. For more information about the ClusterInfoSimple structure, see the following object description.
TotalCount Integer Total number of entries in the list.
PageNumber Integer Current page number.
PageSize Integer Number of entries on the current page.

Each ClusterInfoSimple structure includes the following fields:

Field Value Description
Id String Cluster ID.
RegionId String Region ID.
Name String Cluster name.
Description String Cluster description.
Status String Cluster status.
OsTag String Operating system image tag, which can be queried using the ListImages API.
AccountType String Type of the account server. Currently, only NIS is supported.
SchedulerType String Type of the scheduling server. Currently, only PBS is supported.
Count Integer Number of computing nodes in the cluster.
InstanceType String Instance type of the computing nodes in the cluster, for example, ecs.n1.large.
CreateTime String Creation time.

Optional values of the cluster status:

Value Description
uninit The cluster is not initialized.
creating The cluster is being created.
init The cluster is being initialized.
running The cluster is running.
exception The cluster is abnormal.
releasing The cluster is being released.

Error code

Code Description
InvalidParams Invalid parameters.
EcsError ECS API call failed.
UnknownError Unknown error.

DescribeCluster

The DescribeCluster API queries the detailed information of a specified cluster.

Request parameter

Field Type Required Default value Description
Action String Yes - Operation interface name. Value: DescribeCluster.
RegionId String Yes - Region ID.
ClusterId String Yes - Cluster ID.

Return parameter

Public return parameters and the following parameters:

Field Type Description
ClusterInfo ClusterInfo Detailed information of the cluster. For more information about the ClusterInfo structure, see the following object description.

Each ClusterInfo structure includes the following fields:

Field Value Description
Id String Cluster ID.
RegionId String Region ID.
Name String Cluster name.
Description String Cluster description.
Status String Cluster status.
OsTag String Operating system image tag, which can be queried using the ListImages API.
AccountType String Type of the account server. Currently, only NIS is supported.
SchedulerType String Type of the scheduling server. Currently, only PBS is supported.
CreateTime String Creation time.
ApplicationInfo Array\ List of the application software used by the cluster. Each entry includes the name and version of the software.
SecurityGroupId String Security group ID.
VSwitchId String ID of the switch in VPC. Currently, only the VPC network type is supported.
VolumeType String Shared network storage type. Currently, only Alibaba Cloud NAS is supported.
VolumeId String Alibaba Cloud NAS instance ID. Currently, automatic creation of Alibaba Cloud NAS instances is not supported.
VolumeProtocal String Shared network storage protocol. Currently, only NFS is supported.
VolumeMountpoint String NAS VPC mount point. Currently, automatic creation of Alibaba Cloud NAS mount points is not supported.
RemoteDirectory String Remote directory with shared storage mounted. The final mount path is the combination of the mount point and remote directory and is in the NasMountpoint:/RemoteDirectory format.
HaEnable Boolean Whether to enable high availability. If it is enabled, each control role in the cluster uses two instances working in the master or a backup mode.
EcsInfo EcsInfoType Data structure that describes the number of ECS instances used by each component of the cluster and the instance type. The returned result in JSON format is similar to the following: EcsInfo:{“Manager”:{“Count”:2,”InstanceType”:”ecs.n1.large”},”Compute”:{“Count”:8,”InstanceType”:”ecs.n1.large”},”Login”:{“Count”:1,”InstanceType”:”ecs.n1.large”}}. The returned result in XML format can be inferred accordingly.
EcsChargeType String Billing method of the ECS instances used by the cluster. Optional values: PostPaid (Pay-As-You-Go) and PrePaid (Subscription). If Subscription is selected, automatic renewal is enabled by default. After nodes are released, automatic renewal is disabled. Currently, only the Pay-As-You-Go option is supported.
KeyPairName String If the ECS AccessKey is used to logon to the stepping stone instance in the cluster, the name of the AccessKey is returned.

For the optional values of the node status, see ListClusters description.

The format of the ApplicationInfo structure is as follows:

Field Type Description
Tag String Software tag, for example, OpenMPI_1.8.7
Name String Software name
Version String Software version

Error code

Code Description
InvalidParams Invalid parameters.
EcsError ECS API call failed.
UnknownError Unknown error.
Thank you! We've received your feedback.