All Products
Search
Document Center

Edge Security Acceleration:GetOriginRule

Last Updated:Jun 25, 2026

Queries a single origin rule configuration.

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

esa:GetOriginRule

get

*Site

acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

None None

Request parameters

Parameter

Type

Required

Description

Example

SiteId

integer

Yes

The site ID. Call ListSites to obtain it.

3400350********

ConfigId

integer

Yes

The configuration ID. Call ListSiteRoutes to obtain it.

33793140540****

Response elements

Element

Type

Description

Example

object

Response schema.

RequestId

string

The request ID.

04F0F334-1335-436C-A1D7-6C044FE73368

ConfigId

integer

The configuration ID.

352816096987136

ConfigType

string

The configuration type. Valid values:

  • global: global configurations.

  • rule: rule configurations.

rule

SiteVersion

integer

The configuration version number. Specifies the website version for feature settings. Default: 0.

1

Sequence

integer

The rule execution order. Lower values have higher priority.

1

RuleEnable

string

Whether the rule is enabled. Not required for global configurations. Valid values:

  • on

  • off

on

Rule

string

The rule content, a conditional expression that matches user requests. Not required for global configurations. Use cases:

  • true: Matches all incoming requests.

  • Custom expression, for example, (http.host eq "video.example.com"): Matches the specified request.

(http.host eq \"video.example.com\")

RuleName

string

The rule name. Not required for global configurations.

rule_example

OriginHost

string

The Host header in origin requests.

origin.example.com

OriginScheme

string

The back-to-origin protocol. Valid values:

  • http: HTTP.

  • https: HTTPS.

  • follow: Uses the client's protocol.

http

OriginSni

string

The SNI in origin requests.

origin.example.com

DnsRecord

string

The hostname that overrides the resolved hostname of an incoming request.

test.example.com

OriginHttpPort

string

The HTTP port for back-to-origin requests.

8080

OriginHttpsPort

string

The HTTPS port for back-to-origin requests.

4433

Range

string

Whether to use range requests for back-to-origin. Valid values:

  • on

  • off

  • force: Forces range back-to-origin.

on

OriginMtls

string

Whether mTLS is enabled. Valid values:

  • on

  • off

on

OriginVerify

string

Whether origin certificate verification is enabled. Valid values:

  • on

  • off

on

RangeChunkSize

string

The range chunk size. Valid values:

  • 512KB

  • 1MB

  • 2MB

  • 4MB

1MB

OriginReadTimeout

string

The origin read timeout, in seconds.

10

Follow302Enable

string

Whether to follow 302 redirects. Valid values:

  • on

  • off

on

Follow302MaxTries

string

Maximum 302 redirect follows. Valid values: 1 to 5.

1

Follow302RetainArgs

string

Whether to retain original request parameters on redirect. Valid values:

  • on

  • off

on

Follow302RetainHeader

string

Whether to retain original request headers on redirect. Valid values:

  • on

  • off

on

Follow302TargetHost

string

The target host for 302 redirects.

test.com

Examples

Success response

JSON format

{
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  "ConfigId": 352816096987136,
  "ConfigType": "rule",
  "SiteVersion": 1,
  "Sequence": 1,
  "RuleEnable": "on",
  "Rule": "(http.host eq \\\"video.example.com\\\")\n",
  "RuleName": "rule_example",
  "OriginHost": "origin.example.com\n",
  "OriginScheme": "http",
  "OriginSni": "origin.example.com\n",
  "DnsRecord": "test.example.com\n",
  "OriginHttpPort": "8080",
  "OriginHttpsPort": "4433",
  "Range": "on",
  "OriginMtls": "on",
  "OriginVerify": "on",
  "RangeChunkSize": "1MB",
  "OriginReadTimeout": "10",
  "Follow302Enable": "on",
  "Follow302MaxTries": "1",
  "Follow302RetainArgs": "on",
  "Follow302RetainHeader": "on",
  "Follow302TargetHost": "test.com"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InternalException Failed to call the service. Try again later or contact technical support. Failed to call the service. Try again later or contact technical support.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.