Creating an Alias for a Function Version
Function
This API is used to create an alias for a function version.
URI
POST /v2/{project_id}/fgs/functions/{function_urn}/aliases
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
function_urn |
Yes |
String |
Function URN. |
|
project_id |
Yes |
String |
Tenant's project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Alias name. |
|
version |
Yes |
String |
Version corresponding to the alias. |
|
description |
No |
String |
Description of the alias. |
|
additional_version_weights |
No |
Object |
Additional version configuration. Key indicates the name of the additional version, which cannot be LATEST. The value is the percentage (1% to 99%) of traffic to be forwarded to the additional version. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Alias name. |
|
description |
String |
Description of the alias. |
|
version |
String |
Version corresponding to the alias. |
|
last_modified |
String |
Latest update time. |
|
alias_urn |
String |
Alias URN. |
|
additional_version_weights |
Object |
Additional version configuration. Key indicates the name of the additional version, which cannot be LATEST. The value is the percentage (1% to 99%) of traffic to be forwarded to the additional version. |
Example Requests
POST https://{functiongraph_endpoint}/v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:xxxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest/aliases
{
"name" : "a1",
"version" : "latest",
"description" : ""
}
Example Responses
Status code: 200
OK
{
"name" : "a1",
"version" : "latest",
"description" : "",
"last_modified" : "2019-10-31T11:37:58+08:00",
"alias_urn" : "urn:fss:cn-north-7:46b6f338fc3445b8846c71dfb1fbd9e8:function:default:xxxxx:!a1"
}
Status code: 404
Not Found
{
"error_code" : "FSS.1051",
"error_msg" : "Not found the function"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
404 |
Not Found |
Error Codes
See Error Codes.
Last Article: Querying All Version Aliases of a Function
Next Article: Deleting an Alias of a Function Version
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.