docs
api
Cloud Monitor(UMon)
GetResourceAlarmTemplate

Get the alarm template bound to the resource - GetResourceAlarmTemplate

Overview

Get the alarm template bound to the resource

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is GetResourceAlarmTemplate.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
ResourceTypestringResource Type (consistent with DescribeResourceMetric)Yes
ResourceId.NstringResource ID ListYes

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
DataSetarray[ResourceTemplateBound]Please see ResourceTemplateBoundYes

Data Model

ResourceTemplateBound

Field NameTypeDescription InformationRequired
HasAlarmTemplatestringIs the alarm template bound, Yes: Yes; No: No. If No, do not display AlarmTemplateId, AlarmTemplateName, Remark.Yes
ResourceIdstringResource IDYes
AlarmTemplateIdintAlarm Template IDNo
AlarmTemplateNamestringAlarm Template NameNo
IsDefaultstringIs it the default template, Yes: Yes; No: NoNo
RemarkstringTemplate NotesNo

Example

Request Example

https://api.surfercloud.com/?Action=GetResourceAlarmTemplate
&Region=cn-bj2
&ProjectId=org-kk3qlr
&ResourceType=uhost
&ResourceId.0=uhost-xxx
&IsGlobal=5

Response Example

{
  "Action": "GetResourceAlarmTemplateResponse",
  "DataSet": [
    {
      "AlarmTemplateId": 4,
      "AlarmTemplateName": "默认云主机告警模板",
      "HasAlarmTemplate": "Yes",
      "IsDefault": "Yes",
      "Remark": "默认推荐模板",
      "ResourceId": "uhost-mwzal2",
      "uuid": "9943290f-da50-4edf-a80f-xxxxx"
    }
  ],
  "RetCode": 0
}
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved