Backups in Cloud Functions
Data in Cloud Functions is stored securely and replicated within the Yandex Cloud infrastructure. You can get:
- Lists of functions.
- Lists of function versions.
- Information about function versions.
- Lists of triggers.
- Information about triggers.
Getting a list of functions
- In the management console
, go to the folder where you want to view a list of functions. - Go to Cloud Functions.
- In the left-hand panel, select
Functions.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To get a list of functions, run this command:
yc serverless function list
Result:
+----------------------+--------------------+----------------------+--------+
| ID | NAME | FOLDER ID | STATUS |
+----------------------+--------------------+----------------------+--------+
| b097d9ous3ge******** | my-beta-function | aoek49ghmknn******** | ACTIVE |
+----------------------+--------------------+----------------------+--------+
To get a list of functions, use the list REST API method for the Function resource or the FunctionsService/List gRPC API call.
Getting a list of function versions
- In the management console
, navigate to the folder containing the function. - Go to Cloud Functions.
- In the left-hand panel, select
Functions. - Select the function for which you want to get the list of versions.
- Under Version history, you will see the list of function versions and their details.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To find out the name or ID of a function, get the list of functions in the folder.
To get a list of function versions, run the following command:
yc serverless function version list --function-name <function_name>
Result:
+----------------------+----------------------+-----------+--------------+---------+---------------------+
| ID | FUNCTION ID | RUNTIME | ENTRYPOINT | TAGS | CREATED AT |
+----------------------+----------------------+-----------+--------------+---------+---------------------+
| b09u830mb1n3******** | b097d9ous3ge******** | python311 | test.handler | $latest | 2023-08-22 09:23:23 |
| b09ch6pmpohf******** | b097d9ous3ge******** | python311 | test.handler | beta | 2023-08-22 09:12:38 |
+----------------------+----------------------+-----------+--------------+---------+---------------------+
To get a list of function versions, use the listVersions REST API method for the Function resource or the FunctionsService/ListVersions gRPC API call.
Getting information about a function version
Warning
There is no backup of function code. We recommend saving it on your own.
- In the management console
, navigate to the folder containing the function. - Go to Cloud Functions.
- In the left-hand panel, select
Functions. - Select the function for which you want to get the list of versions.
- Under Version history, you will see the list of function versions and their details.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To find out the name or ID of a function version, get the list of function versions in the folder.
To get detailed information about a function version by:
-
ID, run this command:yc serverless function version get <version_ID>Result:
id: b09u830mb1n3******** function_id: b097d9ous3ge******** created_at: "2023-08-22T09:23:23.383Z" runtime: python311 entrypoint: test.handler resources: memory: "134217728" execution_timeout: 5s image_size: "4096" status: ACTIVE tags: - $latest log_group_id: eolv6578frac******** -
TAGS, run this command:yc serverless function version get-by-tag --function-name <function_name> --tag <tag>Result:
id: b09ch6pmpohf******** function_id: b097d9ous3ge******** created_at: "2023-08-22T09:12:38.464Z" runtime: python311 entrypoint: test.handler resources: memory: "134217728" execution_timeout: 5s image_size: "4096" status: ACTIVE tags: - beta log_group_id: eolv6578frac********
To get detailed information about a function version, use the getVersion REST API method for the Function resource or the FunctionsService/GetVersion gRPC API call.
Getting a list of triggers
- In the management console
, go to the folder where you want to view a list of triggers. - Go to Cloud Functions.
- In the left-hand panel, select
Triggers.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
Get a list of triggers:
yc serverless trigger list
Result:
+----------------------+------------+----------------------+
| ID | NAME | FOLDER ID |
+----------------------+------------+----------------------+
| dd0gj5tsj2********** | my-trigger | aoek49ghmk********** |
+----------------------+------------+----------------------+
To get a list of triggers, use the list REST API method for the Trigger resource or the TriggerService/List gRPC API call.
Getting information about a trigger
- In the management console
, navigate to the folder containing the trigger. - Go to Cloud Functions.
- In the left-hand panel, select
Triggers. - Select the trigger you want to get details about.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To find out the name or ID of a trigger, get the list of triggers in the folder.
Get detailed information about a trigger:
yc serverless trigger get <trigger_name>
Result:
id: a1s9q2li6t**********
folder_id: b1g9hv2loa**********
created_at: "2023-08-01T12:36:14.321Z"
name: my-trigger
description: Trigger for uploaded objects
rule:
object_storage:
event_type:
- OBJECT_STORAGE_EVENT_TYPE_CREATE_OBJECT
bucket_id: **********
batch_settings:
size: "10"
cutoff: 10s
invoke_function:
function_id: d4e5muirrt**********
function_tag: $latest
service_account_id: ajek0fou8e**********
status: ACTIVE
To get detailed information about a trigger, use the get REST API method for the Trigger resource or the TriggerService/Get gRPC API call.