Creates or modifies a rule to dynamically add instances of a service that meet the rule to an application group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes PutMonitorGroupDynamicRule

The operation that you want to perform. Set the value to PutMonitorGroupDynamicRule.

GroupId Long Yes 1234

The ID of the application group.

GroupRules.N.Category String Yes ecs

The service to which the rule applies. Valid values: ecs, rds, and slb.

The value of N is an integer greater than or equal to 1.

GroupRules.N.FilterRelation String Yes and

The logical operator used between conditional expressions in the rule. Valid values:

  • and: The instances that meet all the conditional expressions are automatically added to the application group.
  • or: The instances that meet one of the conditional expressions are automatically added to the application group.

The value of N is an integer greater than or equal to 1.

GroupRules.N.Filters.N.Function String Yes contains

The method used to filter instances. Valid values:

  • contains
  • startWith
  • endWith

Valid values of the second N: 1, 2, and 3.

GroupRules.N.Filters.N.Name String Yes hostName

The name of the field based on which instances are filtered.

Set the value to hostName.

Valid values of the second N: 1, 2, and 3.

GroupRules.N.Filters.N.Value String Yes nginx

The value to be matched with the value of the hostName field. Valid values of the second N: 1, 2, and 3.

Response parameters

Parameter Type Example Description
RequestId String 3E73F1AB-D195-438A-BCA7-2F4355789C58

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

Code Integer 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Message String success

The returned message.

Examples

Sample requests


http(s)://[Endpoint]/? Action=PutMonitorGroupDynamicRule
&GroupId=1234
&GroupRules.1.Category=ecs
&GroupRules.1.FilterRelation=and
&GroupRules.1.Filters.1.Function=contains
&GroupRules.1.Filters.1.1ame=hostName
&GroupRules.1.Filters.1.Value=nginx
&<Common request parameters>

Sample success responses

XML format

<RequestId>3E73F1AB-D195-438A-BCA7-2F4355789C58</RequestId>
<Success>true</Success>
<Code>200</Code>

JSON format

{
	"RequestId":"3E73F1AB-D195-438A-BCA7-2F4355789C58",
	"Success":true,
	"Code":200
}

Error codes

For a list of error codes, visit the API Error Center.