UpdateAliyunSmsSNSTextTemplate

API Request

URLs
PUT zstack/v1/zwatch/alarms/sns/text-templates/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateAliyunSmsSNSTextTemplate": {
    "alarmTemplateCode": "SMS_123456789",
    "sign": " Sample signature",
    "eventTemplateCode": "SMS_987654321",
    "eventTemplate": "your aliyun sms event template here",
    "name": "aliyunSmsTemplate",
    "description": "description",
    "template": "your aliyun sms alarm template here",
    "defaultTemplate": true
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateAliyunSmsSNSTextTemplate":{"alarmTemplateCode":"SMS_123456789","sign":" Sample signature","eventTemplateCode":"SMS_987654321","eventTemplate":"your aliyun sms event template here","name":"aliyunSmsTemplate","description":"description","template":"your aliyun sms alarm template here","defaultTemplate":true}}' http://localhost:8080/zstack/v1/zwatch/alarms/sns/text-templates/d7e89644ef273ca8baf451bf845553fd/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
alarmTemplateCode String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The resource alarm template code. 3.7.0
sign String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The SMS message signature. 3.7.0
eventTemplateCode String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The event template code. 3.7.0
eventTemplate String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The event alarm template text. 3.7.0
uuid String url The template UUID. 3.7.0
name String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The template name. 3.7.0
description String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The detailed description of the template. 3.7.0
template String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The resource alarm template text. 3.7.0
recoveryTemplate String body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. The recovery template text. 3.7.0
defaultTemplate Boolean body (contained in the updateAliyunSmsSNSTextTemplate structure) Optional. Whether to set the template as the default template. 3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0

API Response

Sample Response
{
  "inventory": {
    "alarmTemplateCode": "SMS_153055065",
    "sign": " Sample signature",
    "eventTemplateCode": "SMS_123456789",
    "eventTemplate": "Event ${EVENT_NAME} had just happened",
    "uuid": "f8b819b8af9c402fac43932ef95cb468",
    "name": "email template",
    "applicationPlatformType": "AliyunSms",
    "template": "Alarm ${ALARM_NAME} changes status to ${ALARM_CURRENT_STATUS}",
    "recoveryTemplate": "Resource ${EVENT_RESOURCE_ID} changes status to ${ALARM_CURRENT_STATUS}",
    "defaultTemplate": false,
    "createDate": "Oct 8, 2019 5:32:12 PM",
    "lastOpDate": "Oct 8, 2019 5:32:12 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. 3.7.0
inventory AliyunSmsSNSTextTemplateInventory See inventory. 3.7.0
#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. 3.7.0
description String The brief description of the error. 3.7.0
details String The details about the error. 3.7.0
elaboration String The reserved field. Default value: null. 3.7.0
opaque LinkedHashMap The reserved field. Default value: null. 3.7.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.7.0
#inventory
Name Type Description Starting Version
alarmTemplateCode String The resource alarm template code. 3.7.0
sign String The SMS message signature. 3.7.0
eventTemplateCode String The event alarm template code. 3.7.0
eventTemplate String The event alarm template text. 3.7.0
uuid String The template UUID. 3.7.0
name String The template name. 3.7.0
description String The detailed description of the template. 3.7.0
applicationPlatformType String The application platform type. 3.7.0
template String The resource alarm template text. 3.7.0
recoveryTemplate String The recovery template text. 3.7.0
defaultTemplate Boolean Whether to set the template as the default template. 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0

SDK Sample

Java SDK
UpdateAliyunSmsSNSTextTemplateAction action = new UpdateAliyunSmsSNSTextTemplateAction();
action.alarmTemplateCode = "SMS_123456789";
action.sign = " Sample signature";
action.eventTemplateCode = "SMS_987654321";
action.eventTemplate = "your aliyun sms event template here";
action.uuid = "d7e89644ef273ca8baf451bf845553fd";
action.name = "aliyunSmsTemplate";
action.description = "description";
action.template = "your aliyun sms alarm template here";
action.defaultTemplate = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAliyunSmsSNSTextTemplateAction.Result res = action.call();
Python SDK
UpdateAliyunSmsSNSTextTemplateAction action = UpdateAliyunSmsSNSTextTemplateAction()
action.alarmTemplateCode = "SMS_123456789"
action.sign = " Sample signature"
action.eventTemplateCode = "SMS_987654321"
action.eventTemplate = "your aliyun sms event template here"
action.uuid = "d7e89644ef273ca8baf451bf845553fd"
action.name = "aliyunSmsTemplate"
action.description = "description"
action.template = "your aliyun sms alarm template here"
action.defaultTemplate = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateAliyunSmsSNSTextTemplateAction.Result res = action.call()