Revoke Resource Sharing

PUT/zstack/v1/accounts/resources/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "revokeResourceSharing": {
    "resourceUuids": [
      "6551ce5374243f14875351219cdb69ba",
      "18501632374c331692e10ab976f56e28"
    ],
    "toPublic": false,
    "accountUuids": [
      "9a0c56a8bcbd31edbd384b28b8ffeffc",
      "3627b63ad55939cf8df5fa4848abd6f2"
    ],
    "all": false
  },
  "systemTags": [],
  "userTags": []
}

In the example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth YOUR_SESSION_UUID" \
-X PUT -d '{"revokeResourceSharing":{"resourceUuids":["6551ce5374243f14875351219cdb69ba","18501632374c331692e10ab976f56e28"],"toPublic":false,"accountUuids":["9a0c56a8bcbd31edbd384b28b8ffeffc","3627b63ad55939cf8df5fa4848abd6f2"],"all":false}}' \
http://localhost:8080/zstack/v1/accounts/resources/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

resourceUuids

List

body (contained in the revokeResourceSharing structure)

Resource UUID list

 

0.6

toPublic (Optional)

boolean

body (contained in the structure)

Share globally

 

0.6

accountUuids (Optional)

List

body (contained in the revokeResourceSharing structure)Note: When the all parameter is set to false, the account UUID list cannot be empty

Account UUID list

 

0.6

all (Optional)

boolean

body (contained in the revokeResourceSharing structure)

 

 

0.6

systemTags (Optional)

List

body

System tags

 

0.6

userTags (Optional)

List

body

User tags

 

0.6

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field, for example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

RevokeResourceSharingAction action = new RevokeResourceSharingAction();
action.resourceUuids = asList("6551ce5374243f14875351219cdb69ba","18501632374c331692e10ab976f56e28");
action.toPublic = false;
action.accountUuids = asList("9a0c56a8bcbd31edbd384b28b8ffeffc","3627b63ad55939cf8df5fa4848abd6f2");
action.all = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RevokeResourceSharingAction.Result res = action.call();

Python SDK

RevokeResourceSharingAction action = RevokeResourceSharingAction()
action.resourceUuids = [6551ce5374243f14875351219cdb69ba, 18501632374c331692e10ab976f56e28]
action.toPublic = false
action.accountUuids = [9a0c56a8bcbd31edbd384b28b8ffeffc, 3627b63ad55939cf8df5fa4848abd6f2]
action.all = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RevokeResourceSharingAction.Result res = action.call()