All Products
Search
Document Center

Resource Management:AssociateResourceSharePermission

Last Updated:Aug 28, 2026

Associates permissions with a resource share.

Operation description

This example associates the AliyunRSDefaultPermissionVSwitch permission with the rs-6GRmdD3X**** resource share in the cn-hangzhou region.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

ResourceShareId

string

Yes

The ID of the resource share.

rs-6GRmdD3X****

PermissionName

string

Yes

The name of the permission.

AliyunRSDefaultPermissionVSwitch

Replace

boolean

No

Whether to replace an existing permission with the specified one. Valid values:

  • false (default): does not replace an existing permission. If the resource share has no associated permissions, the system associates the specified permission with it. Each resource type in a resource share can have only one permission. If a permission already exists for the resource type, the system returns an error to prevent accidental replacement.

  • true: replaces an existing permission of the same resource type with the specified one.

false

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

111FB84A-60A9-403E-9067-E55D7EE95BD1

Examples

Success response

JSON format

{
  "RequestId": "111FB84A-60A9-403E-9067-E55D7EE95BD1"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.ResourceShareId The ResourceShareId is invalid.
400 MissingParameter.ResourceShareId You must specify ResourceShareId.
400 MissingParameter.PermissionName You must specify PermissionName.
404 EntityNotExists.Permission The resource share permission does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.