CreateRouteRule

Updated at:

Creates a routing rule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

gemp:CreateRouteRule

create

*All Resource

*

None None

Request syntax

POST /routeRule/save HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The parameters for creating a routing rule.

ruleName

string

Yes

The name of the routing rule.

Rule name

enableStatus

string

No

Specifies whether the rule is enabled. Valid values:

  • disable: Disabled.

  • enable: Enabled.

enable

relatedServiceId

integer

Yes

The ID of the associated service.

100

routeType

string

Yes

The route type. Valid values:

  • INCIDENT: Triggers an incident.

  • ALERT: Triggers only an alert.

INCIDENT

incidentLevel

string

Yes

The event level. The severity decreases from P1 to P4.

P1

assignObjectId

integer

Yes

The ID of the object to which the event is assigned. The object can be a service group or a user.

65

assignObjectType

string

Yes

The object type for event assignment. Valid values:

  • SERVICEGROUP: Service group.

  • USER: Single user.

SERVICEGROUP

effection

string

Yes

The impact level. Valid values:

  • LOW: Minor.

  • HIGH: Critical.

LOW

timeWindow

integer

Yes

The time window.

2

matchCount

integer

Yes

The number of hits.

3

timeWindowUnit

string

Yes

The unit of the time window. Valid values:

  • MINUTE: Minutes.

  • SECOND: Seconds.

MINUTE

routeChildRules

array<object>

Yes

The array of child rules.

array<object>

Yes

The child rule.

monitorSourceId

integer

Yes

The ID of the monitoring source.

1

conditions

array<object>

Yes

The list of matching conditions.

object

Yes

The matching condition.

key

string

Yes

The matching key.

payload.summary

value

string

Yes

The matching value.

123

operationSymbol

string

Yes

The operator.

equals

childConditionRelation

integer

No

The logical relation between child conditions. Valid values:

  • 0: AND.

  • 1: OR.

0

problemLevel

string

No

The fault level. The severity decreases from P1 to P4.

P1

notifyChannels

array

Yes

The list of notification channels.

string

Yes

The notification channel. Valid values:

  • SMS: Text message.

  • PHONE: Voice call.

  • EMAIL: Email.

  • WEBHOOK: Group notification.

[SMS,PHONE]

clientToken

string

No

The idempotency token.

C4BE3837-1A13-413B-A225-2C88188E8A43

childRuleRelation

string

Yes

The logical relation between child rules. Valid values:

  • AND: AND.

  • OR: OR.

AND

problemLevelGroup

object

No

The fault level group.

{"P1":{"childRuleRelation":1,"matchCount":1,"timeWindow":5,"timeWindowUnit":"MINUTE","enableUpgrade":false,"upgradeTimeWindow":5,"upgradeTimeWindowUnit":"minute"}}

object

No

The fault level.

childRuleRelation

integer

No

The logical relation between child rules. Valid values:

  • 0: AND.

  • 1: OR.

1

matchCount

integer

No

The number of hits for suppression.

1

timeWindow

integer

No

The time window for suppression.

5

timeWindowUnit

string

No

The unit of the time window for suppression.

M

enableUpgrade

boolean

No

Specifies whether to enable the upgrade.

false

upgradeTimeWindow

integer

No

The time window for the upgrade.

5

upgradeTimeWindowUnit

string

No

The unit of the time window for the upgrade.

M

coverageProblemLevels

array

No

The fault level coverage.

string

No

The fault level type.

P1

problemEffectionServices

array

No

The services affected by the fault.

integer

No

The ID of the affected service.

1

convergenceFields

array

No

The set of convergence fields.

string

No

The set of convergence fields.

app

convergenceType

integer

No

The convergence type. Valid values:

  • 0: Routing rule convergence.

  • 1: Field convergence.

0

Response elements

Element

Type

Description

Example

object

The response structure.

requestId

string

The request ID.

Request ID

data

object

The returned result.

{"routeRuleId":1000}

routeRuleId

integer

The rule ID.

1000

Examples

Success response

JSON format

{
  "requestId": "Request ID",
  "data": {
    "routeRuleId": 1000
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 AddRouteRuleFail Failed to add the rule.
400 RouteRuleNameAlreadyExisted The rule name already exists.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.