可以创建主机组。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
POST /organization/{organizationId}/hostGroups
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| organizationId | string | 是 | 企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 | 5ebbc0228123212b59xxxxx |
| type | string | 是 | 主机组类型,暂只支持 ECS | ECS |
| envId | string | 否 | 环境 id | 0 |
| name | string | 是 | 主机组名称 | 主机组 |
| serviceConnectionId | long | 是 | 服务连接 id | 123 |
| tagIds | string | 否 | 标签 id,多个逗号分割 | 12,234 |
| ecsType | string | 否 | ECS 类型,暂支持 ECS_ALIYUN | ECS_ALIYUN |
| ecsLabelKey | string | 否 | ecs 标签 key | ecs |
| ecsLabelValue | string | 否 | ecs 标签 value | ecs |
| aliyunRegion | string | 否 | 阿里云 region | cn-beijing |
| machineInfos | string | 否 | aliyunRegionId 机器所在 aliyun region,machineSn 机器的 sn, instanceName,主机名,ip 主机 ip | [{"aliyunRegionId":"cn-beijing","machineSn":"i-sssssss","instanceName":"ceshi","ip":"120.0.0.0"}] |
返回参数
示例
正常返回示例
JSON格式
{
"requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"errorMessage": "\"\"",
"errorCode": "\"\"",
"success": true,
"hostGroupId": 123
}错误码
| 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是否正确 |
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 |
|---|
暂无变更历史
