AddIAM2VirtualIDsToProject
API Request
URLs
POST zstack/v1/iam2/projects/{projectUuid}/virtual-ids
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"virtualIDUuids": [
"6552671ff11d301cb593ed46b6db53ed",
"f2a0c8724833360c939db5665d83aefc"
]
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"virtualIDUuids":["6552671ff11d301cb593ed46b6db53ed","f2a0c8724833360c939db5665d83aefc"]}}' http://localhost:8080/zstack/v1/iam2/projects/70d6ff93ccec388d92cd5c2c96f9df0b/virtual-ids
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
projectUuid | String | url | 2.4.0 | ||
virtualIDUuids | List | body (contained in the params structure) | 2.4.0 | ||
systemTags | List | body | Optional. The system tags. | 2.4.0 | |
userTags | List | body | Optional. The user tags. | 2.4.0 | |
roleUuids | List | body (contained in the params structure) | Optional. | 2.4.0 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API
failed, the returned JSON structure includes 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 Sample
Java
SDK
AddIAM2VirtualIDsToProjectAction action = new AddIAM2VirtualIDsToProjectAction();
action.projectUuid = "70d6ff93ccec388d92cd5c2c96f9df0b";
action.virtualIDUuids = asList("6552671ff11d301cb593ed46b6db53ed","f2a0c8724833360c939db5665d83aefc");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIAM2VirtualIDsToProjectAction.Result res = action.call();
Python
SDK
AddIAM2VirtualIDsToProjectAction action = AddIAM2VirtualIDsToProjectAction()
action.projectUuid = "70d6ff93ccec388d92cd5c2c96f9df0b"
action.virtualIDUuids = [6552671ff11d301cb593ed46b6db53ed, f2a0c8724833360c939db5665d83aefc]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIAM2VirtualIDsToProjectAction.Result res = action.call()