This operation modifies the configuration of an Edge Routine (ER).
Operation description
You only need to specify the configurations that you want to change. All other configurations will remain unchanged.
To delete a configuration, set the value of the corresponding parameter to empty.
You can use this API to add a canary environment. The environment name must adhere to the specified naming conventions. Otherwise, the configuration will fail.
- The preset canary regions include one region outside China and 34 regions in China:
Region outside China: presetCanaryOverseas.
The 34 regions in China are specified in the format presetCanaryXX. For example, the Beijing region is presetCanaryBeijing. The available regions are: Anhui, Beijing, Chongqing, Fujian, Gansu, Guangdong, Guangxi, Guizhou, Hainan, Hebei, Heilongjiang, Henan, Hong-Kong, Hubei, Hunan, Jiangsu, Jiangxi, Jilin, Liaoning, Macau, Neimenggu, Ningxia, Qinghai, Shaanxi, Shandong, Shanghai, Shanxi, Sichuan, Taiwan, Tianjin, Xinjiang, Xizang, Yunnan, and Zhejiang.
The API call frequency is limited to 100 calls per second.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dcdn:EditRoutineConf |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the Edge Routine. The name must be unique within the same account. |
test-slc |
| Description |
string |
No |
The description of the Edge Routine. |
the description of this routine |
| EnvConf |
object |
No |
The environment configuration. |
{"staging":{"SpecName":"50ms","AllowedHosts":["test-a.alicdn.com","test-b.alicdn.com"]},"production":{"SpecName":"50ms","AllowedHosts":["test-c.alicdn.com","test-d.alicdn.com"]},"presetCanaryZhejiang":{"SpecName":"100ms","AllowedHosts":["test-e.alicdn.com","test-f.alicdn.com"]},"presetCanaryBeijing":{"SpecName":"5ms","AllowedHosts":["test-g.alicdn.com","test-h.alicdn.com"]},"presetCanaryNotExist":{"SpecName":"5ms","CodeRev":"1622446907645949975","AllowedHosts":["error hosts"]}} |
EnvConf fields
Name | Type | Description |
SpecName | String | The CPU time slice. |
CodeRev | String | The version number of the code. |
AllowedHosts | String | The allowed CDN domain names. |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| Content |
object |
A description of the execution error and the latest configuration version number for each environment. |
Description和EnvConfRev |
| RequestId |
string |
The ID of the request. |
BAECB354-6D42-42C1-87DA-C9992EF1E7C8 |
Fields in Content
Name | Type | Example | Description |
Description | String | Validate (Env: presetCanaryNotExist, Error: not valid canary name ) | The description of the routine. |
EnvConfRev | JSON | 1622033526212272495 | The configuration version number for each environment. |
Examples
Success response
JSON format
{
"Content": {
"test": "test",
"test2": 1
},
"RequestId": "BAECB354-6D42-42C1-87DA-C9992EF1E7C8"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | EdgeRoutine.GeneralError | A server error occurred: %s | A server error occurred. Try again later. If the error persists, submit a ticket. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.