Network ServicesSecurity Group

QueryVmNicSecurityPolicy

GET/zstack/v1/security-groups/nics/security-policy

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8"
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c"
-X GET http://localhost:8080/zstack/v1/security-groups/nics/security-policy?q=ingressPolicy=DROP&q=egressPolicy=DROP
curl -H "Content-Type: application/json;charset=UTF-8"
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c"
-X GET http://localhost:8080/zstack/v1/security-groups/nics/a4ef9b72cb66352f9040ce0f8c180b80/security-policy

Queryable Fields

Run the CLI tool, type QueryVmNicSecurityPolicy and press the Tab key to view all queryable fields and cross-table queryable resource names.

API Response

Response Example

{
  "inventories": [
    {
      "vmNicUuid": "40d02946a770317aa1edac79ef350f3f",
      "ingressPolicy": "DROP",
      "egressPolicy": "ACCEPT",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.7.21
inventoriesListSee inventory4.7.21
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See error4.7.21

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10014.7.21
descriptionStringBrief description of the error4.7.21
detailsStringDetailed error information4.7.21
elaborationStringReserved field, defaults to null4.7.21
opaqueLinkedHashMapReserved field, defaults to null4.7.21
causeErrorCodeRoot error: the source error that caused the current error. If there is no original error, this field is null4.7.21

inventory

NameTypeDescriptionStarting Version
vmNicUuidStringThe VM NIC UUID4.7.21
ingressPolicyStringThe ingress security policy of the NIC4.7.21
egressPolicyStringThe egress security policy of the NIC4.7.21
createDateTimestampThe creation time4.7.21
lastOpDateTimestampThe last modification time4.7.21

SDK Examples

Java SDK

QueryVmNicSecurityPolicyAction action = new QueryVmNicSecurityPolicyAction();
action.conditions = asList("ingressPolicy=DROP","egressPolicy=DROP");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmNicSecurityPolicyAction.Result res = action.call();

Python SDK

QueryVmNicSecurityPolicyAction action = QueryVmNicSecurityPolicyAction()
action.conditions = ["ingressPolicy=DROP","egressPolicy=DROP"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmNicSecurityPolicyAction.Result res = action.call()