Viewing operations with Cloud Functions resources
The system logs all actions with Cloud Functions resources as a list of operations. Each operation gets its own unique ID.
Getting a list of operations
You can get a list of operations for a specific resource. The steps below describe how you can do this for a function. The same steps apply to other resources as well.
-
In the management console
, open the folder with the function. -
Go to Cloud Functions.
-
In the left-hand panel, select
Functions. -
Select the function.
-
Go to the
Operations panel for the selected function.You will see a list of operations with the selected function.
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 the list of operations for the Cloud Functions resource, run this command:
yc serverless <resource_type> list-operations <resource_name_or_ID>
Example
Getting a list of operations for a function:
yc serverless function list-operations epdplu8jn7sr********
Result:
+----------------------+---------------------+----------------------+---------------------+--------+-----------------+
| ID | CREATED AT | CREATED BY | MODIFIED AT | STATUS | DESCRIPTION |
+----------------------+---------------------+----------------------+---------------------+--------+-----------------+
| d4e952nebqdb******** | 2024-06-19 08:33:11 | aje9k8luj4qf******** | 2024-06-19 08:33:12 | DONE | Create session |
| d4elh7hqnj7g******** | 2024-06-19 08:33:04 | aje9k8luj4qf******** | 2024-06-19 08:33:04 | DONE | Create function |
+----------------------+---------------------+----------------------+---------------------+--------+-----------------+
By default, information about operations is output as text. To get more details, specify yaml or json for the output data using --format:
yc serverless function list-operations <resource_name_or_ID> --format yaml
Result:
- id: d4e952nebqdb********
description: Create session
created_at: "2024-06-19T08:33:11.658Z"
created_by: aje9k8luj4qf********
modified_at: "2024-06-19T08:33:12.345Z"
done: true
metadata:
'@type': type.googleapis.com/google.protobuf.Empty
value: {}
response:
'@type': type.googleapis.com/google.protobuf.Empty
value: {}
...
Use the listOperations REST API method for the relevant resource or the <service>/ListOperations gRPC API call.
For example, for a function, use either the listOperations REST API method for the Function resource or the FunctionService/ListOperations gRPC API call.
Getting operation details
-
Get a list of operations for the resource.
-
Copy the operation ID.
-
Get operation details:
CLIAPIIf 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-nameor--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.Run this command:
yc operation get <operation_ID>Result:
id: d4elh7hqnj7g******** description: Create function created_at: "2024-06-19T08:33:04.513Z" created_by: aje9k8luj4qf******** modified_at: "2024-06-19T08:33:04.665Z" done: true metadata: '@type': type.googleapis.com/yandex.cloud.serverless.functions.v1.CreateFunctionMetadata function_id: d4e3f75v8kti******** response: '@type': type.googleapis.com/yandex.cloud.serverless.functions.v1.Function id: d4e3f75v8kti******** folder_id: b1g681qpemb4******** created_at: "2024-06-19T08:33:04.587Z" name: my-db-function http_invoke_url: https://functions.yandexcloud.net/d4e3f75v8kti******** status: ACTIVEUse the OperationService/Get gRPC API call.