資源使用者調用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. | 該邀請已被接受。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。