Sets environment variables for a Routine.
Operation description
If you do not specify StartTime and EndTime, this operation returns data from the past 24 hours. If you specify StartTime and EndTime, this operation returns data for the specified time range.
- The time granularity of returned data varies based on the time range specified by StartTime and EndTime.
If the time range is less than or equal to 3 hours, data is returned at a 1-minute granularity.
If the time range is greater than 3 hours and less than or equal to 1 day, data is returned at a 5-minute granularity.
If the time range is greater than 1 day and less than or equal to 10 days, data is returned at an hourly granularity.
If the time range is greater than 10 days and less than or equal to 31 days, data is returned at a daily granularity.
Try it now
Test
RAM authorization
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The function name. |
er_test |
| Env |
string |
Yes |
The environment name. Valid values:
|
production |
| EnvironmentVariables |
object |
Yes |
The dictionary of environment variables. The key is the environment variable name, and the value is the environment variable value. |
"EnvironmentVariables": { "Env_Key_1": { "Type": "plain_text", "Value": "value" }, "PASSWORD": { "Type": "secret_text", "Value": "secret-password" } } |
|
object |
Yes |
A single environment variable object. |
||
| Type |
string |
Yes |
The variable type. Valid values:
Valid values:
|
plain_text |
| Value |
string |
No |
The variable value string. |
value |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
15C66C7B-671A-4297-9187-2C4477247A74 |
| SetKeys |
array |
The list of environment variable keys that were set successfully. |
["key1","key2"] |
|
string |
The environment variable key. |
"key1" |
Examples
Success response
JSON format
{
"RequestId": "15C66C7B-671A-4297-9187-2C4477247A74",
"SetKeys": [
"\"key1\""
]
}
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. |
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InternalOperationError | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
| 400 | UserOperationStatusIsLocked | You are calling an another routine related api. Please wait for the api finished, and try again later. | You are calling an another routine related api. Please wait for the api finished, and try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.