Querying a Cluster List
Function
This API is used to query a list of clusters created by a user. This API is incompatible with Sahara.
Constraints
None
Debugging
You can debug this API in API Explorer. Automatic authentication is supported. API Explorer can automatically generate sample SDK code and provide the sample SDK code debugging.
URI
- Format
- Parameter description
Table 1 URI parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Explanation
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
Constraints
N/A
Value range
The value must consist of 1 to 64 characters. Only letters and digits are allowed.
Default value
N/A
Table 2 Query parameters Parameter
Mandatory
Type
Description
pageSize
No
String
Explanation
Maximum number of clusters displayed on a page
Constraints
N/A
Value range
1-2147483646
Default value
10
currentPage
No
String
Explanation
Current page number
Constraints
N/A
Value range
N/A
Default value
1
clusterName
No
String
Explanation
The cluster name.
Constraints
N/A
Value range
N/A
Default value
N/A
clusterState
No
String
Explanation
Query clusters by status.
Constraints
N/A
Value range
- existing: Query existing clusters, including all clusters except those in the Deleted state and the yearly/monthly clusters in the Order processing or Preparing state.
- history: Quer historical clusters, including all the deleted clusters, clusters that fail to delete, clusters whose VMs fail to delete, and clusters whose database updates fail to delete.
- starting: Query a list of clusters that are being started.
- running: Query a list of running clusters.
- terminated: Query a list of terminated clusters.
- failed: Query a list of failed clusters.
- abnormal: Query a list of abnormal clusters.
- terminating: Query a list of clusters that are being terminated.
- frozen: Query a list of frozen clusters.
- scaling-out: Query a list of clusters that are being scaled out.
- scaling-in: Query a list of clusters that are being scaled in.
Default value
N/A
tags
No
String
Explanation
Tag list. You can search for a cluster by its tag. If you specify multiple tags, the relationship between them is AND.
Constraints
N/A
Value range
- The format of the tags parameter is tags=k1*v1,k2*v2,k3*v3.
- When the values of some tags are null, the format is tags=k1,k2,k3*v3.
Default value
N/A
enterpriseProjectId
No
String
Explanation
The enterprise project ID used to query clusters in a specified enterprise project. To obtain the enterprise project ID, check the id value in the enterprise_project field data structure table in "Querying the Enterprise Project List" in Enterprise Management API Reference.
Constraints
N/A
Value range
N/A
Default value
0
Request Parameters
None
Response Parameters
Parameter |
Type |
Description |
---|---|---|
clusterTotal |
Integer |
Explanation Total number of clusters in a list Constraints N/A Value range N/A Default value N/A |
clusters |
Array of Cluster objects |
Explanation Cluster parameters. For details, see Table 4. Constraints N/A Value range N/A Default value N/A |
Parameter |
Type |
Description |
---|---|---|
clusterId |
String |
Explanation Cluster ID. Constraints N/A Value range N/A Default value N/A |
clusterName |
String |
Explanation Cluster name. Constraints N/A Value range N/A Default value N/A |
masterNodeNum |
String |
Explanation Number of Master nodes deployed in a cluster. Constraints N/A Value range N/A Default value N/A |
coreNodeNum |
String |
Explanation Number of Core nodes deployed in a cluster. Constraints N/A Value range N/A Default value N/A |
totalNodeNum |
String |
Explanation Total number of nodes deployed in a cluster. Constraints N/A Value range N/A Default value N/A |
clusterState |
String |
Explanation Cluster status. (The status is in English by default. When the X-Language request header is set to zh-cn, this field returns Chinese text.) Constraints N/A
Value range
Default value N/A |
createAt |
String |
Explanation Cluster creation time, which is a 10-bit timestamp. Constraints N/A Value range N/A Default value N/A |
updateAt |
String |
Explanation Cluster update time, which is a 10-bit timestamp. Constraints N/A Value range N/A Default value N/A |
billingType |
String |
Explanation Cluster billing mode. Constraints N/A Value range
Default value N/A |
dataCenter |
String |
Explanation Cluster work region. Constraints N/A Value range N/A Default value N/A |
vpc |
String |
Explanation VPC name. Constraints N/A Value range N/A Default value N/A |
vpcId |
String |
Explanation VPC ID. Constraints N/A Value range N/A Default value N/A |
duration |
String |
Explanation Cluster subscription duration. Constraints N/A Value range N/A Default value N/A |
fee |
String |
Explanation Cluster creation fee, which is automatically calculated. Constraints N/A Value range N/A Default value N/A |
hadoopVersion |
String |
Explanation Hadoop version Constraints N/A Value range N/A Default value N/A |
masterNodeSize |
String |
Explanation Instance specifications of a Master node. Constraints N/A Value range N/A Default value N/A |
coreNodeSize |
String |
Explanation Instance specifications of a Core node. Constraints N/A Value range N/A Default value N/A |
componentList |
Array |
Explanation Component list. For details, see Table 5. Constraints N/A Value range N/A Default value N/A |
externalIp |
String |
Explanation External IP address. This IP address is opened to the outside of the cluster as access to the active Master process. Constraints N/A Value range N/A Default value N/A |
externalAlternateIp |
String |
Explanation Backup external IP address. This IP address is used outside the cluster as access to the standby Master process. Constraints N/A Value range N/A Default value N/A |
internalIp |
String |
Explanation Internal IP address. This IP address is used within the cluster as access to Master processes. Constraints N/A Value range N/A Default value N/A |
deploymentId |
String |
Explanation Cluster deployment ID. The ID is used by cloud services to query details about cluster deployment tasks. Constraints N/A Value range N/A Default value N/A |
remark |
String |
Explanation Cluster remarks. By default, this parameter is left blank. Constraints N/A Value range N/A Default value N/A |
orderId |
String |
Explanation Cluster creation order ID. Constraints N/A Value range N/A Default value N/A |
azId |
String |
Explanation AZ ID. Constraints N/A Value range N/A Default value N/A |
masterNodeProductId |
String |
Explanation Product ID of a Master node. Constraints N/A Value range N/A Default value N/A |
masterNodeSpecId |
String |
Explanation Specification ID of a Master node. Constraints N/A Value range N/A Default value N/A |
coreNodeProductId |
String |
Explanation Product ID of a Core node. Constraints N/A Value range N/A Default value N/A |
coreNodeSpecId |
String |
Explanation Specification ID of a Core node Constraints N/A Value range N/A Default value N/A |
azName |
String |
Explanation AZ name. Constraints N/A Value range N/A Default value N/A |
azCode |
String |
Explanation AZ name (en). Constraints N/A Value range N/A Default value N/A |
availabilityZoneId |
String |
Explanation Availability zone. Constraints N/A Value range N/A Default value N/A |
instanceId |
String |
Explanation Instance ID. Constraints N/A Value range N/A Default value N/A |
vnc |
String |
Explanation URI for remotely logging in to an ECS. Constraints N/A Value range N/A Default value N/A |
tenantId |
String |
Explanation Project ID. Constraints N/A Value range N/A Default value N/A |
volumeSize |
Integer |
Explanation Disk storage space. Constraints N/A Value range N/A Default value N/A |
volumeType |
String |
Explanation Disk type. Constraints N/A Value range N/A Default value N/A |
subnetId |
String |
Explanation Subnet ID. Constraints N/A Value range N/A Default value N/A |
enterpriseProjectId |
String |
Explanation Enterprise project ID. Constraints N/A Value range N/A Default value N/A |
clusterType |
Integer |
Explanation Cluster type. Constraints N/A Value range
Default value N/A |
subnetName |
String |
Explanation Subnet name. Constraints N/A Value range N/A Default value N/A |
securityGroupsId |
String |
Explanation Security group ID. Constraints N/A Value range N/A Default value N/A |
slaveSecurityGroupsId |
String |
Explanation Security group ID of a non-master node. Currently, one MRS cluster uses only one security group. Therefore, this field has been discarded. This field returns the same value as securityGroupsId does for compatibility consideration. Constraints N/A Value range N/A Default value N/A |
bootstrapScripts |
Array of BootstrapScript objects |
Explanation Bootstrap action script. For details, see Table 6. Constraints N/A Value range N/A Default value N/A |
stageDesc |
String |
Explanation Cluster process. (The status is in English by default. When the X-Language request header is set to zh-cn, this field returns Chinese text.) Constraints N/A Value range
The cluster installation progress includes:
The cluster scale-out progress includes:
The cluster scale-in progress includes:
If the cluster installation, scale-out, or scale-in fails, stageDesc will display the failure cause. Constraints N/A |
isMrsManagerFinish |
Boolean |
Explanation Whether MRS Manager installation is finished during cluster creation. Constraints N/A Value range
Constraints N/A |
safeMode |
Integer |
Explanation Run mode of an MRS cluster. Constraints N/A Value range
Constraints N/A |
clusterVersion |
String |
Explanation Cluster version. Constraints N/A Value range N/A Default value N/A |
nodePublicCertName |
String |
Explanation Name of the key file. Constraints N/A Value range N/A Default value N/A |
masterNodeIp |
String |
Explanation IP address of a Master node. Constraints N/A Value range N/A Default value N/A |
privateIpFirst |
String |
Explanation Preferred private IP address. Constraints N/A Value range N/A Default value N/A |
errorInfo |
String |
Explanation Error message. Constraints N/A Value range N/A Default value N/A |
tags |
String |
Explanation Tag information. Constraints N/A Value range N/A Default value N/A |
chargingStartTime |
String |
Explanation Start time of billing. Constraints N/A Value range N/A Default value N/A |
logCollection |
Integer |
Explanation Whether to collect logs when cluster installation fails. Constraints N/A Value range
Constraints N/A |
taskNodeGroups |
List<NodeGroup> |
Explanation List of Task nodes. For more parameter description, see Table 7. Constraints N/A Value range N/A Default value N/A |
nodeGroups |
List<NodeGroup> |
Explanation List of Master, Core and Task nodes. For more parameter description, see Table 7. Constraints N/A Value range N/A Default value N/A |
masterDataVolumeType |
String |
Explanation Data disk storage type of the Master node. Currently, SATA, SAS, and SSD are supported. Constraints N/A Value range N/A Default value N/A |
masterDataVolumeSize |
Integer |
Explanation Data disk storage space of Master nodes, in GB To increase data storage capacity, you can add disks at the same time when creating a cluster. Constraints N/A Value range 100-32000 Default value N/A |
masterDataVolumeCount |
Integer |
Explanation Number of data disks of the Master node Constraints N/A Value range The value can only be 1. Default value N/A |
coreDataVolumeType |
String |
Explanation Data disk storage type of the Core node. Currently, SATA, SAS, and SSD are supported. Constraints N/A Value range N/A Default value N/A |
coreDataVolumeSize |
Integer |
Explanation Data disk storage space of Core nodes, in GB To increase data storage capacity, you can add disks at the same time when creating a cluster. Constraints N/A Value range 100-32000 Default value N/A |
coreDataVolumeCount |
Integer |
Explanation Number of data disks of the Core node. Constraints N/A Value range 1-10 Default value N/A |
periodType |
Integer |
Explanation Whether the subscription type is yearly or monthly. Constraints N/A Value range
Default value N/A |
scale |
String |
Explanation Status of node changes If this parameter is left blank, no change operation is performed on a cluster node. (The status is in English by default. When the X-Language request header is set to zh-cn, this field returns Chinese text.) Constraints N/A Value range
Default value N/A |
eipId |
String |
Explanation Unique ID of the cluster EIP Constraints N/A Value range N/A Default value N/A |
eipAddress |
String |
Explanation IPv4 address of the cluster EIP Constraints N/A Value range N/A Default value N/A |
eipv6Address |
String |
Explanation IPv6 address of the cluster EIP. This parameter is not returned when an IPv4 address is used. Constraints N/A Value range N/A Default value N/A |
Parameter |
Type |
Description |
---|---|---|
componentId |
String |
Explanation Component ID Constraints N/A Value range For example, the component_id of Hadoop is MRS 3.0.2_001, MRS 2.1.0_001, MRS 1.9.2_001, MRS 1.8.10_001. Default value N/A |
componentName |
String |
Explanation Component name. Constraints N/A Value range N/A Default value N/A |
componentVersion |
String |
Explanation Component version. Constraints N/A Value range N/A Default value N/A |
componentDesc |
String |
Explanation Component description. Constraints N/A Value range N/A Default value N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Explanation Name of a bootstrap action script. Constraints N/A Value range The names of bootstrap action scripts in the same cluster must be unique. The value can contain 1 to 64 characters, including only digits, letters, spaces, hyphens (-), and underscores (_), and cannot start with a space. Default value N/A |
uri |
String |
Explanation The path of a bootstrap action script. Set this parameter to an OBS bucket path or a local VM path.
Constraints N/A Value range N/A Default value N/A |
parameters |
String |
Explanation The bootstrap action script parameters. Constraints N/A Value range N/A Default value N/A |
nodes |
Array of strings |
Explanation Type of a node where the bootstrap action script is executed. The value can be Master, Core, or Task. Constraints The node type must be represented in lowercase letters. Value range
Default value false |
active_master |
Boolean |
Explanation Whether the bootstrap action script runs only on active master nodes. Constraints N/A Value range
Default value false |
fail_action |
String |
Explanation Whether to continue executing subsequent scripts and creating a cluster after the bootstrap action script fails to execute. You are advised to set this parameter to continue in the commissioning phase so that the cluster can continue to be installed and started no matter whether the bootstrap action is successful. Constraints N/A Value range
Default value errorout |
before_component_start |
Boolean |
Explanation Time when the bootstrap action script is executed. Currently, the following two options are available: Before component start and After component start. Constraints N/A Value range
Default value false |
start_time |
Long |
Explanation The execution time of one bootstrap action script. Constraints N/A Value range N/A Default value N/A |
state |
String |
Explanation The running status of one bootstrap action script. Constraints N/A Value range
Default value N/A |
action_stages |
Array of strings |
Explanation Select the time when the bootstrap action script is executed.
Constraints N/A Value range N/A Default value N/A |
Parameter |
Type |
Description |
---|---|---|
GroupName |
String |
Explanation Node group name. Constraints N/A Value range N/A Default value N/A |
NodeNum |
Integer |
Explanation Number of nodes. The value ranges from 0 to 500. The minimum number of Master and Core nodes is 1 and the total number of Core and Task nodes cannot exceed 500. Constraints N/A Value range 0-500 Default value N/A |
NodeSize |
String |
Explanation Instance specifications of a node. Constraints N/A Value range N/A Default value N/A |
NodeSpecId |
String |
Explanation Instance specification ID of a node. Constraints N/A Value range N/A Default value N/A |
NodeProductId |
String |
Explanation Instance product ID of a node. Constraints N/A Value range N/A Default value N/A |
VmProductId |
String |
Explanation VM specifications of a node. Constraints N/A Value range N/A Default value N/A |
VmSpecCode |
String |
Explanation VM specifications of a node. Constraints N/A Value range N/A Default value N/A |
RootVolumeSize |
Integer |
Explanation System disk size of a node. This parameter is not configurable and its default value is 40 GB. Constraints N/A Value range N/A Default value N/A |
RootVolumeProductId |
String |
Explanation System disk product ID of a node. Constraints N/A Value range N/A Default value N/A |
RootVolumeType |
String |
Explanation System disk type of a node. Constraints N/A Value range N/A Default value N/A |
RootVolumeResourceSpecCode |
String |
Explanation System disk product specifications of a node. Constraints N/A Value range N/A Default value N/A |
RootVolumeResourceType |
String |
Explanation System disk product type of a node. Constraints N/A Value range N/A Default value N/A |
DataVolumeType |
String |
Explanation Data disk storage type of a node. Currently, SATA, SAS, and SSD are supported. Constraints N/A Value range
Default value N/A |
DataVolumeCount |
Integer |
Explanation Number of data disks of a node. Constraints N/A Value range N/A Default value N/A |
DataVolumeSize |
Integer |
Explanation Data disk storage space of a node. Constraints N/A Value range N/A Default value N/A |
DataVolumeProductId |
String |
Explanation Data disk product ID of a node. Constraints N/A Value range N/A Default value N/A |
DataVolumeResourceSpecCode |
String |
Explanation Data disk specifications of a node. Constraints N/A Value range N/A Default value N/A |
DataVolumeResourceType |
String |
Explanation Data disk type of a node. Constraints N/A Value range N/A Default value N/A |
Example Response
Status code: 200
Querying the cluster list is successful.
{ "clusterTotal" : "1", "clusters" : [ { "clusterId" : "bc134369-294c-42b7-a707-b2036ba38524", "clusterName" : "mrs_D0zW", "masterNodeNum" : "2", "coreNodeNum" : "3", "clusterState" : "terminated", "createAt" : "1498272043", "updateAt" : "1498636753", "chargingStartTime" : "1498273733", "logCollection" : "1", "billingType" : "Metered", "dataCenter" : "cn-hk1", "vpc" : null, "duration" : "0", "fee" : null, "hadoopVersion" : null, "masterNodeSize" : null, "coreNodeSize" : null, "componentList" : [ { "componentId" : "MRS 3.1.0_001", "componentName" : "Hadoop", "componentVersion" : "3.1.1", "componentDesc" : "A framework that allows for the distributed processing of large data sets across clusters." }, { "componentId" : "MRS 3.1.0_003", "componentName" : "HBase", "componentVersion" : "2.1.1", "componentDesc" : "A scalable, distributed database that supports structured data storage for large tables." }, { "componentId" : "MRS 3.1.0_002", "componentName" : "Spark", "componentVersion" : "2.3.2", "componentDesc" : "A fast and general engine for large-scale data processing." }, { "componentId" : "MRS 3.1.0_004", "componentName" : "Hive", "componentVersion" : "3.1.0", "componentDesc" : "A data warehouse infrastructure that provides data summarization and ad hoc querying." } ], "externalIp" : null, "externalAlternateIp" : null, "internalIp" : null, "deploymentId" : null, "remark" : "", "orderId" : null, "azId" : null, "azCode" : null, "masterNodeProductId" : null, "masterNodeSpecId" : null, "coreNodeProductId" : null, "coreNodeSpecId" : null, "azName" : "AZ1", "instanceId" : null, "vnc" : "v2/5a3314075bfa49b9ae360f4ecd333695/servers/e2cda891-232e-4703-995e-3b1406add01d/action", "tenantId" : null, "volumeSize" : "0", "volumeType" : null, "subnetId" : null, "subnetName" : null, "securityGroupsId" : null, "slaveSecurityGroupsId" : null, "bootstrapScripts" : [ { "name" : "test1-success", "uri" : "s3a://bootscript/script/simple/basic_success.sh", "parameters" : "", "nodes" : [ "master", "core" ], "active_master" : true, "fail_action" : "errorout", "before_component_start" : true, "state" : "SUCCESS", "start_time" : 1527681083, "action_stages" : [ "AFTER_SCALE_IN", "AFTER_SCALE_OUT" ] } ], "isMrsManagerFinish" : false, "stageDesc" : "Installing MRS Manager", "safeMode" : "0", "clusterVersion" : null, "nodePublicCertName" : null, "masterNodeIp" : "unknown", "privateIpFirst" : null, "errorInfo" : "", "clusterType" : "0", "nodeGroups" : [ { "GroupName" : "master_node_default_group", "NodeNum" : "1", "NodeSize" : "s3.xlarge.2.linux.bigdata", "NodeSpecId" : "cdc6035a249a40249312f5ef72a23cd7", "VmProductId" : "", "VmSpecCode" : null, "NodeProductId" : "dc970349d128460e960a0c2b826c427c", "RootVolumeSize" : "40", "RootVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "RootVolumeType" : "SATA", "RootVolumeResourceSpecCode" : "", "RootVolumeResourceType" : "", "DataVolumeType" : "SATA", "DataVolumeCount" : "1", "DataVolumeSize" : "100", "DataVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "DataVolumeResourceSpecCode" : "", "DataVolumeResourceType" : "" }, { "GroupName" : "core_node_analysis_group", "NodeNum" : "1", "NodeSize" : "s3.xlarge.2.linux.bigdata", "NodeSpecId" : "cdc6035a249a40249312f5ef72a23cd7", "VmProductId" : "", "VmSpecCode" : null, "NodeProductId" : "dc970349d128460e960a0c2b826c427c", "RootVolumeSize" : "40", "RootVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "RootVolumeType" : "SATA", "RootVolumeResourceSpecCode" : "", "RootVolumeResourceType" : "", "DataVolumeType" : "SATA", "DataVolumeCount" : "1", "DataVolumeSize" : "100", "DataVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "DataVolumeResourceSpecCode" : "", "DataVolumeResourceType" : "" }, { "GroupName" : "task_node_analysis_group", "NodeNum" : "1", "NodeSize" : "s3.xlarge.2.linux.bigdata", "NodeSpecId" : "cdc6035a249a40249312f5ef72a23cd7", "VmProductId" : "", "VmSpecCode" : null, "NodeProductId" : "dc970349d128460e960a0c2b826c427c", "RootVolumeSize" : "40", "RootVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "RootVolumeType" : "SATA", "RootVolumeResourceSpecCode" : "", "RootVolumeResourceType" : "", "DataVolumeType" : "SATA", "DataVolumeCount" : "1", "DataVolumeSize" : "100", "DataVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "DataVolumeResourceSpecCode" : "", "DataVolumeResourceType" : "" } ], "taskNodeGroups" : [ { "GroupName" : "task_node_default_group", "NodeNum" : "1", "NodeSize" : "s3.xlarge.2.linux.bigdata", "NodeSpecId" : "cdc6035a249a40249312f5ef72a23cd7", "VmProductId" : "", "VmSpecCode" : null, "NodeProductId" : "dc970349d128460e960a0c2b826c427c", "RootVolumeSize" : "40", "RootVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "RootVolumeType" : "SATA", "RootVolumeResourceSpecCode" : "", "RootVolumeResourceType" : "", "DataVolumeType" : "SATA", "DataVolumeCount" : "1", "DataVolumeSize" : "100", "DataVolumeProductId" : "16c1dcf0897249758b1ec276d06e0572", "DataVolumeResourceSpecCode" : "", "DataVolumeResourceType" : "" } ], "masterDataVolumeType" : "SATA", "masterDataVolumeSize" : "200", "masterDataVolumeCount" : "1", "coreDataVolumeType" : "SATA", "coreDataVolumeSize" : "100", "coreDataVolumeCount" : "1", "periodType" : "0" } ] }
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot