Query Event Subscription

GET/zstack/v1/zwatch/events/subscriptions
GET/zstack/v1/zwatch/events/subscriptions/{uuid}

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/zwatch/events/subscriptions?q=name=test
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/events/subscriptions/57618e9763ce3b7e990870c3a7ae8c53

Queryable Fields

Run the CLI command line tool, enter QueryEventSubscription and press Tab to view all queryable fields and the resource names available for cross-table queries.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "9404fe697a6b4d7dbac98065af20dc57",
      "namespace": "ZStack/VM",
      "eventName": "org.zstack.zwatch.datatype.EventFamily@80723ca",
      "state": "Enabled",
      "actions": [
        {
          "subscriptionUuid": "650cf6a269284671a42f93631c87dfec",
          "actionType": "sns",
          "actionUuid": "fe296dcbc31c4afa9f76494b1930c8cc"
        }
      ],
      "labels": [
        {
          "uuid": "d29fe54ca47540a9b20b308429f21434",
          "key": "DestinationHostUuid",
          "operator": "Equal",
          "value": "733509c8c5684c678ffe99f59d4aba21"
        }
      ],
      "lastOpDate": "Jul 6, 2018 1:51:00 PM",
      "createDate": "Jul 6, 2018 1:51:00 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error2.3.1
inventoriesListSee inventories2.3.1

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, such as SYS.1000, HOST.10012.3.1
descriptionStringA brief description of the error2.3.1
detailsStringThe detailed error information2.3.1
elaborationStringReserved field. Default is null2.3.1
opaqueLinkedHashMapReserved field. Default is null2.3.1
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root error2.3.1

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource2.3.1
nameStringThe resource name3.0.0
namespaceStringThe namespace2.3.1
eventNameStringThe event name2.3.1
lastOpDateTimestampThe last modification time2.3.1
createDateTimestampThe creation time2.3.1
stateEventSubscriptionStateSee state2.3.1
actionsListSee actions2.3.1
labelsListSee labels2.3.1

state

NameTypeDescriptionStarting Version
nameStringThe resource name2.3.1
ordinalint 2.3.1

actions

NameTypeDescriptionStarting Version
subscriptionUuidStringThe event subscription UUID2.3.1
actionTypeStringThe action type2.3.1
actionUuidStringThe action UUID2.3.1

labels

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource2.3.1
keyStringThe label name2.3.1
valueStringThe label value2.3.1
operatorOperatorSee operator2.3.1

operator

NameTypeDescriptionStarting Version
opString 2.3.1
nameStringThe resource name2.3.1
ordinalint 2.3.1

SDK Examples

Java SDK

QueryEventSubscriptionAction action = new QueryEventSubscriptionAction();
action.conditions = asList("name=test");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryEventSubscriptionAction.Result res = action.call();

Python SDK

QueryEventSubscriptionAction action = QueryEventSubscriptionAction()
action.conditions = ["name=test"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryEventSubscriptionAction.Result res = action.call()