查询集群列表
功能介绍
查看用户创建的集群列表信息。该接口不兼容Sahara。
URI
- URI格式
 - 参数说明 
    
表1 路径参数 参数
是否必选
参数类型
描述
project_id
是
String
项目编号。获取方法,请参见获取项目ID。
表2 Query参数说明 名称
是否必选
参数类型
说明
pageSize
否
String
分页查询每页返回的最大集群数量。
取值范围:[1~2147483646]
currentPage
否
String
当前查询页码。
clusterName
否
String
集群名称。
clusterState
否
String
根据集群状态查询集群列表。
- existing:查询现有集群列表,包括除“已终止”状态外的所有集群。
 - history:查询历史集群列表,包括所有“已终止”、终止集群失败、集群删除虚拟机失败、终止集群更新数据库失败等状态的集群。
 - starting:查询启动中的集群列表。
 - running:查询运行中的集群列表。
 - terminated:查询已删除的集群列表。
 - failed:查询失败的集群列表。
 - abnormal:查询异常的集群列表。
 - terminating:查询删除中的集群列表。
 - frozen:查询已冻结的集群列表。
 - scaling-out:查询扩容中的集群列表。
 - scaling-in:查询缩容中的集群列表。
 
tags
否
String
可以通过集群的标签来搜索指定标签的集群,当指定多个tag进行查询时,标签之间是与的关系。
- tags参数的格式为tags=k1*v1,k2*v2,k3*v3
 - 当标签的value为空时,格式为tags=k1,k2,k3*v3
 
enterpriseProjectId
否
String
通过企业项目ID来搜索指定项目的集群。
该参数默认设置为0,表示为default企业项目。
 
请求消息
无
响应消息
| 
        参数名  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|
| 
        clusterTotal  | 
      
        String  | 
      
        集群列表总数。  | 
     
| 
        clusters  | 
      
        Array of Cluster objects  | 
      
        集群参数,请参见表4。  | 
     
| 
        参数名  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|
| 
        clusterId  | 
      
        String  | 
      
        集群ID。  | 
     
| 
        clusterName  | 
      
        String  | 
      
        集群名称。  | 
     
| 
        masterNodeNum  | 
      
        String  | 
      
        集群部署的Master节点数量。  | 
     
| 
        coreNodeNum  | 
      
        String  | 
      
        集群部署的Core节点数量。  | 
     
| 
        totalNodeNum  | 
      
        String  | 
      
        集群部署的节点总数。  | 
     
| 
        clusterState  | 
      
        String  | 
      
        
        集群状态,包括:
         
  | 
     
| 
        createAt  | 
      
        String  | 
      
        集群创建时间,十位时间戳。  | 
     
| 
        updateAt  | 
      
        String  | 
      
        集群更新时间,十位时间戳。  | 
     
| 
        dataCenter  | 
      
        String  | 
      
        集群工作区域。  | 
     
| 
        vpc  | 
      
        String  | 
      
        VPC名称。  | 
     
| 
        vpcId  | 
      
        String  | 
      
        VPC ID。  | 
     
| 
        hadoopVersion  | 
      
        String  | 
      
        Hadoop组件版本信息。  | 
     
| 
        masterNodeSize  | 
      
        String  | 
      
        Master节点的实例规格。  | 
     
| 
        coreNodeSize  | 
      
        String  | 
      
        Core节点的实例规格。  | 
     
| 
        componentList  | 
      
        Array  | 
      
        组件列表信息,请参见表5。  | 
     
| 
        externalIp  | 
      
        String  | 
      
        公网IP地址。  | 
     
| 
        externalAlternateIp  | 
      
        String  | 
      
        公网备用IP地址。  | 
     
| 
        internalIp  | 
      
        String  | 
      
        内网IP地址。  | 
     
| 
        deploymentId  | 
      
        String  | 
      
        集群部署ID。  | 
     
| 
        remark  | 
      
        String  | 
      
        集群备注信息。  | 
     
| 
        orderId  | 
      
        String  | 
      
        创建集群的订单号。  | 
     
| 
        azId  | 
      
        String  | 
      
        可用区域ID。  | 
     
| 
        masterNodeProductId  | 
      
        String  | 
      
        Master节点产品ID。  | 
     
| 
        masterNodeSpecId  | 
      
        String  | 
      
        Master节点规格ID。  | 
     
| 
        coreNodeProductId  | 
      
        String  | 
      
        Core节点产品ID。  | 
     
| 
        coreNodeSpecId  | 
      
        String  | 
      
        Core节点规格ID。  | 
     
| 
        azName  | 
      
        String  | 
      
        可用区域名称。  | 
     
| 
        azCode  | 
      
        String  | 
      
        可用区域英文名称  | 
     
| 
        availabilityZoneId  | 
      
        String  | 
      
        可用区域  | 
     
| 
        instanceId  | 
      
        String  | 
      
        实例ID。  | 
     
| 
        vnc  | 
      
        String  | 
      
        远程登录弹性云服务器的URI地址。  | 
     
| 
        tenantId  | 
      
        String  | 
      
        项目编号。  | 
     
| 
        volumeSize  | 
      
        Integer  | 
      
        磁盘存储空间。  | 
     
| 
        volumeType  | 
      
        String  | 
      
        磁盘类型。  | 
     
| 
        subnetId  | 
      
        String  | 
      
        子网ID。  | 
     
| 
        clusterType  | 
      
        Integer  | 
      
        集群类型。  | 
     
| 
        subnetName  | 
      
        String  | 
      
        子网名称。  | 
     
| 
        securityGroupsId  | 
      
        String  | 
      
        安全组ID。  | 
     
| 
        slaveSecurityGroupsId  | 
      
        String  | 
      
        非Master节点的安全组id,当前一个MRS集群只会使用一个安全组,所以该字段已经废弃。  | 
     
| 
        bootstrapScripts  | 
      
        Array of 表 BootstrapScript objects  | 
      
        配置引导操作脚本信息。  | 
     
| 
        stageDesc  | 
      
        String  | 
      
        集群进度描述。 
        安装集群进度包括:
         
       
 
        扩容集群进度包括:
         
       
 
        缩容集群进度包括:
         
       
 集群安装、扩容、缩容失败,stageDesc会显示失败的原因。  | 
     
| 
        isMrsManagerFinish  | 
      
        Boolean  | 
      
        表示集群创建过程中,MRS Manager是否安装完成。 
  | 
     
| 
        safeMode  | 
      
        Integer  | 
      
        MRS集群运行模式: 
  | 
     
| 
        clusterVersion  | 
      
        String  | 
      
        集群版本。  | 
     
| 
        nodePublicCertName  | 
      
        String  | 
      
        密钥文件名称。  | 
     
| 
        masterNodeIp  | 
      
        String  | 
      
        Master节点IP。  | 
     
| 
        privateIpFirst  | 
      
        String  | 
      
        首选私有IP。  | 
     
| 
        errorInfo  | 
      
        String  | 
      
        错误信息。  | 
     
| 
        tags  | 
      
        String  | 
      
        标签信息  | 
     
| 
        logCollection  | 
      
        Integer  | 
      
        集群安装失败时,是否搜集日志。 
  | 
     
| 
        taskNodeGroups  | 
      
        List<NodeGroup>  | 
      
        Task节点列表信息。参数说明请参见表7。  | 
     
| 
        nodeGroups  | 
      
        List<NodeGroup>  | 
      
        Master节点、Core节点和Task节点列表信息。参数说明参见表7。  | 
     
| 
        masterDataVolumeType  | 
      
        String  | 
      
        Master节点数据磁盘存储类别,目前支持SATA、SAS和SSD。  | 
     
| 
        masterDataVolumeSize  | 
      
        Integer  | 
      
        Master节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。 取值范围:100GB~32000GB  | 
     
| 
        masterDataVolumeCount  | 
      
        Integer  | 
      
        Master节点数据磁盘个数。 取值只能是1  | 
     
| 
        coreDataVolumeType  | 
      
        String  | 
      
        Core节点数据磁盘存储类别,目前支持SATA、SAS和SSD。  | 
     
| 
        coreDataVolumeSize  | 
      
        Integer  | 
      
        Core节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。 取值范围:100GB~32000GB  | 
     
| 
        coreDataVolumeCount  | 
      
        Integer  | 
      
        Core节点数据磁盘个数。 取值范围:1~10  | 
     
| 
        scale  | 
      
        String  | 
      
        集群节点的变更状态(扩容/缩容/变更规格)。当该参数取值为空时,表示集群节点没有进行变更操作。 取值范围: 
  | 
     
| 
        参数名  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|
| 
        componentId  | 
      
        String  | 
      
        组件ID。 例如:Hadoop的component_id为MRS 3.1.0_001。  | 
     
| 
        componentName  | 
      
        String  | 
      
        组件名称。  | 
     
| 
        componentVersion  | 
      
        String  | 
      
        组件版本。  | 
     
| 
        componentDesc  | 
      
        String  | 
      
        组件描述信息。  | 
     
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        name  | 
      
        String  | 
      
        引导操作脚本的名称,同一个集群的引导操作脚本名称不允许相同。 只能由数字、英文字符、空格、中划线和下划线组成,且不能以空格开头。 可输入的字符串长度为1~64个字符。  | 
     
| 
        uri  | 
      
        String  | 
      
        引导操作脚本的路径。设置为OBS桶的路径或虚拟机本地的路径。 
  | 
     
| 
        parameters  | 
      
        String  | 
      
        引导操作脚本参数。  | 
     
| 
        nodes  | 
      
        Array of strings  | 
      
        引导操作脚本所执行的节点类型,包含master、core和task三种类型。 说明:节点类型必须为小写字母。  | 
     
| 
        active_master  | 
      
        Boolean  | 
      
        引导操作脚本是否只运行在主Master节点上。 缺省值为false,表示引导操作脚本可运行在所有Master节点上。  | 
     
| 
        fail_action  | 
      
        String  | 
      
        引导操作脚本执行失败后,是否继续执行后续脚本和创建集群。 缺省值为errorout,表示终止操作。 说明: 建议您在调试阶段设置为“继续”,无论此引导操作是否执行成功,则集群都能继续安装和启动。 枚举值: 
  | 
     
| 
        before_component_start  | 
      
        Boolean  | 
      
        引导操作脚本执行的时间。目前支持“组件启动前”和“组件启动后”两种类型。 缺省值为false,表示引导操作脚本在组件启动后执行。  | 
     
| 
        action_stages  | 
      
        Array of strings  | 
      
        选择引导操作脚本执行的时间。 
  | 
     
| 
        参数名  | 
      
        参数类型  | 
      
        说明  | 
     
|---|---|---|
| 
        GroupName  | 
      
        String  | 
      
        节点组名。  | 
     
| 
        NodeNum  | 
      
        Integer  | 
      
        节点数量,取值范围0~500,Master节点和Core节点数量至少为1,Core与Task节点总数最大为500个。  | 
     
| 
        NodeSize  | 
      
        String  | 
      
        节点的实例规格。  | 
     
| 
        NodeSpecId  | 
      
        String  | 
      
        节点实例规格ID。  | 
     
| 
        NodeProductId  | 
      
        String  | 
      
        节点实例产品ID。  | 
     
| 
        VmProductId  | 
      
        String  | 
      
        节点虚拟机产品ID。  | 
     
| 
        VmSpecCode  | 
      
        String  | 
      
        节点虚拟机产品规格。  | 
     
| 
        RootVolumeSize  | 
      
        Integer  | 
      
        节点系统盘大小,不可配置,默认为40GB。  | 
     
| 
        RootVolumeProductId  | 
      
        String  | 
      
        节点系统盘的产品ID。  | 
     
| 
        RootVolumeType  | 
      
        String  | 
      
        节点系统盘的类型。  | 
     
| 
        RootVolumeResourceSpecCode  | 
      
        String  | 
      
        节点系统盘产品规格。  | 
     
| 
        RootVolumeResourceType  | 
      
        String  | 
      
        节点系统盘产品类型。  | 
     
| 
        DataVolumeType  | 
      
        String  | 
      
        节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 
  | 
     
| 
        DataVolumeCount  | 
      
        Integer  | 
      
        节点数据磁盘存储数目。  | 
     
| 
        DataVolumeSize  | 
      
        Integer  | 
      
        节点数据磁盘存储大小。  | 
     
| 
        DataVolumeProductId  | 
      
        String  | 
      
        节点数据磁盘的产品ID。  | 
     
| 
        DataVolumeResourceSpecCode  | 
      
        String  | 
      
        节点数据磁盘的产品规格。  | 
     
| 
        DataVolumeResourceType  | 
      
        String  | 
      
        节点数据磁盘的产品类型。  | 
     
示例
- 请求示例
    
GET /v1.1/{project_id}/cluster_infos?pageSize={page_size}¤tPage={current_page}&clusterState={cluster_state}&tags={tags} - 响应示例
    
{ "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": , "vpc": null, "duration": "0", "fee": null, "hadoopVersion": null, "masterNodeSize": null, "coreNodeSize": null, "componentList": [{ "id": null, "componentId": "MRS 3.1.0_001", "componentName": "Hadoop", "componentVersion": "3.1.1", "external_datasources": null, "componentDesc": "针对大数据集的分布式数据处理框架。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_002", "componentName": "HBase", "componentVersion": "2.2.3", "external_datasources": null, "componentDesc": "HBase是一个高可靠性、高性能、面向列、可伸缩的分布式存储系统。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_003", "componentName": "Hive", "componentVersion": "3.1.0", "external_datasources": null, "componentDesc": "方便查询、管理存储在分布式存储系统上的大数据集的数据仓库软件。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_004", "componentName": "Spark2x", "componentVersion": "2.4.5", "external_datasources": null, "componentDesc": "Spark2x是一个对大规模数据处理的快速和通用引擎,基于开源Spark2.x版本开发。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_005", "componentName": "Tez", "componentVersion": "0.9.2", "external_datasources": null, "componentDesc": "一个支持有向无环图的分布式计算框架。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_006", "componentName": "Flink", "componentVersion": "1.12.0", "external_datasources": null, "componentDesc": "Flink是一个开源的批流合一的消息处理系统。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_008", "componentName": "Kafka", "componentVersion": "2.11-2.4.0", "external_datasources": null, "componentDesc": "Kafka是一个分布式消息发布订阅系统。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_009", "componentName": "Flume", "componentVersion": "1.9.0", "external_datasources": null, "componentDesc": "Flume是一个分布式、高可用、高可靠的海量日志采集、聚合和传输系统。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_014", "componentName": "Hue", "componentVersion": "4.7.0", "external_datasources": null, "componentDesc": "Apache Hadoop的UI界面。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_015", "componentName": "Oozie", "componentVersion": "5.1.0", "external_datasources": null, "componentDesc": "Hadoop作业调度系统。", "componentDescEn": null }, { "id": null, "componentId": "MRS 3.1.0_022", "componentName": "Ranger", "componentVersion": "2.0.0", "external_datasources": null, "componentDesc": "RANGER是一个基于Hadoop平台,旨在为复杂数据提供监控、操作、管理等权限管控接口的集中式框架。", "componentDescEn": null }], "externalIp": null, "externalAlternateIp": null, "internalIp": null, "deploymentId": null, "remark": "", "orderId": null, "azId": null, "masterNodeProductId": null, "masterNodeSpecId": null, "coreNodeProductId": null, "coreNodeSpecId": null, "azName": , "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, "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": "", "nodeSpecId": "cdc6035a249a40249312f5ef72a23cd7", "vmProductId": "", "vmSpecCode": null, "nodeProductId": "dc970349d128460e960a0c2b826c427c", "rootVolumeSize": 480, "rootVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "rootVolumeType": "SATA", "rootVolumeResourceSpecCode": "", "rootVolumeResourceType": "", "dataVolumeType": "SATA", "dataVolumeCount": 1, "dataVolumeSize": 600, "dataVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "dataVolumeResourceSpecCode": "", "dataVolumeResourceType": "", }, { "groupName": "core_node_analysis_group", "nodeNum": 1, "nodeSize": "", "nodeSpecId": "cdc6035a249a40249312f5ef72a23cd7", "vmProductId": "", "vmSpecCode": null, "nodeProductId": "dc970349d128460e960a0c2b826c427c", "rootVolumeSize": 480, "rootVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "rootVolumeType": "SATA", "rootVolumeResourceSpecCode": "", "rootVolumeResourceType": "", "dataVolumeType": "SATA", "dataVolumeCount": 1, "dataVolumeSize": 600, "dataVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "dataVolumeResourceSpecCode": "", "dataVolumeResourceType": "", }, { "groupName": "task_node_analysis_group", "nodeNum": 1, "nodeSize": "", "nodeSpecId": "cdc6035a249a40249312f5ef72a23cd7", "vmProductId": "", "vmSpecCode": null, "nodeProductId": "dc970349d128460e960a0c2b826c427c", "rootVolumeSize": 480, "rootVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "rootVolumeType": "SATA", "rootVolumeResourceSpecCode": "", "rootVolumeResourceType": "", "dataVolumeType": "SATA", "dataVolumeCount": 1, "dataVolumeSize": 600, "dataVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "dataVolumeResourceSpecCode": "", "dataVolumeResourceType": "", } ], "taskNodeGroups": [ { "groupName": "task_node_default_group", "nodeNum": 1, "nodeSize": "", "nodeSpecId": "cdc6035a249a40249312f5ef72a23cd7", "vmProductId": "", "vmSpecCode": null, "nodeProductId": "dc970349d128460e960a0c2b826c427c", "rootVolumeSize": 480, "rootVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "rootVolumeType": "SATA", "rootVolumeResourceSpecCode": "", "rootVolumeResourceType": "", "dataVolumeType": "SATA", "dataVolumeCount": 1, "dataVolumeSize": 600, "dataVolumeProductId": "16c1dcf0897249758b1ec276d06e0572", "dataVolumeResourceSpecCode": "", "dataVolumeResourceType": "", } ], "masterDataVolumeType": "SATA", "masterDataVolumeSize": 600, "masterDataVolumeCount": 1, "coreDataVolumeType": "SATA", "coreDataVolumeSize": 600, "coreDataVolumeCount": 1, } ] } 
错误码
请参见错误码。