Creating a Resource Share
Function
This API is used to create a resource share. You can specify the list of resources to be shared, the list of principals in resource sharing, and the list of permissions granted to the principals.
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Security-Token |
No |
String |
Security token (session token) for temporary security credentials. This parameter is mandatory when you make an API call using temporary security credentials. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Name of the resource share. Minimum: 1 Maximum: 64 |
description |
No |
String |
Description of the resource share. Minimum: 0 Maximum: 256 |
allow_external_principals |
No |
Boolean |
Whether resources can be shared with any accounts outside the organization. Default: true |
permission_ids |
No |
Array of strings |
List of RAM permissions associated with the resource share. A resource type can be associated with only one RAM permission. If you do not specify a permission ID, RAM automatically associates the default permission for each resource type. Minimum: 0 Maximum: 36 Array Length: 0 - 20 |
principals |
No |
Array of strings |
List of one or more principals associated with the resource share. Minimum: 0 Maximum: 1500 Array Length: 0 - 20 |
resource_urns |
No |
Array of strings |
List of URNs of one or more resources associated with the resource share. Minimum: 0 Maximum: 1500 Array Length: 0 - 20 |
tags |
No |
Array of Tag objects |
List of tags attached to the resource share. Array Length: 0 - 20 |
Response Parameters
Status code: 201
Parameter |
Type |
Description |
---|---|---|
resource_share |
ResourceShare object |
Describes a resource share in RAM. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
ID of the resource share. Minimum: 0 Maximum: 36 |
name |
String |
Name of the resource share. Minimum: 0 Maximum: 128 |
description |
String |
Description of the resource share. Minimum: 1 Maximum: 1024 |
allow_external_principals |
Boolean |
Whether resources can be shared with any accounts outside the organization. |
owning_account_id |
String |
ID of the resource owner in a resource share. Minimum: 0 Maximum: 36 |
status |
String |
Status of the resource share. Minimum: 0 Maximum: 36 |
tags |
Array of Tag objects |
List of tags attached to the resource share. Array Length: 0 - 100 |
created_at |
String |
Time when the resource share was created. |
updated_at |
String |
Time when the resource share was last updated. |
Example Requests
Creating a resource share, specifying the resources and principals to be associated, granting permissions to the principals, and adding tags to the resource share
POST https://{hostname}/v1/resource-shares { "name" : "string", "description" : "string", "permission_ids" : [ "string" ], "principals" : [ "string" ], "resource_urns" : [ "string" ], "tags" : [ { "key" : "string", "value" : "string" } ] }
Example Responses
Status code: 201
Request succeeded.
{ "resource_share" : { "id" : "string", "name" : "string", "description" : "string", "allow_external_principals" : true, "owning_account_id" : "string", "status" : "string", "tags" : [ { "key" : "string", "value" : "string" } ], "created_at" : "2022-09-27T03:14:08.883Z", "updated_at" : "2022-09-27T03:14:08.883Z" } }
Status Codes
Status Code |
Description |
---|---|
201 |
Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot