文档

GetHostGroup - 获取主机组

可以获取主机组。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

GET /organization/{organizationId}/hostGroups/{id}

请求参数

名称类型必填描述示例值
organizationIdstring

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https:// devops.aliyun.com/organization/【OrgId】

5ebbc0228123212b59xxxxx
idlong

主机组 id

21221

返回参数

名称类型描述示例值
object
requestIdstring

请求 id,每次请求都是唯一值,便于后续排查问题

ASSDS-ASSASX-XSAXSA-XSAXSAXS
errorMessagestring

错误信息

""
errorCodestring

错误码

""
successboolean

true 接口调用成功,false 接口调用失败

true
hostGroupobject

主机组

creatorAccountIdstring

创建者阿里云账号 id

111111
upateTImelong

更新时间

1586863220000
hostNumlong

主机数

1
modifierAccountIdstring

修改者阿里云账号 id

11111
descriptionstring

主机组描述

主机组描述
typestring

主机组类型

ECS
createTimelong

创建时间

1586863220000
ecsTypestring

ecs 类型,暂只支持 ECS_ALIYUN

ECS_ALIYUN
aliyunRegionstring

阿里云区域

cn-bejing
ecsLabelKeystring

ecs 标签 Key

ecs
idlong

主机组 id

1234
namestring

主机组名称

主机组名称
serviceConnectionIdlong

服务连接 id

1234
hostInfosobject []

主机信息

updateTimelong

更新时间

1586863220000
creatorAccountIdstring

创建者阿里云账号

11111
instanceNamestring

主机名

ceshi
modifierAccountIdstring

修改者阿里云账号

11111111111
ipstring

机器 ip

127.0.0.1
createTimelong

创建时间

1586863220000
objectTypestring

MachineInfo 值固定为 MachineInfo

MachineInfo
aliyunRegionIdstring

阿里云区域

cn-hangzhou
machineSnstring

机器 sn

1ssasa
ecsLabelValuestring

ecs 标签 value

ecs

示例

正常返回示例

JSON格式

{
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "errorMessage": "\"\"",
  "errorCode": "\"\"",
  "success": true,
  "hostGroup": {
    "creatorAccountId": "111111",
    "upateTIme": 1586863220000,
    "hostNum": 1,
    "modifierAccountId": "11111",
    "description": "主机组描述",
    "type": "ECS",
    "createTime": 1586863220000,
    "ecsType": "ECS_ALIYUN",
    "aliyunRegion": "cn-bejing",
    "ecsLabelKey": "ecs",
    "id": 1234,
    "name": "主机组名称",
    "serviceConnectionId": 1234,
    "hostInfos": [
      {
        "updateTime": 1586863220000,
        "creatorAccountId": "11111",
        "instanceName": "ceshi",
        "modifierAccountId": "11111111111",
        "ip": "127.0.0.1",
        "createTime": 1586863220000,
        "objectType": "MachineInfo",
        "aliyunRegionId": "cn-hangzhou",
        "machineSn": "1ssasa"
      }
    ],
    "ecsLabelValue": "ecs"
  }
}

错误码

HTTP status code错误码错误信息描述
400InvalidParam.ParamNotPresentThe parameter is invalid.参数有误,请检查参数
400InvalidUser.NotFoundThe user that is invoking the API service is not a registered user.调用 API 的用户,未注册为云效用户
403Forbidden.UserNotInCurrentOrganizationThe user is not in the organization and is not authorized to perform the operation.当前用户不在该企业中,无权进行操作。
404InvalidOrganization.NotFoundThe organization is not found.企业不存在,请检查企业ID是否正确

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)
文档反馈