Creates an application group by using a resource group.
This topic provides an example on how to create an application group by using the
resource group CloudMonitor
and the alert contact group ECS_Group
. The region ID of the resource group is cn-hangzhou
.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateMonitorGroupByResourceGroupId |
The operation that you want to perform. Set the value to CreateMonitorGroupByResourceGroupId. |
EnableSubscribeEvent | Boolean | No | true |
Specifies whether the application group automatically subscribes to event notifications. If events whose severity level is critical or warning occur on resources in an application group, CloudMonitor sends alert notifications. Valid values:
|
EnableInstallAgent | Boolean | No | true |
Specifies whether the CloudMonitor agent is automatically installed for the application group. CloudMonitor determines whether to automatically install the CloudMonitor agent for the hosts in an application group based on the value of this parameter. Valid values:
|
RegionId | String | Yes | cn-hangzhou |
The ID of the region where the resource group resides. For information about how to obtain the ID of the region where a resource group resides, see GetResourceGroup. |
ResourceGroupId | String | Yes | rg-acfmw3ty5y7**** |
The ID of the resource group. For information about how to obtain the ID of a resource group, see ListResourceGroups. |
ResourceGroupName | String | Yes | CloudMonitor |
The name of the resource group. For information about how to obtain the name of a resource group, see ListResourceGroups. |
ContactGroupList.N | String | Yes | ECS_Group |
The alert contact group. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups. An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see PutContact and PutContactGroup. For information about how to obtain alert contact groups, see DescribeContactGroupList. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | 200 |
The HTTP status code. Note The status code 200 indicates that the call was successful.
|
Message | String | The specified resource is not found. |
The error message. |
RequestId | String | 784CAB3C-F613-5BCE-8469-6DCB29B18A20 |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call was successful. Valid values:
|
Id | Long | 3607**** |
The ID of the application group. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateMonitorGroupByResourceGroupId
&ContactGroupList.1=ECS_Group
&RegionId=cn-hangzhou
&ResourceGroupId=rg-acfmw3ty5y7****
&ResourceGroupName=CloudMonitor
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateMonitorGroupByResourceGroupIdResponse>
<RequestId>784CAB3C-F613-5BCE-8469-6DCB29B18A20</RequestId>
<Id>3607****</Id>
<Code>200</Code>
<Success>true</Success>
</CreateMonitorGroupByResourceGroupIdResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "784CAB3C-F613-5BCE-8469-6DCB29B18A20",
"Id" : "3607****",
"Code" : 200,
"Success" : true
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
404 | ResourceNotFound | The specified resource is not found. | The error message returned because the specified resource is not found. |
For a list of error codes, see Service error codes.