Help Center/ FunctionGraph/ API Reference (ME-Abu Dhabi Region)/ Function Management Zone APIs/ Modifying the Alias Information About a Function Version
Updated on 2022-02-22 GMT+08:00

Modifying the Alias Information About a Function Version

Function

This API is used to modify the alias information about a function version.

URI

PUT /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}

Table 1 describes the URI parameters.

Table 1 URI parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID.

function_urn

String

Yes

Function URN. See Function Model.

alias_name

String

Yes

Function alias.

Request

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

version

String

Yes

New version corresponding to the alias to be modified.

description

String

No

Description of the alias to be modified.

additional_version_weights

String

No

Key-value pair in JSON format to respectively indicate an additional version and a weight.

Response

Table 3 describes the response parameters.
Table 3 Response parameters

Parameter

Type

Description

name

String

Alias to be modified.

version

String

Version corresponding to the alias.

description

String

Description of the alias.

last_modified

String

Time when the alias was last modified.

alias_urn

String

URN of the alias.

additional_version_weights

String

Key-value pair in JSON format to respectively indicate an additional version and a weight.

Example

Example request

PUT /v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:xxxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest/aliases/dev HTTP/1.1 
{ 
  "version":"v20170725-152305", 
  "description": "this is my version alias",
  "additional_version_weights ":{"1.0":10 } 
}

Example response

The format of the response for a successful request is as follows:

HTTP/1.1 200
{ 
    "name": "dev",  
    "version": "latest", 
    "description": "", 
"last_modified": "2017-06-26 03:21:10", 
   "additional_version_weights ":{"1.0":10 }, 
    "alias_urn": "urn:fss:xxxxxxxx: 7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:!dev" 
}

The format of the response for a failed request is as follows:

HTTP/1.1 404 Not Found 
{ 
  "error_code": "FSS.1051", 
  "error_msg": "Not found the function" 
 }

Status Code

See Status Codes.