QueryVmNicInSecurityGroup
API Request
URLs
GET zstack/v1/security-groups/vm-instances/nicsHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 3f2df305cc614ecb9d0b93480cf84b33" \
-X GET http://localhost:8080/zstack/v1/security-groups/vm-instances/nicsQueryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QueryVmNicInSecurityGroup, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "9bac6b3729ae4915bc9f4cee67753774",
"vmNicUuid": "7d0784059df64a11aef748e18b0d5fa7",
"securityGroupUuid": "d3ace95b1236482896f5d1921638ada5",
"vmInstanceUuid": "ace37e89d86c4994942f858a67172a0d",
"createDate": "Jun 7, 2017 9:20:32 PM",
"lastOpDate": "Jun 7, 2017 9:20:32 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| vmNicUuid | String | The VM NIC UUID. | 0.6 |
| securityGroupUuid | String | The security group UUID. | 0.6 |
| vmInstanceUuid | String | The VM instance UUID. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
QueryVmNicInSecurityGroupAction action = new QueryVmNicInSecurityGroupAction();
action.conditions = asList();
action.sessionId = "fc82274e695143118923150b6008bef2";
QueryVmNicInSecurityGroupAction.Result res = action.call();Python
SDK
QueryVmNicInSecurityGroupAction action = QueryVmNicInSecurityGroupAction()
action.conditions = []
action.sessionId = "32b2bfd366774b67a51ebdeb374df1cc"
QueryVmNicInSecurityGroupAction.Result res = action.call()