System Topic

SNS has some built-in system topics. Some predefined messages are sent to the system topics. You can subscribe to these topics to obtain information of interest.

Note:
  • System topics cannot be deleted or changed. UUIDs of system topics are predefined constant values.
  • System topics can be hard coded.

System Alarm Topic

QuerySNSTopic  name=system-alarm
{
    "inventories": [
        {
            "createDate": "Jan 10, 2018 12:11:09 AM",
            "description": "topic for reporting system defined alarms",
            "lastOpDate": "Jan 10, 2018 12:11:09 AM",
            "name": "system-alarm",
            "state": "Enabled",
            "uuid": "e7d6f5e23bb74e99a2777126078b551c"
        }
    ],
    "success": true
}

Alarms predefined by ZWatch send alarm messages to system alarm topics. You can use a system alarm topic as a custom alarm topic.

Use System HTTP Endpoint to Receive Messages from System Alarm Topics

An internal system (usually the UI) needs a way to receive messages from system alarm topics. You can use a system HTTP endpoint to act as the way mentioned above by configuring the following fields in zstack.properties:

sns.systemTopic.endpoints.http.url = The HTTP URL to receive POST messages.
sns.systemTopic.endpoints.http.url.username = Optional. The username of the HTTP request.
sns.systemTopic.endpoints.http.url.password = Optional. The password of the HTTP request.

If you need to set the username or password, both fields need to be set at the same time. Otherwise, the setting will not take effect. The HTTP endpoint can receive messages no matter the system alarm topic is enabled or disabled.

Note:

You can use the zstack-configure command to configure the fields mentioned above.

API Topic

QuerySNSTopic  name=system-alarm
{
    "inventories": [
        {
            "createDate": "Jan 10, 2018 12:11:09 AM",
            "description": "the topic to publish API requests and responses",
            "lastOpDate": "Jan 10, 2018 12:11:09 AM",
            "name": "api",
            "state": "Enabled",
            "uuid": "7bfa0eb8555b3528ace936edfd1d74f1"
        }
    ],
    "success": true
}

ZStack will send all API requests and responses to an API topic. You can subscribe to this topic to obtain API call status. The API topic can only be subscribed by HTTP endpoints. The messages received by an HTTP endpoint is the API text in JSON format.

Note:

The API requests received by an API topic are bare requests. If the password field is included in a request (such as the API request for adding a host), this field will also be sent to an endpoint. For security reasons, API topics can only be subscribed by endpoints created by the administrator. The administrator must use API topics only for internal integration or debugging.

CLI Command Manual | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center