Skip to main content
O&M Management/Monitoring APIs/Monitoring and Alarm APIs/Alarm Text Template (Text Template)
POSTAlarm Text Template (Text Template)Since 2.3SynchronousAuth Required

Create Alarm Message Template

Create Alarm Message Template

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

      The detailed description of the resource

    • applicationPlatformTypeStringRequired

      The SNS application platform type

    • templateStringRequired

      The alarm message template text

    • recoveryTemplateStringRequired

      The recovery alarm template text

    • defaultTemplateBoolean

      Whether to use as the default template

    • resourceUuidString

      资源UUID。若指定,资源会使用该字段值作为UUID。

  • systemTagsList

    System tags

  • userTagsList

    User tags

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation failed. This field is null on success. See error

    • codeStringRequired

      The error code number. A globally unique identifier for the error, such as SYS.1000, HOST.1001

    • descriptionStringRequired

      A brief description of the error

    • detailsStringRequired

      The detailed error information

    • elaborationStringRequired

      Reserved field. Default is null

    • opaqueLinkedHashMapRequired

      Reserved field. Default is null

    • causeErrorCodeRequired

      The root error. The source error that caused the current error. This field is null if there is no root error

  • inventorySNSTextTemplateInventoryRequired

    See inventory

    • uuidStringRequired

      The UUID of the resource. Uniquely identifies the resource

    • nameStringRequired

      The resource name

    • descriptionStringRequired

      The detailed description of the resource

    • applicationPlatformTypeStringRequired

      The application platform type

    • templateStringRequired

      The template text

    • defaultTemplateBooleanRequired

      Whether it is the default template

    • createDateTimestampRequired

      The creation time

    • lastOpDateTimestampRequired

      The last modification time

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>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "0b13c60e86c44fc08829f40ff73923f7", "name": "email template", "applicationPlatformType": "Email", "template": "Alarm ${ALARM_NAME} changes status to ${ALARM_CURRENT_STATUS}", "recoveryTemplate": "Alarm ${ALARM_NAME} Resource ${ALARM_RESOURCE_NAME} changes status to ${ALARM_CURRENT_STATUS}", "defaultTemplate": false, "createDate": "Jul 6, 2018 1:51:04 PM", "lastOpDate": "Jul 6, 2018 1:51:04 PM" } }

Change History

This API has no change history records yet.

View all change history