Membuat resource share.
Deskripsi operasi
Alibaba Cloud Resource Sharing memungkinkan Anda berbagi resource tertentu dari akun Anda dengan satu atau beberapa akun tujuan. Untuk informasi selengkapnya, lihat Resource Sharing overview.
Topik ini memberikan contoh penggunaan akun manajemen dari ResourceDirectory di wilayah cn-hangzhou untuk membuat resource share bernama test, yang digunakan untuk berbagi vSwitch vsw-bp183p93qs667muql**** dengan anggota 172050525300**** dari ResourceDirectory.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcesharing:CreateResourceShare |
create |
*全部资源
|
|
None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceShareName |
string |
Yes |
Nama resource share. Nama harus terdiri dari 1 hingga 50 karakter. Nama dapat berisi huruf, angka, karakter Tionghoa, titik (.), garis bawah (_), dan tanda hubung (-). |
test |
| Resources |
array<object> |
No |
Daftar resource yang dibagikan. |
|
|
object |
No |
Resource yang akan dibagikan. |
||
| ResourceId |
string |
No |
ID resource yang dibagikan. Nilai N adalah bilangan bulat dari 1 hingga 5. Anda dapat menambahkan maksimal lima resource yang dibagikan sekaligus. Catatan
Tentukan |
vsw-bp183p93qs667muql**** |
| ResourceType |
string |
No |
Jenis resource yang dibagikan. Nilai N adalah bilangan bulat dari 1 hingga 5. Anda dapat menambahkan maksimal lima resource yang dibagikan sekaligus. Untuk informasi selengkapnya tentang jenis resource yang dapat dibagikan, lihat Alibaba Cloud services that support resource sharing. Catatan
Tentukan |
VSwitch |
| Targets |
array |
No |
Pihak yang berwenang. |
172050525300**** |
|
string |
No |
Pihak yang berwenang. Nilai yang valid:
Untuk informasi selengkapnya, lihat Resource sharing methods, View the ID of a resource directory, View the ID of a folder, atau View the ID of a member. Nilai N adalah bilangan bulat dari 1 hingga 5. Anda dapat menambahkan maksimal lima pihak yang berwenang sekaligus. |
172050525300**** |
|
| ResourceArns |
array |
No |
Daftar Nama Sumber Daya Alibaba Cloud (ARN) dari resource yang dibagikan. Nilai N adalah bilangan bulat dari 1 hingga 5. Anda dapat menambahkan maksimal lima resource yang dibagikan sekaligus. |
|
|
string |
No |
ARN dari resource yang dibagikan. Catatan
Untuk informasi selengkapnya tentang format ARN, lihat Alibaba Cloud services that support resource sharing. |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
|
| PermissionNames |
array |
No |
Nama izin. Jika Anda tidak mengisi parameter ini, sistem akan secara otomatis menyambungkan izin default untuk jenis resource tersebut. Untuk informasi selengkapnya, lihat Permission library. |
|
|
string |
No |
Nama izin. Jika Anda tidak mengisi parameter ini, sistem akan secara otomatis menyambungkan izin default untuk jenis resource tersebut. Untuk informasi selengkapnya, lihat Permission library. |
AliyunRSDefaultPermissionVSwitch |
|
| AllowExternalTargets |
boolean |
No |
Menentukan apakah resource dapat dibagikan dengan akun di luar resource directory Anda. Nilai yang valid:
|
false |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya. |
rg-aekz5nlvlak**** |
| TargetProperties |
array<object> |
No |
Properti dari pihak yang berwenang. Catatan
Parameter ini hanya tersedia ketika pihak yang berwenang adalah layanan Alibaba Cloud. |
|
|
object |
No |
Properti dari pihak yang berwenang. Catatan
Parameter ini hanya tersedia ketika pihak yang berwenang adalah layanan Alibaba Cloud. |
||
| Property |
string |
No |
Properti dari pihak yang berwenang. Misalnya, Anda dapat menentukan rentang waktu untuk berbagi resource. Nilai yang valid untuk
Catatan
Tentukan |
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
| TargetId |
string |
No |
ID pihak yang berwenang. Catatan
Tentukan |
172050525300**** |
| Tag |
array<object> |
No |
||
|
object |
No |
|||
| Key |
string |
No |
|
k1 |
| Value |
string |
No |
|
v1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter respons. |
||
| RequestId |
string |
ID permintaan. |
2C3FA051-61DC-4F3E-81E9-E4830524DF4B |
| ResourceShare |
object |
Informasi tentang resource share. |
|
| AllowExternalTargets |
boolean |
Menunjukkan apakah resource dalam resource share dapat dibagikan dengan akun di luar resource directory. Nilai yang valid:
|
false |
| CreateTime |
string |
Waktu saat resource share dibuat. |
2020-12-03T08:02:22.413Z |
| ResourceShareId |
string |
ID resource share. |
rs-qSkW1HBY**** |
| ResourceShareName |
string |
Nama resource share. |
test |
| ResourceShareOwner |
string |
Pemilik resource share. |
151266687691**** |
| ResourceShareStatus |
string |
Status resource share. Nilai yang valid:
Catatan
Sistem secara otomatis menghapus resource share dalam status Deleted dalam waktu 48 hingga 96 jam. |
Active |
| UpdateTime |
string |
Waktu saat resource share diperbarui. |
2020-12-03T08:02:22.413Z |
Contoh
Respons sukses
JSONformat
{
"RequestId": "2C3FA051-61DC-4F3E-81E9-E4830524DF4B",
"ResourceShare": {
"AllowExternalTargets": false,
"CreateTime": "2020-12-03T08:02:22.413Z",
"ResourceShareId": "rs-qSkW1HBY****",
"ResourceShareName": "test",
"ResourceShareOwner": "151266687691****",
"ResourceShareStatus": "Active",
"UpdateTime": "2020-12-03T08:02:22.413Z"
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.ResourceShareName | The ResourceShareName is invalid. | |
| 400 | InvalidParameter.ResourceShareName.Length | The maximum length of ResourceShareName exceeds 50 characters. | |
| 400 | InvalidParameter.Resources | The Resources is invalid. | |
| 400 | InvalidParameter.Resources.Duplicate | The Resources contains duplicate values. | |
| 400 | InvalidParameter.Resources.Length | The maximum number of Resources exceeds 5. | |
| 400 | InvalidParameter.Targets | The Targets is invalid. | |
| 400 | InvalidParameter.Targets.Duplicate | The Targets contains duplicate values. | |
| 400 | InvalidParameter.Targets.Length | The maximum number of Targets exceeds 5. | |
| 400 | InvalidTarget | The shared target does not exist in the resource directory. | |
| 400 | InvalidParameter | The specified parameter is invalid. | |
| 400 | MissingParameter.ResourceShareName | You must specify ResourceShareName. | |
| 400 | InvalidParameter.ResourceType | The ResourceType is invalid. | |
| 400 | InvalidParameter.PermissionNames.Duplicate | The PermissionNames duplicate values. | |
| 400 | InvalidParameter.PermissionNames.Length | The maximum length of PermissionNames exceeds quota limit. | |
| 400 | InvalidParameter.TargetProperties | The TargetProperties is invalid. | |
| 400 | InvalidParameter.TargetProperties.Duplicate | The TargetProperties contains duplicate values. | |
| 400 | InvalidParameter.TargetProperties.Length | The TargetProperties beyond the length limit. | |
| 400 | InvalidParameter.ResourceArns | The ResourceArns is invalid. | |
| 400 | InvalidParameter.ResourceArns.Duplicate | The ResourceArns contains duplicate values. | |
| 400 | InvalidParameter.ResourceArns.Length | The ResourceArns beyond the length limit. | |
| 400 | InvalidParameter.ResourceConflict | Both Resources and ResourceArns cannot be specified simultaneously. Please provide only one of these parameters. | |
| 400 | NotSupport.ResourceType.ResourcesParameter | The Resources parameter does not support this resource type. Please use ResourceArns instead. | |
| 400 | InvalidParameter.ResourceProperties | The ResourceProperties is invalid. | |
| 400 | InvalidParameter.ResourceProperties.Duplicate | The ResourceProperties contains duplicate values. | |
| 400 | InvalidParameter.ResourceProperties.Length | The ResourceProperties beyond the length limit. | |
| 400 | NotSupport.ResourceProperty | The resource type does not support resource property. | |
| 404 | EntityNotExists.Permission | The resource share permission does not exist. | |
| 409 | NotEnableSharingWithResourceDirectory | You have not enabled sharing with your Resource Directory. | |
| 409 | AccountNotInResourceDirectory | The account is not a master or a member of a resource directory. | |
| 409 | QuotaExceeded.ResourceShare.Count | The maximum number of ResourceShare exceeds the limit. | |
| 409 | EntityAlreadyExists.ResourceShare | The specified resource share ID already exists. | |
| 409 | QuotaExceeded.SharedResource.Count | The maximum number of shared resources per account exceeds the limit. | |
| 409 | ShareWithYourself | You cannot share resources with yourself. | |
| 409 | NotManagementAccount | Only the management account of the service is allowed to share such resources. | |
| 409 | QuotaExceeded.PendingInvitations | The maximum number of pending invitations exceeds the limit. | |
| 409 | InvalidTarget.LegalEntityMismatch | The target account does not have the same legal entity as the resource owner account. | |
| 409 | ExternalTargetsNotAllowed.ResourceType | The resource share includes resource types that cannot be shared with accounts outside the resource directory. | |
| 409 | InvalidTarget.SiteMismatch | Cross-site resource sharing is not supported. | |
| 409 | NotSupport.Service.ExistInOtherResourceShare | The resource type has been shared to the target service through other resourceShare. Please share it in the same resourceShare. | |
| 409 | NotSupport.Service.AssociateConflict | The same resource cannot be shared repeatedly to the target service. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.