全部產品
Search
文件中心

Resource Management:AcceptResourceShareInvitation - 接受資源共用邀請

更新時間:Oct 13, 2025

資源使用者調用AcceptResourceShareInvitation接受資源共用邀請。

介面說明

使用說明

  • 只有在資來源目錄外共用資源時,才需要接受或拒絕資源共用邀請。在資來源目錄內共用資源時,系統會預設接受共用邀請,資源使用者不需要做任何操作。

  • 共用邀請的有效期間為 7 天,資源使用者需要在有效期間內完成確認。

本文將提供一個樣本,在cn-hangzhou地區,接受 ID 為i-pMnItMX19fBJ****的共用邀請。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

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

邀請狀態。取值:

  • Pending:等待確認。

  • Accepted:接受邀請成功。

  • Cancelled:已取消。

  • Rejected:已拒絕。

  • Expired:已到期。

  • AcceptFailed:接受邀請失敗。

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:資源不可以共用。

  • LimitExceeded:資源可共用帳號配額超限。

  • ZonalResourceInaccessible: 資源在此地區不可用。

  • InternalError:檢查過程伺服器內部出現錯誤。

Unavailable

FailureDescription

string

接受共用單元邀請檢查失敗時的詳細原因描述。

You cannot access the specified resource at this time.

OperationType

string

操作類型。取值:

  • Associate:關聯。

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. 該邀請已被接受。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情