调用JoinResourceGroup将一个ECS资源或者服务加入一个资源组。
接口说明
资源是您在阿里云创建的云服务实体,例如,一台 ECS 实例、一个 ECS 弹性网卡或者一份 ECS 镜像等都可以是资源。资源组是项目、环境或者栈的基础设施集合,在资源组里管理资源能集中监控和执行任务,免去了您在多种阿里云服务间反复查看的负担。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ResourceType | string | 否 | ECS 资源的类型。取值范围:
以上参数取值均大小写敏感。 | securitygroup |
ResourceId | string | 否 | 资源类型的 ID 标识符。例如,当 ResourceType=instance 时,则 ResourceId 可以理解为 InstanceId。 | sg-bp67acfmxazb4p**** |
RegionId | string | 否 | 资源所在的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。 | cn-hangzhou |
ResourceGroupId | string | 否 | 目标资源组 ID。 | rg-bp67acfmxazb4p**** |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | EntityExists.AssociatedTransferTasks | An associated transfer task is in progress. Try again later. | 当前存在未完成的关联转组任务,请稍后重试 |
403 | MissingParameter | The input parameter "ResourceId" that is mandatory for processing this request is not supplied. | - |
403 | MissingParameter | The input parameter "ResourceGroupId" that is mandatory for processing this request is not supplied. | - |
403 | MissingParameter | The input parameter "RegionId" that is mandatory for processing this request is not supplied. | - |
403 | InvalidResourceGroup.Duplicate | The ResourceId provided has a ResourceGroup in our records. | 该资源已加入到其它资源组。 |
403 | InvalidRegionId.ResourceGroup | The specified region does not support resource group yet. | - |
403 | InvalidStatus.ResourceGroup | You cannot perform an operation on a resource group that is being created or deleted. | 资源组正在创建或删除时不允许操作。 |
404 | InvalidResourceType.NotFound | The ResourceType provided does not exist in our records. | 指定的资源类型不存在。 |
404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | 资源组并不在记录中。 |
404 | InvalidResourceId.NotFound | The ResourceId provided does not exist in our records. | 指定的资源不存在。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2023-11-20 | OpenAPI 错误码发生变更 | 查看变更详情 |
2023-05-22 | OpenAPI 错误码发生变更 | 查看变更详情 |
2023-03-17 | OpenAPI 错误码发生变更 | 查看变更详情 |