All Products
Search
Document Center

Resource Management:ListResourceShareInvitations

Last Updated:Nov 19, 2024

Queries the resource sharing invitations that are received.

Operation description

This topic provides an example on how to call the API operation to query the resource sharing invitations that are received by the current account in the cn-hangzhou region. The response shows that one invitation is received by the current account and is waiting for confirmation.

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:ListResourceShareInvitationslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MaxResultsintegerNo

The maximum number of entries to return for a single request.

Valid values: 1 to 100. Default value: 20.

20
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

TGlzdFJlc291cm****
ResourceShareIdsarrayNo

The IDs of the resource shares.

stringNo

The ID of the resource share.

rs-ysGRci9z****
ResourceShareInvitationIdsarrayNo

The IDs of the resource sharing invitations.

stringNo

The ID of the resource sharing invitation.

i-p6eRytrkjVvM****

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

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

NextTokenstring

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

TGlzdFJlc291cm****
RequestIdstring

The request ID.

30EC8328-1BDE-51D5-BFAB-039508BD91A1
ResourceShareInvitationsarray<object>

The information about the resource sharing invitations.

ResourceShareInvitationobject

The information about the resource sharing invitations.

Statusstring

The status of the invitation. Valid values:

  • Pending
  • Accepted
  • Cancelled
  • Rejected
  • Expired
  • AcceptFailed
Pending
CreateTimestring

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

2022-08-18T05:36:45.024Z
ResourceShareIdstring

The ID of the resource share.

rs-ysGRci9z****
ResourceShareNamestring

The name of the resource share.

example
SenderAccountIdstring

The Alibaba Cloud account ID of the inviter.

151266687691****
ReceiverAccountIdstring

The Alibaba Cloud account ID of the invitee.

134254031178****
ResourceShareInvitationIdstring

The ID of the invitation.

i-p6eRytrkjVvM****
InvitationFailedDetailsarray<object>

The information about the failure.

InvitationFailedDetailobject

The information about the failure.

Statusstring

This parameter is deprecated. The FailureReason parameter is used instead.

Unavailable
StatusMessagestring

This parameter is deprecated. The FailureDescription parameter is used instead.

You cannot access the specified resource at this time.
AssociateTypestring

This parameter is deprecated. The OperationType parameter is used instead.

Associate
ResourceIdstring

The ID of the shared resource.

s-7xvh46nx5oqlre0wv***
ResourceTypestring

The type of the shared resource.

For more information about the types of resources that can be shared, see Services that work with Resource Sharing.

Snapshot
FailureReasonstring

The failure cause. Valid values:

  • Unavailable: The resource cannot be shared.
  • LimitExceeded: The number of shared resources within the Alibaba Cloud account exceeds the upper limit.
  • ZonalResourceInaccessible: The resource is unavailable in this region.
  • InternalError: An internal error occurred during the check.
  • UnsupportedOperation: You cannot perform this operation.
Unavailable
FailureDescriptionstring

The failure description.

You cannot access the specified resource at this time.
OperationTypestring

The operation type. Valid values:

  • Associate
  • Disassociate
Associate

Examples

Sample success responses

JSONformat

{
  "NextToken": "TGlzdFJlc291cm****",
  "RequestId": "30EC8328-1BDE-51D5-BFAB-039508BD91A1",
  "ResourceShareInvitations": [
    {
      "Status": "Pending",
      "CreateTime": "2022-08-18T05:36:45.024Z",
      "ResourceShareId": "rs-ysGRci9z****",
      "ResourceShareName": "example",
      "SenderAccountId": "151266687691****",
      "ReceiverAccountId": "134254031178****",
      "ResourceShareInvitationId": "i-p6eRytrkjVvM****",
      "InvitationFailedDetails": [
        {
          "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 codeError codeError messageDescription
400InvalidParameter.MaxResultsThe MaxResults is invalid.The MaxResults parameter is invalid.
400InvalidParameter.NextTokenThe NextToken is invalid.The NextToken parameter is invalid.
400InvalidParameter.NextToken.LengthThe maximum length of NextToken exceeds 256 characters.The length of NextToken cannot exceed 256 characters.
400InvalidParameter.ResourceShareIdsThe ResourceShareIds is invalid.The ResourceShareIds parameter is invalid.
400InvalidParameter.ResourceShareIds.DuplicateThe ResourceShareIds contains duplicate values.The ResourceShareIds parameter contains duplicate values.
400InvalidParameter.ResourceShareIds.LengthThe maximum length of ResourceShareIds exceeds 5 characters.The number of ResourceShareIds values cannot exceed 5.
400InvalidParameter.ResourceShareInvitationIdsThe ResourceShareInvitationIds is invalid.The value of ResourceShareInvitationIds is invalid.
400InvalidParameter.ResourceShareInvitationIds.DuplicateThe ResourceShareInvitationIds duplicate values.ResourceShareInvitationIds is already configured.
400InvalidParameter.ResourceShareInvitationIds.LengthThe maximum length of ResourceShareInvitationIds exceeds quota limit.The length of the value specified for ResourceShareInvitationIds exceeds the limit.

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

Change history

Change timeSummary of changesOperation
2024-02-04The Error code has changed. The response structure of the API has changedView Change Details
2023-12-25The Error code has changed. The response structure of the API has changedView Change Details