All Products
Search
Document Center

Function Compute:UpdateAlias

Last Updated:Jun 02, 2023

Updates an alias.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

PUT /2021-04-06/services/{serviceName}/aliases/{aliasName}

Request parameters

ParameterTypeRequiredDescriptionExample
serviceNamestringYes

The name of the service.

demo-service
aliasNamestringYes

The name of the alias.

alias_test
bodyobjectNo

The definition of an alias.

additionalVersionWeightobjectNo

The additional version to which the alias points and the weight of the additional version.

  • The additional version takes effect only when the function is invoked.
  • The value consists of a version number and a specific weight. For example, 2:0.05 indicates that when a function is invoked, Version 2 is the canary release version, 5% of the traffic is distributed to the canary release version, and 95% of the traffic is distributed to the major version.
floatNo

The traffic weight. Valid values: 0 to 1.

1
descriptionstringNo

The description of the alias.

test_description
versionIdstringNo

The ID of the version to which the alias points.

1
resolvePolicystringNo

The canary release mode. Valid values:

  • Random: random canary release. This is the default value.
  • Content: rule-based canary release.
Random
routePolicyRoutePolicyNo

The canary release rule. Traffic that meets the canary release rule is routed to the canary release instance.

If-MatchstringNo

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-IdstringNo

The ID of your Alibaba Cloud account.

188077086902****
X-Fc-DatestringNo

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-IdstringNo

The trace ID of the invocation request of Function Compute.

rid281s******

Response parameters

ParameterTypeDescriptionExample
headersobject
ETagstring

The ETag that is used to modify the alias. The value is used to ensure that the modified alias is consistent with the alias that is expected to be modified.

5e547e5605e1dc17a78a6191bc18fbc5
object

The definition of an alias.

additionalVersionWeightobject

The additional version to which the alias points and the weight of the additional version.

  • The additional version takes effect only when the function is invoked.
  • The value consists of a version number and a specific weight. For example, 2:0.05 indicates that when a function is invoked, Version 2 is the canary release version, 5% of the traffic is distributed to the canary release version, and 95% of the traffic is distributed to the major version.
float

The traffic weight. Valid values: 0 to 1.

1
aliasNamestring

The name of the alias.

test
createdTimestring

The time when the alias was created.

2016-08-15T16:06:05.000+0000
descriptionstring

The description of the alias.

test_description
lastModifiedTimestring

The time when the alias was last modified.

2016-08-15T16:06:05.000+0000
versionIdstring

The ID of the version to which the alias points.

1

Examples

Sample success responses

JSONformat

{
  "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"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-08-04The internal configurations of the API operation change but you can still call the operation.
Change itemChange content
The internal configurations of the API operation change but you can still call the operation.
2021-06-29The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
    Added Input Parameters: X-Fc-Code-Checksum
    Added Input Parameters: X-Fc-Log-Type
    Added Input Parameters: X-Fc-Invocation-Type
    Added Input Parameters: X-Fc-Date
    Added Input Parameters: X-Fc-Trace-Id
2021-06-29The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
2021-06-29The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    delete Input Parameters: X-Fc-Account-Id