AcceptResourceShareInvitation

Updated at:

Accepts a resource sharing invitation.

Operation description

Usage notes

  • You only need to accept or reject a resource sharing invitation when resources are shared outside a resource directory. When resources are shared within a resource directory, the system automatically accepts the sharing invitation, and the resource user does not need to perform any operations.

  • A sharing invitation is valid for 7 days. The resource user must confirm the invitation within the validity period.

This topic provides an example on how to accept a sharing invitation whose ID is i-pMnItMX19fBJ**** 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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

resourcesharing:AcceptResourceShareInvitation

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceShareInvitationId

string

Yes

The ID of the resource sharing invitation.

You can call ListResourceShareInvitations to obtain the ID of the resource sharing invitation.

i-pMnItMX19fBJ****

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

Response elements

Element

Type

Description

Example

object

The returned result.

RequestId

string

The ID of the request.

08F18B04-47CB-5C0E-A6D2-37DEF5C2A961

ResourceShareInvitation

object

The information about the resource sharing invitation.

ResourceShareInvitationId

string

The ID of the resource sharing invitation.

i-pMnItMX19fBJ****

ResourceShareId

string

The ID of the resource share.

rs-ysGRci9z****

ResourceShareName

string

The name of the resource share.

example

SenderAccountId

string

The Alibaba Cloud account ID of the inviter.

151266687691****

ReceiverAccountId

string

The Alibaba Cloud account ID of the invitee.

134254031178****

CreateTime

string

The time when the invitation was created. The time is displayed in UTC.

2022-09-02T06:43:12.353Z

Status

string

The status of the invitation. Valid values:

  • Pending: The invitation is pending confirmation.

  • Accepted: The invitation is accepted.

  • Cancelled: The invitation is canceled.

  • Rejected: The invitation is rejected.

  • Expired: The invitation has expired.

  • AcceptFailed: The invitation failed to be accepted.

AcceptFailed

AcceptInvitationFailedDetails

array<object>

The detailed reasons why the check for accepting the resource share invitation failed.

object

The detailed reasons why the check for accepting the resource share invitation failed.

Status

string

[Deprecated] Use FailureReason instead.

None

StatusMessage

string

[Deprecated] Use FailureDescription instead.

None

AssociateType

string

[Deprecated] Use OperationType instead.

None

ResourceArn

string

The ARN of the shared resource.

acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****

ResourceType

string

The type of the shared resource.

For more information about the types of resources that can be shared, see Cloud services that support resource sharing.

Snapshot

FailureReason

string

The reason why the check for accepting the resource share invitation failed. Valid values:

  • Unavailable: The resource cannot be shared.

  • LimitExceeded: The quota of accounts with which the resource can be shared is exceeded.

  • ZonalResourceInaccessible: The resource is unavailable in this region.

  • InternalError: An internal server error occurred during the check.

Unavailable

FailureDescription

string

The detailed description of the reason why the check for accepting the resource share invitation failed.

You cannot access the specified resource at this time.

OperationType

string

The operation type. Valid values:

  • Associate: Associate.

Associate

ResourceId

string

The ID of the shared resource.

s-7xvh46nx5oqlre0wv***

Examples

Success response

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": "None",
        "StatusMessage": "None",
        "AssociateType": "None",
        "ResourceArn": "acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****",
        "ResourceType": "Snapshot",
        "FailureReason": "Unavailable",
        "FailureDescription": "You cannot access the specified resource at this time.",
        "OperationType": "Associate",
        "ResourceId": "s-7xvh46nx5oqlre0wv***"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.ResourceShareInvitationId The ResourceShareInvitationId is invalid. The invitation ID is invalid.
400 MissingParameter.ResourceShareInvitationId You must specify ResourceShareInvitationId. You must specify an invitation ID.
409 InvitationStatus.Expired The resource share invitation status is expired. The invitation has expired.
409 EntityNotExists.ResourceShareInvitation The resource share invitation does not exist in the current account. The invitation does not exist.
409 InvitationStatus.AlreadyRejected The resource share invitation status is rejected. The invitation has been rejected.
409 InvitationStatus.AlreadyAccepted The resource share invitation status is alredy accepted. The invitation has been accepted.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.