创建集群

创建集群

URI

POST /hdinsight/v1/open-insights

请求头

Content-Type:application/json

请求参数

名称 位置 类型 是否必须 默认值 描述
orderType body String 订单类型
region body String 区域
billType body String 计费模式
duration body String 时长,包年包月必填,值以月为单位
isAutoRenew body String 设置包年包月为自动续费,值为"true"或者"false"
name body String 实例名称
cluster body JsonObject 集群名称
clusterType body String 实例类别
userName body String 用户名
password body String 用户密码
enableHA body Boolean 高可用
enableSecurity body Boolean 开启安全
instanceGroups body JsonArray 实例组
instanceType body String 节点规格
volumeCount body Integer 附加盘数量
volumeSize body Integer 附加盘容量
volumeType body String 附加盘类型
group body String 节点类型
securityGroup body JsonObject
securityGroupId body String 安全组ID
network body JsonObject
subnetId body String 子网ID
networkId body String 虚拟私有网络ID
eip body JsonObject 弹性公网IP,null为不开通
bandwidth body Integer 带宽
stackAuthentication body JsonObject
publicKeyId body String 选择已有ssh密钥
publicKey body String 上传ssh密钥

返回参数

名称 位置 类型 描述
name body String 集群名称
userId body String 用户ID
creatorName body String 用户名称
orderType body String 订单类型
createdTime body Data 订单创建时间
result body String 订单创建结果
message body String 通知信息
id body Long 集群ID

示例

请求示例

{
    "orderType": "new",
    "region": "cn-north-3",
    "billType": "hourlySettlement",
    "name": " hdinsight-20190717163927",
    "cluster": {
        "clusterType": "hadoop",
        "userName": "admin",
        "password": "adminA123",
        "enableHA": false,
        "enableSecurity": false
    },
    "instanceGroups": [{
            "instanceType": "hdinsight_4C16G80G_general",
            "volumeCount": 0,
            "volumeSize": 100,
            "volumeType": "SATA",
            "group": "master",
            "securityGroup": {
                "securityGroupId": "250d2e22-c7ea-4216-85ab-7f29275bf5d3"
            }
        },
        {
            "instanceType": "hdinsight_2C8G40G_general",
            "nodeCount": 3,
            "volumeCount": 0,
            "volumeSize": 100,
            "volumeType": "SATA",
            "group": "worker",
            "securityGroup": {
                "securityGroupId": "250d2e22-c7ea-4216-85ab-7f29275bf5d3"
            }
        },
        {
            "instanceType": "hdinsight_2C8G40G_general",
            "nodeCount": 1,
            "volumeCount": 0,
            "volumeSize": 100,
            "volumeType": "SATA",
            "group": "compute",
            "securityGroup": {
                "securityGroupId": "250d2e22-c7ea-4216-85ab-7f29275bf5d3"
            }
        }
    ],
    "network": {
        "subnetId": "a13bfb37-cdd9-456d-9e87-4c67bf5ffeb0",
        "networkId": "61ff9c76-3c77-41f2-8095-b6ba9ef43243",
        "eip": null
    },
    "stackAuthentication": {
        "publicKeyId": "asdfasdfsa"
    }
}

响应示例

{
    "name": " hdinsight-20190717163927",
    "userId": "c4dc81c6-da86-427e-b9f9-60e495062a70",
    "creatorName": "xuewei81",
    "orderType": "new",
    "createdTime": 1577416692873,
    "result": "success",
    "message": "托管Hadoop集群hdinsight-20190717163927开始创建."
}

错误码

错误代码 错误信息 Http状态码 说明
300.011400 集群操作请求校验失败 500 集群操作请求校验失败

集群扩容

集群扩容

URI

POST /hdinsight/v1/open-insights/expand-cluster

请求头

Content-Type:application/json

请求参数

名称 位置 类型 是否必须 默认值 描述
orderType body String 订单类型
id body Long 集群ID
instanceId body String 实例ID
group body String 节点类型
desiredCount body String 扩容后该类型节点的数量

返回参数

名称 位置 类型 描述
name body String 集群名称
userId body String 用户ID
creatorName body String 用户名称
orderType body String 订单类型
createdTime body Data 订单创建时间
result body String 订单创建结果
message body String 通知信息
id body Long 集群ID

示例

请求示例

{
    "orderType": "changeConfigure",
    "id": 11,
    "instanceId": "098bda46-5931-49a1-bafd-cafcd266c1c4",
    "group": "worker",
    "desiredCount": "4"
}

响应示例

{
    "name": "yujingxuewei81hdinsigh",
    "userId": "c4dc81c6-da86-427e-b9f9-60e495062a70",
    "creatorName": "xuewei81",
    "orderType": "changeConfigure",
    "createdTime": 1577417228047,
    "result": "success",
    "message": "Start updating the cluster",
    "id": 11
}

错误码

错误代码 错误信息 Http状态码 说明
300.011400 集群操作请求校验失败 500 集群操作请求校验失败

集群缩容

集群缩容

URI

POST /hdinsight/v1/open-insights/remove-node

请求头

Content-Type:application/json

请求参数

名称 位置 类型 是否必须 默认值 描述
orderType body String 订单类型
id body Long 集群ID
instanceId body String 实例ID
nodeInstanceIds body Set 删除的节点ID

返回参数

名称 位置 类型 描述
name body String 集群名称
userId body String 用户ID
creatorName body String 用户名称
orderType body String 订单类型
createdTime body Data 订单创建时间
result body String 订单创建结果
message body String 通知信息
id body Long 集群ID

示例

请求示例

{
    "orderType": "changeConfigure",
    "id": 40,
    "instanceId": "83e9fab2-86a2-4c0a-bd90-b4e5a933168d",
    "nodeInstanceIds":["a0e9f96b-eecf-4021-84bc-eae8df0c2af4"]
}

响应示例

{
    "name": "hdinsight-20190717184737",
    "userId": "7b4f8548-7334-486c-a4d2-8d5b3a89c4a7",
    "creatorName": "usertest",
    "orderType": "changeConfigure",
    "createdTime": 1563331657041,
    "result": "success",
    "message": "Start updating the cluster",
    "id": 40
}

错误码

错误代码 错误信息 Http状态码 说明
300.011400 集群操作请求校验失败 500 集群操作请求校验失败

退订集群

退订集群

URI

DELETE /hdinsight/v1/open-insights/unsubscribe

请求头

Content-Type:application/json

请求参数

名称 位置 类型 是否必须 默认值 描述
orderType body String 订单类型
id body Long 集群ID
instanceId body String 实例ID

返回参数

名称 位置 类型 描述
name body String 集群名称
userId body String 用户ID
creatorName body String 用户名称
orderType body String 订单类型
createdTime body Data 订单创建时间
result body String 订单创建结果
message body String 通知信息
id body Long 集群ID

示例

请求示例

{
    "orderType": "unsubscribe",
    "id": 40,
    "instanceId": "83e9fab2-86a2-4c0a-bd90-b4e5a933168d"
}

响应示例

{
    "name": "hdinsight-20190718084549",
    "userId": "7b4f8548-7334-486c-a4d2-8d5b3a89c4a7",
    "creatorName": "usertest",
    "orderType": "unsubscribe",
    "createdTime": 1563381949441,
    "result": "success",
    "message": "Start unsubscribing the cluster",
    "id": 40
}

错误码

错误代码 错误信息 Http状态码 说明
300.011400 集群操作请求校验失败 500 集群操作请求校验失败