CreateResourceShare_资源共享_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

阿里云资源共享(Resource Sharing)支持将一个账号下的指定资源共享给一个或多个目标账号使用。更多信息,请参见资源共享概述

本文将提供一个示例,在cn-hangzhou地域,使用资源目录管理账号创建一个名为test的共享单元,将 VPC 交换机vsw-bp183p93qs667muql****共享给资源目录内的成员172050525300****

流控信息

请求速率为10/1(s)。

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
resourcesharing:CreateResourceShare
Create
全部资源
*
resourcesharing:RequestedAllowExternalTargets
resourcesharing:Target
resourcesharing:RequestedResourceType
resourcesharing:ResourceArn

请求参数

字段名称字段详情
ResourceShareNamestring

共享单元名称。展开详情

示例值:test参考取值来源:
    UpdateResourceShare
    AssociateResourceShare
    ListResourceShares
    DisassociateResourceShare
    AcceptResourceShareInvitation
    RejectResourceShareInvitation
Resourcesarray<object>

共享资源列表。

子级条数 <= 20
Targetsarray<string>

资源使用者。

示例值:172050525300****子级条数 <= 20
PermissionNamesarray<string>

共享权限名称。为空时,系统自动绑定资源类型关联的默认权限。具体信息,请参见权限库

子级条数 <= 20
AllowExternalTargetsboolean

是否允许共享给资源目录外的账号。取值:展开详情

示例值:false
ResourceGroupIdstring

资源组 ID。

示例值:rg-aekz5nlvlak****参考取值来源:
    ListResourceShares
TargetPropertiesarray<object>

资源使用者属性。展开详情

Tagarray<object>

标签列表。最多可以绑定 20 个标签。

子级条数 <= 20

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:2C3FA051-61DC-4F3E-81E9-E4830524DF4B
ResourceShareobject

共享单元信息。

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidParameter.ResourceShareName
The ResourceShareName is invalid.诊断
400
InvalidParameter.ResourceShareName.Length
The maximum length of ResourceShareName exceeds 50 characters.诊断
400
InvalidParameter.Resources
The Resources is invalid.诊断
400
InvalidParameter.Resources.Duplicate
The Resources contains duplicate values.诊断
400
InvalidParameter.Resources.Length
The maximum number of Resources exceeds 5.诊断
400
InvalidParameter.Targets
The Targets is invalid.诊断
400
InvalidParameter.Targets.Duplicate
The Targets contains duplicate values.诊断
400
InvalidParameter.Targets.Length
The maximum number of Targets exceeds 5.诊断
400
InvalidTarget
The shared target does not exist in the resource directory.诊断
400
InvalidParameter
The specified parameter is invalid.诊断
400
MissingParameter.ResourceShareName
You must specify ResourceShareName.诊断
400
InvalidParameter.ResourceType
The ResourceType is invalid.诊断
400
InvalidParameter.PermissionNames.Duplicate
The PermissionNames duplicate values.诊断
400
InvalidParameter.PermissionNames.Length
The maximum length of PermissionNames exceeds quota limit.诊断
400
InvalidParameter.TargetProperties
The TargetProperties is invalid.诊断
400
InvalidParameter.TargetProperties.Duplicate
The TargetProperties contains duplicate values.诊断
400
InvalidParameter.TargetProperties.Length
The TargetProperties beyond the length limit.诊断
404
EntityNotExists.Permission
The resource share permission does not exist.诊断
409
NotEnableSharingWithResourceDirectory
You have not enabled sharing with your Resource Directory.诊断
409
AccountNotInResourceDirectory
The account is not a master or a member of a resource directory.诊断
409
QuotaExceeded.ResourceShare.Count
The maximum number of ResourceShare exceeds the limit.诊断
409
EntityAlreadyExists.ResourceShare
The specified resource share ID already exists.诊断
409
QuotaExceeded.SharedResource.Count
The maximum number of shared resources per account exceeds the limit.诊断
409
ShareWithYourself
You cannot share resources with yourself.诊断
409
NotManagementAccount
Only the management account of the service is allowed to share such resources.诊断
409
QuotaExceeded.PendingInvitations
The maximum number of pending invitations exceeds the limit.诊断
409
InvalidTarget.LegalEntityMismatch
The target account does not have the same legal entity as the resource owner account.诊断
409
ExternalTargetsNotAllowed.ResourceType
The resource share includes resource types that cannot be shared with accounts outside the resource directory.诊断
409
InvalidTarget.SiteMismatch
Cross-site resource sharing is not supported.诊断
409
NotSupport.Service.ExistInOtherResourceShare
The resource type has been shared to the target service through other resourceShare. Please share it in the same resourceShare.诊断
409
NotSupport.Service.AssociateConflict
The same resource cannot be shared repeatedly to the target service.诊断

变更历史

变更时间变更内容概要操作
2024-11-18
新增请求参数ResourceGroupId
新增请求参数Tag
2024-01-23
新增请求参数TargetProperties
2024-01-03
变更错误码400
变更错误码409
2023-04-07
变更错误码409
  • 1
  • 2
  • 10 条/页

相关示例