# Get the alarm template bound to the resource - GetResourceAlarmTemplate

## Overview

Get the alarm template bound to the resource






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `GetResourceAlarmTemplate`.                      | **Yes** |
| **PublicKey**  | string  | AccessKey ID, obtained from [Console](https://console.sigcalcloud.com/uaccount/api_manage)                                              | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **ResourceType** | string | Resource Type (consistent with DescribeResourceMetric) |**Yes**|
| **ResourceId.N** | string | Resource ID List |**Yes**|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **DataSet** | array[[*ResourceTemplateBound*](#resourcetemplatebound)] | Please see ResourceTemplateBound |**Yes**|

#### Data Model


#### ResourceTemplateBound

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **HasAlarmTemplate** | string | Is the alarm template bound, Yes: Yes; No: No. If No, do not display AlarmTemplateId, AlarmTemplateName, Remark. |**Yes**|
| **ResourceId** | string | Resource ID |**Yes**|
| **AlarmTemplateId** | int | Alarm Template ID |No|
| **AlarmTemplateName** | string | Alarm Template Name |No|
| **IsDefault** | string | Is it the default template, Yes: Yes; No: No |No|
| **Remark** | string | Template Notes |No|

## Example

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

### Response Example
    
```json
{
  "Action": "GetResourceAlarmTemplateResponse",
  "DataSet": [
    {
      "AlarmTemplateId": 4,
      "AlarmTemplateName": "默认云主机告警模板",
      "HasAlarmTemplate": "Yes",
      "IsDefault": "Yes",
      "Remark": "默认推荐模板",
      "ResourceId": "uhost-mwzal2",
      "uuid": "9943290f-da50-4edf-a80f-xxxxx"
    }
  ],
  "RetCode": 0
}
```





