You need to enable JavaScript to run this app.
导航

GetCluster - 获取集群

最近更新时间2024.03.14 17:40:33

首次发布时间2024.01.22 15:56:41

获取集群

使用说明

调用GetCluster,查询该账号下 E-MapReduce(EMR)集群详情。

注意事项

已使用账号登录火山引擎。

请求说明

请求方式:POST
请求地址:https://open.volcengineapi.com/?Version=2023-08-15&Action=GetCluster

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

GetCluster

要执行的操作,取值:GetCluster

Version
String

2023-08-15

API的版本,取值:2023-08-15

ClusterId
String

emr-xxx

集群ID

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
Tags
Array of Tag

[
{
"Key": "volc:emr:create_by",
"Value": "EMR"
},
{
"Key": "volc:emr:emr_cluster_type",
"Value": "Hadoop"
},
{
"Key": "volc:emr:location",
"Value": "cn-beijing/cn-beijing-b"
}
]

标签列表

RegionId
String

cn-beijing

地域ID

ProjectName
String

default

项目名称

ClusterId
String

emr-xxx

集群ID

ClusterName
String

OpenApiHadoop3.7.0-xxx

集群名称

ClusterType
String

Hadoop

集群类型

ReleaseVersion
String

3.7.0

集群版本

SecurityGroupId
String

sg-xxx

集群全局安全组ID

VpcId
String

vpc-xxx

集群vpcId

NodeAttribute
NodeAttribute

{
"ZoneId": "cn-beijing-b",
"EcsIamRole": "VEECSforEMRRole"
}

集群全局的节点信息

ClusterDomainNames
Array of String

[
"emr-xxx.offline-cn-beijing.emr-volces.com",
"offline-cn-beijing.emr-volces.com"
]

集群dns域名后缀

AccountId
Long

2100xxx

账号ID

CreatorId
Long

6xxx

创建者ID

CreatorName
String

xxx

创建者名称

Autorenew
Boolean

false

是否自动续费

AutorenewPeriod
Integer

1

自动续费周期

AutorenewPeriodUnit
String

Week, //按周
Month, //按月
Year; //按年

自动续费周期单位

ClusterState
String

PENDING_FOR_PAYMENT,
CREATING,
RUNNING,
TERMINATING,
TERMINATED,
TERMINATED_WITH_ERROR,
FAILED,
SHUTDOWN

集群状态

ChargeType
String

PRE,POST

付费类型

DeployMode
String

NORMAL,
HA

集群部署模式

SecurityMode
String

NORMAL,
KERBEROS

安全模式

CreateTime
Long

1703437906000

集群创建时间

ReadyTime
Long

1703437906000

集群创建完成时间

ExpireTime
Long

1703437906000

集群过期时间

TerminateTime
Long

1703437906000

集群终止时间

StateChangeReason
StateChangeReason

xxx

状态变更原因

请求示例

{
   "ClusterId":"emr-xxx"
}

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20231205194333E4CF0C48565Cxxx",
        "Action": "GetCluster",
        "Version": "2023-08-15",
        "Service": "emr",
        "Region": "cn-beijing",
        "Error": null,
        "Deprecated": false
    },
    "Result": {
        "RegionId": "cn-beijing",
        "ProjectName": "default",
        "ClusterId": "emr-xxx",
        "ClusterName": "OpenApiHadoop3.7.0-xxx",
        "ClusterType": "Hadoop",
        "ReleaseVersion": "3.7.0",
        "SecurityGroupId": "sg-xxx",
        "VpcId": "vpc-xxx",
        "NodeAttribute": {
            "ZoneId": "cn-beijing-b",
            "EcsIamRole": "VEECSforEMRRole",
            "LoginUserName": null
        },
        "ClusterDomainNames": [
            "emr-xxx.offline-cn-beijing.emr-volces.com",
            "offline-cn-beijing.emr-volces.com"
        ],
        "AccountId": 210xxx,
        "CreatorId": 64xxx,
        "CreatorName": null,
        "Autorenew": false,
        "AutorenewPeriod": 1,
        "AutorenewPeriodUnit": null,
        "ClusterState": "RUNNING",
        "ChargeType": "POST",
        "DeployMode": "HIGH_AVAILABLE",
        "SecurityMode": "SIMPLE",
        "CreateTime": 1701764286214,
        "ReadyTime": 1701770482932,
        "ExpireTime": null,
        "TerminateTime": null,
        "Tags": null,
        "StateChangeReason": null
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
InvalidClusterId
cluster id {clusterId} not found

集群不存在

400
InvalidRequest
Access Denied {clusterId}

对该集群没有权限