资源使用者调用AcceptResourceShareInvitation接受资源共享邀请。
接口说明
使用说明
- 只有在资源目录外共享资源时,才需要接受或拒绝资源共享邀请。在资源目录内共享资源时,系统会默认接受共享邀请,资源使用者不需要做任何操作。 
- 共享邀请的有效期为 7 天,资源使用者需要在有效期内完成确认。 
本文将提供一个示例,在cn-hangzhou地域,接受 ID 为i-pMnItMX19fBJ****的共享邀请。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
 调试
        
            调试
        
    
授权信息
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
| resourcesharing:AcceptResourceShareInvitation | update | *全部资源 
 | 无 | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
| ResourceShareInvitationId | string | 是 | 资源共享邀请 ID。 您可以调用 ListResourceShareInvitations 获取资源共享邀请 ID。 | i-pMnItMX19fBJ**** | 
关于公共请求参数的详情,请参见公共参数。
返回参数
| 名称 | 类型 | 描述 | 示例值 | 
| object | 返回结果。 | ||
| RequestId | string | 请求 ID。 | 08F18B04-47CB-5C0E-A6D2-37DEF5C2A961 | 
| ResourceShareInvitation | object | 资源共享邀请信息。 | |
| ResourceShareInvitationId | string | 资源共享邀请 ID。 | i-pMnItMX19fBJ**** | 
| ResourceShareId | string | 共享单元 ID。 | rs-ysGRci9z**** | 
| ResourceShareName | string | 共享单元名称。 | example | 
| SenderAccountId | string | 邀请者的阿里云账号 ID。 | 151266687691**** | 
| ReceiverAccountId | string | 被邀请者的阿里云账号 ID。 | 134254031178**** | 
| CreateTime | string | 邀请创建时间(UTC 时间)。 | 2022-09-02T06:43:12.353Z | 
| Status | string | 邀请状态。取值: 
 | AcceptFailed | 
| AcceptInvitationFailedDetails | array<object> | 接受共享单元邀请检查失败详细原因。 | |
| object | 接受共享单元邀请检查失败详细原因。 | ||
| Status | string | 已弃用。请使用 FailureReason。 | None | 
| StatusMessage | string | 已弃用。请使用 FailureDescription。 | None | 
| AssociateType | string | 已弃用。请使用 OperationType。 | None | 
| ResourceArn | string | 共享资源 ARN。 | acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** | 
| ResourceType | string | 共享资源类型。 支持共享的资源类型,请参见支持资源共享的云服务。 | Snapshot | 
| FailureReason | string | 接受共享单元邀请检查失败时的原因。取值: 
 | Unavailable | 
| FailureDescription | string | 接受共享单元邀请检查失败时的详细原因描述。 | You cannot access the specified resource at this time. | 
| OperationType | string | 操作类型。取值: 
 | Associate | 
| ResourceId | string | 共享资源 ID。 | s-7xvh46nx5oqlre0wv*** | 
示例
正常返回示例
JSON格式
{
  "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***"
      }
    ]
  }
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | InvalidParameter.ResourceShareInvitationId | The ResourceShareInvitationId is invalid. | 资源共享邀请ID无效。 | 
| 400 | MissingParameter.ResourceShareInvitationId | You must specify ResourceShareInvitationId. | 需指定共享单元邀请ID。 | 
| 409 | InvitationStatus.Expired | The resource share invitation status is expired. | 该邀请已过期。 | 
| 409 | EntityNotExists.ResourceShareInvitation | The resource share invitation does not exist in the current account. | 该邀请已不存在。 | 
| 409 | InvitationStatus.AlreadyRejected | The resource share invitation status is rejected. | 该邀请已被拒绝。 | 
| 409 | InvitationStatus.AlreadyAccepted | The resource share invitation status is alredy accepted. | 该邀请已被接受。 | 
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。