Creates an alias.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
fc:CreateAlias |
create |
*All Resource
|
None | None |
Request syntax
POST /2021-04-06/services/{serviceName}/aliases HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| serviceName |
string |
Yes |
The name of the service. |
service_name |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The definition of the alias. |
|
| additionalVersionWeight |
object |
No |
The canary release version and the corresponding weight that the alias points to.
|
|
|
number |
No |
The traffic weight. Valid values: [0,1]. |
1 |
|
| aliasName |
string |
Yes |
The name of the alias. The name can contain only letters, digits, underscores (_), and hyphens (-). The name cannot start with a digit or hyphen (-). The name must be 1 to 128 characters in length and cannot be LATEST. |
alias_test |
| description |
string |
No |
The description of the alias. |
test_description |
| versionId |
string |
Yes |
The version ID that the alias points to. |
1 |
| resolvePolicy |
string |
No |
The canary release mode. Valid values:
|
Random |
| routePolicy | RoutePolicy |
No |
The canary release rule. Traffic that meets the canary release rule is routed to the canary release instance. |
|
| X-Fc-Account-Id |
string |
No |
The ID of your Alibaba Cloud account. |
188077086902**** |
| X-Fc-Date |
string |
No |
The start date when the function is invoked. The format is EEE,d MMM yyyy HH:mm:ss GMT. |
Wed, 11 May 2022 09:00:00 GMT |
| X-Fc-Trace-Id |
string |
No |
The trace ID of the Function Compute invocation request. |
r9s89isisi**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The definition of the alias. |
||
| additionalVersionWeight |
object |
The canary release version and the corresponding weight that the alias points to.
|
|
|
number |
The traffic weight. Valid values: [0,1]. |
1 |
|
| aliasName |
string |
The name of the alias. |
alias_test |
| createdTime |
string |
The time when the alias was created. |
2020-04-23T06:32:43Z |
| description |
string |
The description of the alias. |
test_description |
| lastModifiedTime |
string |
The time when the alias was last updated. |
2020-04-23T06:32:43Z |
| versionId |
string |
The version ID that the alias points to. |
1 |
| resolvePolicy |
string |
The canary release mode. Valid values:
|
Random |
| routePolicy | RoutePolicy |
The canary release rule. Traffic that meets the canary release rule is routed to the canary release instance. |
Examples
Success response
JSON format
{
"additionalVersionWeight": {
"key": 1
},
"aliasName": "alias_test",
"createdTime": "2020-04-23T06:32:43Z",
"description": "test_description",
"lastModifiedTime": "2020-04-23T06:32:43Z",
"versionId": "1",
"resolvePolicy": "Random",
"routePolicy": {
"condition": "AND",
"policyItems": [
{
"type": "Header",
"key": "x-test-uid",
"value": "11111",
"operator": "="
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.