You need to enable JavaScript to run this app.
导航
AssociateResourceShare - 创建共享单元分享实体
最近更新时间:2025.03.03 16:21:37首次发布时间:2025.03.03 16:21:37
我的收藏
有用
有用
无用
无用

创建共享单元分享实体,实体可以是资源、主体

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

AssociateResourceShare

要执行的操作,取值:AssociateResourceShare。

Version
String

2024-01-01

API的版本,取值:2024-01-01。

ResourceShareTrn
String

trn:resource_share:cn-beijing:2000000000:resource_share/rs-03***119c96

共享单元Trn

Principals
Array of String

2000000001,trn:organization::2000000000:organization/74399781619,trn:organization::2000000000:ou/74734524402

需要关联的Principals列表(principal是指被共享方,用户、组织或者组织单元)

ResourceTrns
Array of String

trn:vpc:cn-beijing:2000000000:subnet/subnet-rr10x57crloqp,trn:vpc:cn-beijing:2000000000:subnet/subnet-rr1qjdqi38j

需要关联的资源列表

返回参数

本接口无特有的返回参数。更多信息请见返回结构

请求示例

GET /?Action=AssociateResourceShare&Version=2024-01-01&ResourceShareTrn=resource_share:cn-beijing:2000000000:resource_share/rs-0***686400f&ResourceTrns=trn:vpc:cn-beijing:2000000000:subnet/subne****kv0x57crloqp&Principals=2000000001 HTTP/1.1
Host: x.y.z
X-Date: 20250225T035619Z
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250225/cn-beijing/resource_share/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

返回示例

{
  "ResponseMetadata": {
    "RequestId": "202502251158441611491731483A3CDC",
    "Action": "AssociateResourceShare",
    "Version": "2024-01-01",
    "Service": "resource_share",
    "Region": "cn-beijing"
  },
  "Result": {}
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MalformedPrincipal

principal[%v] is malformed

非法的Principal参数(principal是指被共享方,用户、组织或者组织单元)

400
InvalidParameter

Parameter [%s] is invalid, error: %v

无效的参数,具体无效的参数在会在Error Message中给出

400
ShareResourceQuotaExceeded

the quota of resource association has been exceeded

共享单元关联的资源数量超出quota限制

400
SharePrincipalQuotaExceeded

the quota of principal association has been exceeded

共享单元关联的Principal数量超出quota限制(principal是指被共享方,用户、组织或者组织单元)

400
InvalidResourceShare

the status of resource-share[%v] is not ACTIVE

无效的共享单元,共享单元不存在或已被删除

400
NoAvailablePermission

no available permission for resource-type[%v], please create a permission first

当前资源未绑定任何权限策略,请联系相关管理员进行处理

400
RegionNotSupport

the region is not support

不支持的region

400
InvalidResourceType

resource-type[%v] is not supported to be shared

资源类型不支持被共享

400
MissingParameter

Required parameter[%v] is not found

参数缺失,具体缺失的参数在会在Error Message中给出

400
MalformedResourceTrn

resource trn[%v] is malformed

非法的ResourceTrn参数

400
RegionConflict

resource[%v] and resource-share[%v] is not in the same region

资源与共享单元的Region不一致

400
DuplicatedInvitation

invitation for principal[%v] already exist in resource-share[%v]

共享邀请已存在

400
DuplicatedPermissionAssociation

permission[%v] already associated in resource-share[%v]

共享单元权限策略已关联

400
DuplicatedAssociation

association entity[%v] already exist in resource-share[%v]

实体关联关系已存在

400
ShareInvitationQuotaExceeded

the quota of invitaiton has been exceeded

共享邀请数量超出quota限制

400
ResourceShareExternalNotSupport

resource[%v] is not supported to be shared with external account[%v]

由于系统设定,对应的资源不支持共享给外部账号

400
PrincipalConflict

principal[%v] has already been shared in resource-share[%v]

principal已被关联(principal是指被共享方,用户、组织或者组织单元)

400
ResourceConflict

resource[%v] has already been shared in resource-share[%v]

资源已被共享

400
ShareWithoutOrganization

you are not in any organization so you cannot share resources with [%v]

当前账号不在任何组织,无法发起组织类型的共享

400
InvalidOrganizationUnit

organization unit[%v] is invalid

无效的组织单元,传入的是一个不存在的组织单元

400
InvalidOrganization

organization[%v] is invalid

无效的组织,传入的是一个不存在的组织

400
ShareExternalConflict

external account[%v] is not allowed to be shared in resource-share[%v]

共享单元设置了仅组织内部共享,因此不允许共享给外部账号

400
ShareSelfNotSupport

you cannot share resource to yourself

不支持将资源共享自己

404
ResourceNotFound

resource[%v] not found

找不到资源,资源Trn对应的账号与当前共享发起者对应不上,简而言之,共享发起者找不到对应资源

404
ResourceShareNotFound

resource-share[%v] not found

找不到共享单元,传入的共享单元Trn不存在,或已被删除

404
PermissionNotFound

permission of resource-type[%v] not found, need to associate a permission for the resource-type first

找不到对应的权限策略,请确认传入的策略Trn是否正确

500
InternalError

Something went wrong in internal service, please try again later

服务内部系统错误,往往是由服务内部组件异常、网络异常或服务自身bug导致,请及时联系相关管理员进行排查确认