QuerySNSTextTemplate
API Request
URLs
GET zstack/v1/zwatch/alarms/sns/text-templates
GET zstack/v1/zwatch/alarms/sns/text-templates/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl
Sample
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
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QuerySNSTextTemplate
, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "c275ce35fae13a09bcd4c54a7406bd3e",
"name": "Test-SNS-Template",
"description": "sns text template",
"applicationPlatformType": "Email",
"template": "Alarm ${ALARM_NAME} status is changed to ${ALARM_CURRENT_STATUS}",
"defaultTemplate": false,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 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. | 2.3 |
inventories | List | See inventories. | 2.3 |
#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. | 2.3 |
description | String | The brief description of the error. | 2.3 |
details | String | The details about the error. | 2.3 |
elaboration | String | The reserved field. Default value: null. | 2.3 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 2.3 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.3 |
#inventories
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 2.3 |
name | String | Th resource name. | 2.3 |
description | String | The detailed description of the resource. | 2.3 |
applicationPlatformType | String | The application platform type. | 2.3 |
template | String | The template text. | 2.3 |
defaultTemplate | Boolean | Whether to set the template as the default template. | 2.3 |
createDate | Timestamp | The creation date. | 2.3 |
lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
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()