Change Resource Owner

POST/zstack/v1/account/{accountUuid}/resources

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "resourceUuid": "abfee8286ae43b19a02179cfe37b3294"
  },
  "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 b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"resourceUuid":"abfee8286ae43b19a02179cfe37b3294"}}' \
http://localhost:8080/zstack/v1/account/e9da3eb01abc31c78ac24dec8c8c36b5/resources

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
accountUuidStringurlAccount UUID 0.6
resourceUuidStringbody (contained in the params structure)Resource UUID 0.6
systemTags (Optional)ListbodySystem tags 0.6
userTags (Optional)ListbodyUser tags 0.6

API Response

Response example

{
  "inventory": {
    "id": 1,
    "accountUuid": "819950c427763deca51c94ad5e06da42",
    "resourceUuid": "844a5dbbd2a632678b67a610e4d761b6",
    "resourceType": "ImageVO",
    "type": "Own"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null on success. For details, see error0.6
inventoryAccountResourceRefInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventory

NameTypeDescriptionStarting Version
accountUuidStringAccount UUID0.6
resourceUuidStringResource UUID0.6
resourceTypeStringResource type0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

ChangeResourceOwnerAction action = new ChangeResourceOwnerAction();
action.accountUuid = "e9da3eb01abc31c78ac24dec8c8c36b5";
action.resourceUuid = "abfee8286ae43b19a02179cfe37b3294";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeResourceOwnerAction.Result res = action.call();

Python SDK

ChangeResourceOwnerAction action = ChangeResourceOwnerAction()
action.accountUuid = "e9da3eb01abc31c78ac24dec8c8c36b5"
action.resourceUuid = "abfee8286ae43b19a02179cfe37b3294"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeResourceOwnerAction.Result res = action.call()