Query Alarm Message Template

GET/zstack/v1/zwatch/alarms/sns/text-templates
GET/zstack/v1/zwatch/alarms/sns/text-templates/{uuid}

Query alarm message templates.

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/alarms/sns/text-templates?q=name=test
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/alarms/sns/text-templates/1dc97bd699e739c6968fb3e702ab4cb6

Queryable Fields

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

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "c275ce35fae13a09bcd4c54a7406bd3e",
      "name": "Test-SNS-Template",
      "description": "sns text template",
      "applicationPlatformType": "Email",
      "template": "Alarm ${ALARM_NAME} status changed to ${ALARM_CURRENT_STATUS}",
      "defaultTemplate": false,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error2.3
inventoriesListSee inventories2.3

error

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

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource2.3
nameStringThe resource name2.3
descriptionStringThe detailed description of the resource2.3
applicationPlatformTypeStringThe application platform type2.3
templateStringThe template text2.3
defaultTemplateBooleanWhether it is the default template2.3
createDateTimestampThe creation time2.3
lastOpDateTimestampThe last modification time2.3

SDK Examples

Java SDK

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

Python SDK

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