Updates an alias.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
fc:UpdateAlias | update |
|
| none |
Request syntax
PUT /2021-04-06/services/{serviceName}/aliases/{aliasName} HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
serviceName | string | Yes | The name of the service. | demo-service |
aliasName | string | Yes | The name of the alias. | alias_test |
body | object | No | The definition of the alias. | |
additionalVersionWeight | object | No | The canary release version to which the alias points and the weight of the canary release version.
| |
float | No | The traffic weight. Valid values: 0 to 1. | 1 | |
description | string | No | The description of the alias. | test_description |
versionId | string | No | The ID of the version to which the alias points. | 1 |
resolvePolicy | string | No | The canary release mode. Default values: off. Valid values:
| Random |
routePolicy | RoutePolicy | No | The canary release rule. Traffic that meets the canary release rule is routed to the canary release instance. | |
If-Match | string | No | If the ETag specified in the request matches the ETag value of the object, the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. The ETag value of an object is used to check data integrity of the object. This parameter is empty by default. | e19d5cd5af0378da05f63f891c7467af |
X-Fc-Account-Id | string | No | The ID of your Alibaba Cloud account. | 188077086902**** |
X-Fc-Date | string | No | The time on which the function is invoked. The format of the value 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 invocation request of Function Compute. | rid281s****** |
Response parameters
Examples
Sample success responses
JSON
format
{
"additionalVersionWeight": {
"key": 1
},
"aliasName": "test",
"createdTime": "2016-08-15T16:06:05.000+0000",
"description": "test_description",
"lastModifiedTime": "2016-08-15T16:06:05.000+0000",
"versionId": "1",
"resolvePolicy": "Random",
"routePolicy": {
"condition": "AND",
"policyItems": [
{
"type": "Header",
"key": "x-test-uid",
"value": "11111",
"operator": "="
}
]
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-12-28 | The response structure of the API has changed | View Change Details |
2022-08-04 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2021-06-29 | The request parameters of the API has changed | View Change Details |
2021-06-29 | The request parameters of the API has changed | View Change Details |
2021-06-29 | The request parameters of the API has changed | View Change Details |