All Products
Search
Document Center

Edge Security Acceleration:SetDcdnDomainStagingConfig

Last Updated:Aug 21, 2025

Call SetDcdnDomainStagingConfig to set or modify the configurations for a domain name in the staging environment.

Operation description

Note

The call frequency for a single user is limited to 30 calls per second.

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

dcdn:SetDcdnDomainStagingConfig

update

*domain

acs:dcdn:*:{#accountId}:domain/{#domainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

DomainName

string

Yes

The accelerated domain name. Separate multiple domain names with commas (,).

example.com

Functions

string

Yes

A list of features. The format is as follows:

  • functionName (feature name, required): For a list of configurable features, see Feature list.

  • argName (parameter name, required): A parameter for functionName. You can specify multiple parameters.

  • argValue (parameter value, required): The value of the parameter for functionName.

  • parentId (conditional rule ID, optional): You can create conditional rules using the condition function of the rules engine. These rules match and filter user requests based on request parameters. Each conditional rule has a unique configid. You can use this configid as the ParentId parameter to reference the rule in other functions. This lets you combine conditional rules with feature configurations for more flexibility. For more information, see Parameters for domain name configuration features.

If you set parentId to -1, the existing conditional rule in the configuration is deleted.

"functionArgs": [{
   "argName": "Feature Parameter A", 
   "argValue": "Value of Feature Parameter A"
  }, 
{
  "argName": "Feature Parameter B", 
  "argValue": "Value of Feature Parameter B"
   }], 

"functionName": "Feature Name", "parentId": Optional. Corresponds to the configid of the referenced conditional rule. }]

Example configuration without using parentId: The following request parameters show how to use the origin_request_header function to add a header to origin requests:

"functionArgs": [{
           "argName": "header_operation_type",
           "argValue": "add"
       }, {
           "argName": "header_name",
           "argValue": "Accept-Encoding"
       }, {
           "argName": "header_value",
           "argValue": "gzip"
       }, {
           "argName": "duplicate",
           "argValue": "off"
       }],
       "functionName": "origin_request_header"
}]

Example configuration using parentId: The following request parameters show how to use the origin_request_header function to add a header to origin requests by referencing the conditional rule with configid=222728944812032:

        "functionArgs": [{
            "argName": "header_operation_type",
            "argValue": "add"
        }, {
            "argName": "header_name",
            "argValue": "Accept-Encoding"
        }, {
            "argName": "header_value",
            "argValue": "gzip"
        }, {
            "argName": "duplicate",
            "argValue": "off"
        }],
        "functionName": "origin_request_header",
        "parentId": 222728944812032
}]

Example of deleting a parentId reference from a feature configuration: The origin_request_header function already references the conditional rule with configid=222728944812032. To delete the reference, use the following request parameters:

        "functionArgs": [{
            "argName": "header_operation_type",
            "argValue": "add"
        }, {
            "argName": "header_name",
            "argValue": "Accept-Encoding"
        }, {
            "argName": "header_value",
            "argValue": "gzip"
        }, {
            "argName": "duplicate",
            "argValue": "off"
        }],
        "functionName": "origin_request_header",
        "parentId": -1
}]

[{\"functionArgs\":[{\"argName\":\"enable\",\"argValue\":\"on\",\"argName\":\"pri\",\"argValue\":\"1\",\"argName\":\"rule\",\"argValue\":\"xxx\"}],\"functionName\":\"edge_function\"}]

Some features, such as edge_function, allow you to configure multiple records. To update a specific record, use its ConfigId (of the Long type) to specify the configuration that you want to modify. The format is as follows:

[{"functionArgs":[{"argName":"enable","argValue":"on"},{"argName":"pri","argValue":"1"},{"argName":"rule","argValue":"yyy"}],"ConfigId":123456,"functionName":"edge_function"}]

Feature description All parameter values are processed as strings.

Feature name

Parameters

edge_function: Edge Routine

Required parameters:
rule: The DSL rule.
pri: The priority.
enable: Specifies whether to enable the current rule. Valid values: on and off.
Optional parameters:
name: The name of the rule.
pos: The position where the rule is executed. For DCDN domain names, only head is supported. foot is not supported.
brk: If this rule is matched, the remaining rules at the current execution position are skipped.
option: The option control.
grammar: The grammar control. Valid values: empty, es2, and js.
jsmode: The JavaScript (JS) domain name whitelist control. Valid values: redirect and bypass.






























Response parameters

Parameter

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidFunctionName.ValueNotSupported %s %s
400 InvalidArgName.ValueNotSupported %s The name of the %s parameter is invalid.
400 InvalidArgValue.Malformed %s %s
400 InvalidRule.Malformed %s %s
400 ConfigurationConflicts The staging environment has a configuration in effect. You cannot modify the production environment configuration. The configuration exists in the staging environment. You cannot modify the configuration in the production environment.
400 GrayConfigExist A canary configuration already exists under the domain. The domain name already has configurations in canary release.
400 InvalidDomain.BelongToConfigGroup The domain is bound to a configuration group. Modify the domain in the configuration group. The domain name is associated with a configuration group. To modify the configuration of the domain name, you must modify the configuration group.
400 EdgeScriptCountExceedLimit The number of rules exceeds the default limit. The number of rules exceeds the limit. To increase the limit, submit a ticket.
400 EdgeScripOptionsHasInnerConfig The extension has a background configuration or a parameter of this configuration is invalid. For more information, submit a ticket. The extension has a background configuration or a configured parameter is invalid. For more information, submit a ticket.
400 EdgeScriptGrammarNotSupport A background customization rule exists or a parameter of this configuration is invalid. For more information, submit a ticket. A background custom rule exists or a configured parameter is invalid. For more information, submit a ticket.
400 EdgeScriptNotSupportJs JavaScript rules are not supported. For more information, submit a ticket. JavaScript rules are not supported. For more information, submit a ticket.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.