Updating a function
You can change the name and description of a function as well as manage function labels. To change the code or operation parameters of a function, create a new version of the function.
To access a function, use its name or unique ID. To find them, get a list of functions in a folder.
Changing the name of a function
- In the management console, go to the folder where you want to change the name of a function.
- Open Cloud Functions.
- Select a function.
- In the upper-right corner, click Edit.
- In the window that opens, enter the desired function name.
- Click Save.
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change the function name, run the command:
yc serverless function update <function name> --new-name <new function name>
Result:
id: b097d9ous3gep99khe83
folder_id: aoek49ghmknnpj1ll45e
created_at: "2019-06-06T11:36:48.688Z"
name: my-beta-function
labels:
test: test
log_group_id: eolv6578frac08uh5h6s
http_invoke_url: https://functions.yandexcloud.net/b097d9ous3gep99khe83
status: ACTIVE
You can change the function name using the API method update.
Updating the description of a function
- In the management console, go to the folder where you want to change the description of a function.
- Open Cloud Functions.
- Select a function.
- In the upper-right corner, click Edit.
- In the window that opens, enter the description of the function.
- Click Save.
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To update the description of a function, run the command:
yc serverless function update <function name> --description "<function description>"
Result:
id: b097d9ous3gep99khe83
folder_id: aoek49ghmknnpj1ll45e
created_at: "2019-06-06T11:36:48.688Z"
name: my-beta-function
description: My beta function.
labels:
test: test
log_group_id: eolv6578frac08uh5h6s
http_invoke_url: https://functions.yandexcloud.net/b097d9ous3gep99khe83
status: ACTIVE
You can update the description of a function using the API method update.
Managing function labels
You can perform the following actions with function labels:
Adding a label
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To add a label to a function, run the command:
yc serverless function add-labels <function name> --labels <key>=<value>
Result:
id: b097d9ous3gep99khe83
folder_id: aoek49ghmknnpj1ll45e
created_at: "2019-06-06T11:36:48.688Z"
name: my-beta-function
description: My beta function.
labels:
test: test
version: beta
log_group_id: eolv6578frac08uh5h6s
http_invoke_url: https://functions.yandexcloud.net/b097d9ous3gep99khe83
status: ACTIVE
You can add a label to a function using the API method update.
Updating a label
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To update a label of a function, run the command:
Warning
The existing set of labels
is completely replaced by the set transmitted.
yc serverless function update <function name> --labels <key>=<value>
Result:
id: b097d9ous3gep99khe83
folder_id: aoek49ghmknnpj1ll45e
created_at: "2019-06-06T11:36:48.688Z"
name: my-beta-function
description: My beta function.
labels:
new_labels: my-beta-function
log_group_id: eolv6578frac08uh5h6s
http_invoke_url: https://functions.yandexcloud.net/b097d9ous3gep99khe83
You can edit labels of a function using the API method update.
Deleting a label
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To delete a function label, run the command:
yc serverless function remove-labels <function name> --labels <key>
Result:
id: b097d9ous3gep99khe83
folder_id: aoek49ghmknnpj1ll45e
created_at: "2019-06-06T11:36:48.688Z"
name: my-beta-function
description: My beta function.
labels:
version: beta
log_group_id: eolv6578frac08uh5h6s
http_invoke_url: https://functions.yandexcloud.net/b097d9ous3gep99khe83
status: ACTIVE
You can delete a function label using the API method update.