ListHostGroups - 获取主机组列表

更新时间:
复制 MD 格式

可以获取主机组列表。

调试

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

调试

授权信息

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

请求语法

GET /organization/{organizationId}/hostGroups HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

organizationId

string

是

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

5ebbc0228123212b59xxxxx

请求参数

名称

类型

必填

描述

示例值

ids

string

否

主机组 id,多个逗号分割

121,1212121232

createStartTime

integer

否

主机组创建时间,使用 Unix 时间戳,单位为毫秒。

1586863220000

createEndTime

integer

否

主机组结束时间,使用 Unix 时间戳,单位为毫秒。

1586863220000

name

string

否

主机组名称

主机组

creatorAccountIds

string

否

创建阿里云账号 id,多个逗号分割

1112122121,3223332

nextToken

string

否

分页 token

221212221

maxResults

integer

否

结果返回个数

30

pageSort

string

否

排序条件 ID

ID

pageOrder

string

否

排序顺序 DESC 降序 ASC 升序

DESC

返回参数

名称

类型

描述

示例值

object

requestId

string

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

ASSDS-ASSASX-XSAXSA-XSAXSAXS

errorMessage

string

错误信息

""

errorCode

string

错误码

""

success

boolean

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

true

hostGroups

array<object>

主机组

object

creatorAccountId

string

创建人阿里云账号 id

2222222222222

updateTime

integer

更新时间,使用 Unix 时间戳,单位为毫秒。

1586863220000

hostNum

integer

主机个数

3

modifierAccountId

string

修改人阿里云账号 id

211111111

description

string

描述

主机组

type

string

类型

ECS

createTime

integer

主机时间,使用 Unix 时间戳,单位为毫秒。

1586863220000

ecsType

string

主机类型

ECS_ALIYUN

aliyunRegion

string

阿里云区域

cn-beijing

ecsLabelKey

string

ecs 标签 Key

ecs

name

string

部署组名称

部署组

id

integer

部署组 Id

444xxxx

serviceConnectionId

integer

服务连接 Id

1212122

ecsLabelValue

string

Ecs 标签值

value

totalCount

integer

总数

50

nextToken

string

分页 token,空表示最后一页

asassasassa

示例

正常返回示例

JSON格式

{
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "errorMessage": "\"\"",
  "errorCode": "\"\"",
  "success": true,
  "hostGroups": [
    {
      "creatorAccountId": "2222222222222",
      "updateTime": 1586863220000,
      "hostNum": 3,
      "modifierAccountId": "211111111",
      "description": "主机组",
      "type": "ECS",
      "createTime": 1586863220000,
      "ecsType": "ECS_ALIYUN",
      "aliyunRegion": "cn-beijing",
      "ecsLabelKey": "ecs",
      "name": "部署组",
      "id": 0,
      "serviceConnectionId": 1212122,
      "ecsLabelValue": "value"
    }
  ],
  "totalCount": 50,
  "nextToken": "asassasassa"
}

错误码

HTTP status code

错误码

错误信息

描述

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

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

变更历史

更多信息,参考变更详情。