All Products
Search
Document Center

Resource Management:UpdateResourceShare

Last Updated:Nov 19, 2024

Modifies the information of a resource share.

Operation description

You can call this API operation to change the name or resource sharing scope of a resource share.

This topic provides an example on how to call the API operation to change the name of the resource share rs-qSkW1HBY**** in the cn-hangzhou region from test to new.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
resourcesharing:UpdateResourceShareupdate
*All Resources
*
  • resourcesharing:RequestedAllowExternalTargets
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceShareIdstringYes

The ID of the resource share.

rs-qSkW1HBY****
ResourceShareNamestringYes

The new name of the resource share.

The name must be 1 to 50 characters in length.

The name can contain letters, digits, periods (.), underscores (_), and hyphens (-).

new
AllowExternalTargetsbooleanNo

Specifies whether resources in the resource share can be shared with accounts outside the resource directory. Valid values:

  • false: Resources in the resource share can be shared only with accounts in the resource directory.
  • true: Resources in the resource share can be shared with both accounts in the resource directory and accounts outside the resource directory.
false

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

2860A3A4-D8C1-4EF4-954E-84A3945E26E5
ResourceShareobject

The information of the resource share.

UpdateTimestring

The time when the resource share was updated.

2020-12-04T08:55:25.382Z
ResourceShareNamestring

The name of the resource share.

new
ResourceShareOwnerstring

The owner of the resource share.

151266687691****
CreateTimestring

The time when the resource share was created.

2020-12-03T08:02:22.413Z
ResourceShareIdstring

The ID of the resource share.

rs-qSkW1HBY****
ResourceShareStatusstring

The status of the resource share. Valid values:

  • Active: The resource share is enabled.
  • Pending: The resource share is associated with one or more resource sharing invitations that are waiting for confirmation.
  • Deleting: The resource share is being deleted.
  • Deleted: The resource share is deleted.
Note The system deletes the records of resource shares in the Deleted state within 48 hours to 96 hours after you delete the resource shares.
Active
AllowExternalTargetsboolean

Indicates whether resources in the resource share can be shared with accounts outside the resource directory. Valid values:

  • false: Resources in the resource share can be shared only with accounts in the resource directory.
  • true: Resources in the resource share can be shared with both accounts in the resource directory and accounts outside the resource directory.
false

Examples

Sample success responses

JSONformat

{
  "RequestId": "2860A3A4-D8C1-4EF4-954E-84A3945E26E5",
  "ResourceShare": {
    "UpdateTime": "2020-12-04T08:55:25.382Z",
    "ResourceShareName": "new",
    "ResourceShareOwner": "151266687691****",
    "CreateTime": "2020-12-03T08:02:22.413Z",
    "ResourceShareId": "rs-qSkW1HBY****",
    "ResourceShareStatus": "Active",
    "AllowExternalTargets": false
  }
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter.ResourceShareIdYou must specify ResourceShareId.You must specify ResourceShareId.
400InvalidParameter.ResourceShareIdThe ResourceShareId is invalid.The ResourceShareId parameter is invalid.
400MissingParameter.ResourceShareNameYou must specify ResourceShareName.The ResourceShareName parameter is missing.
400InvalidParameter.ResourceShareNameThe ResourceShareName is invalid.The ResourceShareName parameter is invalid.
400InvalidParameter.ResourceShareName.LengthThe maximum length of ResourceShareName exceeds 50 characters.The length of ResourceShareName cannot exceed 50 characters.
400InvalidParameterThe specified parameter is invalid.The specified parameter is invalid.
404EntityNotExists.ResourceShareThe resource share does not exist in the current account.The resource share does not exist in the current account.
409OperationNotPermittedYou do not have permission to do this operation.You are not authorized to perform this operation.
409ResourceShareStatusMismatchActionThe status of the resource share does not allow the specified operation.The status of the resource share does not allow the specified operation.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-24The Error code has changedView Change Details
2023-03-02API Description Update. The Error code has changedView Change Details