Help Center> FunctionGraph> API Reference> Function Management Zone API> Modifying the Alias Information About a Function Version

Modifying the Alias Information About a Function Version

Function

This API is used to modify the alias information about a function version. You can use the additional_version_weights field to enable the additional version.

URI

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

Table 1 Path parameters

Parameter

Mandatory

Type

Description

function_urn

Yes

String

Function URN.

alias_name

Yes

String

Alias to be updated.

project_id

Yes

String

Tenant's project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

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

Table 3 Response body parameters

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

PUT https://{functiongraph_endpoint}/v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:xxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest/aliases/ttttt

{
  "version" : "v20170725-152305",
  "description" : "this is my version alias",
  "additional_version_weights" : {
    "1.0" : 10
  }
}

Example Responses

Status code: 200

OK

{
  "name" : "dev",
  "version" : "v20170725-152305",
  "description" : "this is my version alias",
  "last_modified" : "2019-10-31T11:37:58+08:00",
  "alias_urn" : "urn:fss:cn-north-7:46b6f338fc3445b8846c71dfb1fbd9e8:function:default:xxxxx:!a1",
  "additional_version_weights" : {
    "1.0" : 10
  }
}

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.