Platform O&M/Cloud Monitoring/Monitoring and Alarm/SNS/ZWatch Operations/Text Template Operations
POSTText Template OperationsSince 2.3SynchronousAuth Required
CreateSNSTextTemplate
CreateSNSTextTemplate
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
nameStringRequiredThe resource name.
descriptionStringOptional. The detailed description of the resource.
applicationPlatformTypeStringRequiredThe type of the SNS application platform.
templateStringRequiredThe template text.
recoveryTemplateStringRequiredThe recovery template text, which is a string.
defaultTemplateBooleanOptional. Whether to set the template as the default template.
resourceUuidStringOptional.
typeStringOptional.
tagUuidsListOptional. the tag UUID list.
subjectStringOptional. The subject.
recoverySubjectStringRequiredThe recovery subject.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/zwatch/alarms/sns/text-templates
/zstack/v1/zwatch/alarms/sns/text-templates
Request Example
curl -X POST 'http://{host}/zstack/v1/zwatch/alarms/sns/text-templates' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","description":"<description>","applicationPlatformType":"<applicationPlatformType>","template":"<template>","recoveryTemplate":"<recoveryTemplate>","defaultTemplate":true,"resourceUuid":"<resourceUuid>","type":"<type>","tagUuids":["<tagUuids>"],"subject":"<subject>","recoverySubject":"<recoverySubject>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "533c0a77d8694f068ea0425f587c9c2a", "name": "email template", "applicationPlatformType": "Email", "subject": "Alarm ${ALARM_NAME} [${ALARM_METRIC} ${ALARM_COMPARISON_OPERATOR} threshold ${ALARM_THRESHOLD}] changes status to ${ALARM_CURRENT_STATUS}", "recoverySubject": "Alarm ${ALARM_NAME} ${TITLE_ALARM_RESOURCE_NAME} changes status to ${ALARM_CURRENT_STATUS}", "template": "Alarm ${ALARM_NAME} changes status to ${ALARM_CURRENT_STATUS}", "recoveryTemplate": "Resource ${EVENT_RESOURCE_ID} changes status to ${ALARM_CURRENT_STATUS}", "defaultTemplate": false, "createDate": "Jun 13, 2024 5:26:38 PM", "lastOpDate": "Jun 13, 2024 5:26:38 PM" } }Change History
This API has no change history records yet.
