API Introduction
This API provides the function to query cluster information. The system takes query conditions from user input and returns the details of clusters that meet these conditions under the resource pool specified by the user. Information of deleted clusters will not be returned.
API Restrictions
None
Require API Approval or Not
No
URI
POST /v1/emr/openapi/cluster/clusterDetail/selectPage
Content-Type
application/json
Path Parameter
None
Query Parameter
None
Request Header Parameter
None
Request Body Parameter
Parameter | Required or Not | Parameter Type | Description | Example | Lower-level Object |
regionId | Yes | String | Resource pool ID | bb9fdb42056f11eda1610242ac110002 | / |
pageIndex | Yes | Integer | Current page, parameter value must be a positive integer | 1 | / |
pageSize | Yes | Integer | Size of each page, parameter value must be a positive integer | 10 | / |
clusterName | No | String | Cluster Name | cluster_name | / |
clusterStateCode | No | Integer | Code for the cluster state (1: Starting, 2: Running, 3: Abnormal Termination, 4: Releasing, 5: Terminated, 10: Frozen) | 1 | / |
clusterTypeCode | No | Integer | Code for the cluster type (1: Data Lake, 2: Data Service, 3: Data Analysis, 4: Elastic Search) | 1 | / |
Response Parameter
Parameter | Parameter Type | Description | Example | Lower-level Object |
statusCode | Integer | Status Code | 200 | / |
message | String | Brief summary of the current API call status and necessary prompt information. | Requested | / |
error | String | Error code. This field is not returned when the request is successful. | EMR_400001 | / |
returnObj | Object | Return result. | / | returnObj |
Table returnObj
Parameter | Parameter Type | Description | Example | Lower-level Object |
total | Integer | Total number of clusters | 23 | / |
size | Integer | Number of clusters returned in the current query | 1 | / |
current | Integer | Current page | 1 | / |
orders | Array of Objects | Sort field and sort method | / | orderItem |
optimizeCountSql | Boolean | Automatic optimization of count SQL query | true | / |
searchCount | Boolean | Whether to perform count query, default is true | true | / |
countId | String | ID for performing count query | 1 | / |
maxLimit | Integer | Maximum limit on the number of entries per page | 20 | / |
pages | Integer | Total number of pages | 5 | / |
records | Array of Objects | Cluster List | / | records |
Table orderItem
Parameter | Parameter Type | Description | Example | Lower-level Object |
column | String | The field that is to be sorted | regionId | / |
acs | Boolean | Specifies whether the sorting is in ascending order, the default is true | true | / |
Table records
Parameter | Parameter Type | Description | Example | Lower-level Object |
id | String | Cluster ID | 8571aa313aaf77d45bf6765805a9ce55 | / |
managerClusterId | Integer | Cluster ID as defined by the manager | 1 | / |
iaasType | String | Platform | Public Cloud | / |
regionId | String | Resource pool ID | bb9fdb42056f11eda1610242ac110002 | / |
regionName | String | Resource pool name | East China 1 | / |
availableZoneId | String | Availability zone ID | cn-huadong1-jsnj1A-public-ctcloud | / |
availableZoneName | String | Availability zone name | AZ 1 | / |
clusterName | String | Cluster Name | test_vpc_24 | / |
payType | String | Payment Type | Annual and Monthly Subscription | / |
clusterType | String | Cluster Type | Elastic Search | / |
clusterTypeVersion | String | Product Version | YI-MapReduce-2.12.0 | / |
clusterPlanCode | String | Code of the cluster plan | cloud-search | / |
componentNameList | String | List of component names | [{componentTitle:ElasticSearch,version:7.10.2}, | / |
datasourceConfigs | String | Information about the data source | [] | / |
vpcId | String | VPC ID | vpc-0k5xl6w5 | / |
subnetId | String | Subnet ID | subnet-i2ys8sp | / |
securityGroupId | String | Security Group ID | [sg-4h7w9cl1] | / |
clusterDueTime | Integer | Expiry time of the cluster | 1709193751000 | / |
userId | String | User ID | ba14c8e729e447d69698f81ac7d55555 | / |
accountId | String | Account ID | ed24e4b414a048b0a9cb995f59cc85jj | / |
clusterCreateTime | Integer | Creation time of the cluster | 1706515357000 | / |
clusterState | String | Cluster Status | Running | / |
createTime | Integer | Creation time | 1706515356000 | / |
updateTime | Integer | Update time | 1706515356000 | / |
Enumeration Parameters
None
Request Header Example
None
Request URL Example
https://emr-global.ctapi.ctyun.cn/v1/emr/openapi/cluster/clusterDetail/selectPage
Request Body Example
{
"clusterName":"",
"clusterStateCode": 2,
"clusterTypeCode": 2,
"pageIndex": 1,
"pageSize": 10,
"regionId":"bb9fdb42056f11eda1619242ac110002"
}
Response Example
Successful request return value example
{
"statusCode": 200,
"message": "success",
"returnObj": {
"records": [
{
"id": "2cd01a834b8e0c14d4a03c01d6052924",
"managerClusterId": 1,
"iaasType": "Public Cloud",
"regionId": "bb9fdb42056f11eda1610242ac110002",
"regionName": "East China 1",
"availableZoneId": "cn-huadong1-jsnj1A-public-ctcloud",
"availableZoneName": "Availability Zone 1",
"clusterName": "sjfw-sxy-0207-3",
"payType": "Annual or Monthly",
"clusterType": "Data Service",
"clusterTypeVersion": "YI-MapReduce-2.12.1",
"clusterPlanCode": "data-service",
"componentNameList": "[{\"componentTitle\":\"OpenLDAP\",\"version\":\"2.4.50\"},{\"componentTitle\":\"Kerberos\",\"version\":\"1.18.2\"},{\"componentTitle\":\"ZooKeeper\",\"version\":\"3.7.1\"},{\"componentTitle\":\"HDFS\",\"version\":\"3.3.3\"},{\"componentTitle\":\"YARN\",\"version\":\"3.3.3\"},{\"componentTitle\":\"HBase\",\"version\":\"2.4.12\"},{\"componentTitle\":\"Ranger\",\"version\":\"2.2.0\"}]",
"datasourceConfigs": "[{\"compType\":\"Ranger\",\"properties\":[{\"propName\":\"DB_Host\",\"propValue\":\"192.168.0.156\"},{\"propName\":\"DB_Port\",\"propValue\":\"13049\"},{\"propName\":\"DB_Name\",\"propValue\":\"ranger0207_4_sxy\"},{\"propName\":\"DB_User\",\"propValue\":\"root\"},{\"propName\":\"DB_Password\",\"propValue\":\"t3O15dEAnNxQbKytUnCpi+ir5lbdkt45Zxm9BSO1YoIlowerqD0dCA22hMVLDwhff5na3fz4KAnNW7fQpP84ZaKgX6XRovjEsWJ0Gyn9ss0NZ3nRI7jjOW08CnNOmGRirY3OebmYO9PsSucjVMGCPAplyhnjMefhGJHOFnvw4xU=\"}]}]",
"vpcId": "vpc-fr2xjo1gj0",
"subnetId": "subnet-vkixrw8xw7",
"securityGroupId": "[\"sg-72kksosxfn\"]",
"clusterDueTime": 1709795918000,
"userId": "ba14c8e729e447d69698f81ac7d506b5",
"accountId": "ed24e4b414a048b0a9cb995f59cc85dd",
"clusterCreateTime": 1707290310000,
"clusterState": "Running",
"createTime": 1707290309000,
"updateTime": 1707291860000
}
],
"total": 1,
"size": 10,
"current": 1,
"orders": [],
"optimizeCountSql": true,
"searchCount": true,
"countId": "",
"maxLimit": null,
"pages": 1
}
}
Failed request return value example
{
"statusCode": 200,
"error": "EMR_400010",
"message": "pageIndex, regionId are required, not provided",
"returnObj": []
}