You can call this operation to update an alias.
Debugging
Request headers
This operation uses only common request headers. For more information, see Common parameters.
Request syntax
PUT /services/{serviceName}/aliases/{aliasName}
Request parameters
| Parameter | Type | Position | Required | Example | Description |
| serviceName | String | Path | Yes | service_name | The name of the service. |
| aliasName | String | Path | Yes | alias_test | The name of the alias. |
| Object | Body | No | The definition of the alias. |
||
| additionalVersionWeight | Map | Body | No | The additional version to which the alias points and the weight of the additional version.
|
|
| Float | Body | No | 1 | The traffic weight. Valid values: 0 to 1. |
|
| description | String | Body | No | test_description | The description of the alias. |
| versionId | String | Body | No | 2 | The version to which the alias points. |
Response parameters
| Parameter | Type | Example | Description |
| additionalVersionWeight | Map | The additional version to which the alias points and the weight of the additional version.
|
|
| Float | 1 | The traffic weight. Valid values: 0 to 1. |
|
| aliasName | String | alias_test | The name of the alias. |
| createdTime | String | 2020-07-27T06:37:29Z | The time when the alias was created. |
| description | String | test_description | The description of the alias. |
| lastModifiedTime | String | 2020-07-27T06:37:29Z | The last time when the alias was updated. |
| serviceName | String | service_name | The name of the service. |
| versionId | String | 2 | The version to which the alias points. |
Examples
Sample requests
PUT /2016-08-15/services/service_name/aliases/alias_test HTTP/1.1
Common request headers
{
"versionId":"2",
"description":"test_description"
}
Sample success responses
JSON format
HTTP/1.1 200 OK
Common response headers
{
"aliasName": "alias_test",
"versionId": "2",
"description": "test_description",
"additionalVersionWeight": null,
"createdTime": "2020-07-27T06:37:29Z",
"lastModifiedTime": "2020-07-27T06:37:29Z"
}
Error codes
For a list of error codes, visit the API Error Center.