Accepts a resource sharing invitation.
Operation description
- A principal needs to accept or reject a resource sharing invitation only if the principal is not the management account or a member of a resource directory. If you share resources with an object in a resource directory, the system automatically accepts the resource sharing invitation for the object.
- A resource sharing invitation is valid for seven days. A principal must accept or reject the invitation within the validity period.
This topic provides an example on how to call the API operation to accept the resource sharing invitation whose ID is i-pMnItMX19fBJ****
in the cn-hangzhou
region.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
*All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ResourceShareInvitationId | string | Yes | The ID of the resource sharing invitation. You can call the ListResourceShareInvitations operation to obtain the ID. | i-pMnItMX19fBJ**** |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "08F18B04-47CB-5C0E-A6D2-37DEF5C2A961",
"ResourceShareInvitation": {
"ResourceShareInvitationId": "i-pMnItMX19fBJ****",
"ResourceShareId": "rs-ysGRci9z****",
"ResourceShareName": "example",
"SenderAccountId": "151266687691****",
"ReceiverAccountId": "134254031178****",
"CreateTime": "2022-09-02T06:43:12.353Z",
"Status": "AcceptFailed",
"AcceptInvitationFailedDetails": [
{
"Status": "Unavailable",
"StatusMessage": "You cannot access the specified resource at this time.",
"AssociateType": "Associate",
"ResourceId": "s-7xvh46nx5oqlre0wv***",
"ResourceType": "Snapshot",
"FailureReason": "Unavailable",
"FailureDescription": "You cannot access the specified resource at this time.",
"OperationType": "Associate"
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
The invitation ID is invalid. | |||
You must specify an invitation ID. | |||
The invitation has expired. | |||
The invitation does not exist. | |||
The invitation has been rejected. | |||
The invitation has been accepted. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
View Change Details | ||
View Change Details |