Buat resource share
Deskripsi operasi
Alibaba Cloud Resource Sharing memungkinkan Anda berbagi resource dari akun Anda dengan satu atau beberapa Principal. Untuk informasi selengkapnya, lihat Resource Sharing overview.
Contoh ini menunjukkan cara menggunakan akun manajemen ResourceDirectory untuk membuat resource share bernama test di wilayah cn-hangzhou dan berbagi vSwitch vsw-bp183p93qs667muql**** dengan anggota 172050525300****.
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. Panjang nama harus antara 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 dibagikan. |
||
| ResourceId |
string |
No |
ID resource yang dibagikan. Anda dapat menambahkan hingga lima resource yang dibagikan sekaligus. Catatan
Tentukan parameter |
vsw-bp183p93qs667muql**** |
| ResourceType |
string |
No |
Jenis resource yang dibagikan. Anda dapat menambahkan hingga lima resource yang dibagikan sekaligus. Untuk daftar jenis resource yang didukung, lihat Services that work with Resource Sharing. Catatan
Tentukan parameter |
VSwitch |
| Targets |
array |
No |
Daftar principal. |
172050525300**** |
|
string |
No |
ID principal. Nilai yang valid bergantung pada pengaturan
Untuk informasi selengkapnya, lihat Methods used to share resources, View the ID of a resource directory, View the ID of a folder, atau View the ID of a member. Anda dapat menambahkan hingga lima principal sekaligus. |
172050525300**** |
|
| ResourceArns |
array |
No |
Alibaba Cloud Resource Names (ARNs) dari resource yang dibagikan. Anda dapat menambahkan hingga lima resource yang dibagikan sekaligus. |
|
|
string |
No |
ARN dari resource yang dibagikan. Catatan
Untuk format ARN resource, lihat Services that work with Resource Sharing. |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
|
| PermissionNames |
array |
No |
Nama izin. Jika tidak ditentukan, sistem akan menyambungkan izin default untuk jenis resource tersebut. Untuk detailnya, lihat Permission Library. |
|
|
string |
No |
Nama izin. Jika tidak ditentukan, sistem akan menyambungkan izin default untuk jenis resource tersebut. Untuk detailnya, lihat Permission Library. |
AliyunRSDefaultPermissionVSwitch |
|
| AllowExternalTargets |
boolean |
No |
Menentukan apakah berbagi dengan akun di luar resource directory Anda diizinkan. Nilai yang valid:
|
false |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya. |
rg-aekz5nlvlak**** |
| TargetProperties |
array<object> |
No |
Properti principal. Catatan
Parameter ini hanya tersedia ketika principal adalah layanan Alibaba Cloud. |
|
|
object |
No |
Properti principal. Catatan
Parameter ini hanya tersedia ketika principal adalah layanan Alibaba Cloud. |
||
| Property |
string |
No |
Properti principal. Misalnya, Anda dapat menentukan rentang waktu untuk berbagi resource. Nilai yang valid untuk
Catatan
Tentukan parameter |
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
| TargetId |
string |
No |
ID principal. Catatan
Tentukan parameter |
172050525300**** |
| ResourceProperties |
array<object> |
No |
Daftar properti resource. |
|
|
object |
No |
Properti resource. |
||
| Property |
string |
No |
Properti resource. |
{"sharePrincipals":true,"shareTagOptions":false} |
| ResourceArn |
string |
No |
ARN resource. |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| Tag |
array<object> |
No |
Tag dari resource share. Anda dapat menambahkan maksimal 20 tag. |
|
|
object |
No |
Tag. |
||
| Key |
string |
No |
Kunci tag. Catatan
Panjang kunci tag maksimal 128 karakter. Kunci tidak boleh diawali dengan |
k1 |
| Value |
string |
No |
Nilai tag. Catatan
Panjang nilai tag maksimal 128 karakter. Nilai tidak boleh diawali dengan |
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 akun di luar resource directory diizinkan mengakses resource yang dibagikan. 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
Resource share dalam status |
Active |
| UpdateTime |
string |
Waktu terakhir 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.