Skip to main content
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

  • paramsObjectRequired

    Request body parameter object.

    • nameStringRequired

      The resource name.

    • descriptionString

      Optional. The detailed description of the resource.

    • applicationPlatformTypeStringRequired

      The type of the SNS application platform.

    • templateStringRequired

      The template text.

    • recoveryTemplateStringRequired

      The recovery template text, which is a string.

    • defaultTemplateBoolean

      Optional. Whether to set the template as the default template.

    • resourceUuidString

      Optional.

    • typeString

      Optional.

    • tagUuidsList

      Optional. the tag UUID list.

    • subjectString

      Optional. The subject.

    • recoverySubjectStringRequired

      The recovery subject.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventorySNSTextTemplateInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      Th resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • applicationPlatformTypeStringRequired

      The application platform type.

    • templateStringRequired

      The template text.

    • defaultTemplateBooleanRequired

      Whether to set the template as the default template.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

Endpoint

POST/zstack/v1/zwatch/alarms/sns/text-templates

/zstack/v1/zwatch/alarms/sns/text-templates

Operation ID

CreateSNSTextTemplate

Permalink

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.

View all change history