Viewing operations with Compute Cloud resources
The system logs all actions with Compute Cloud resources as a list of operations. Each operation gets its own unique ID.
Getting a list of operations
Note
Compute Cloud stores data on resource operations for the last two weeks.
To view operations with all the resources, select
Operations in the left-hand panel. In the list that opens, you will also see operations with the resources that were deleted.You can get a list of operations for a specific resource. The steps below describe how you can do this for a VM. The same steps apply to other resources as well.
-
In the management console
, open the folder with the VM. -
Select Compute Cloud.
-
In the left-hand panel, select
Virtual machines. -
Select the VM.
-
Go to the
Operations panel for the selected VM.The list that opens shows operations with the selected VM and the resources connected to it.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
To get the list of operations for the Compute Cloud resource, run this command:
yc compute <resource_type> list-operations <resource_name_or_ID>
Example
Getting a list of operations for a VM:
yc compute instance list-operations epdplu8jn7sr********
Result:
+----------------------+---------------------+----------------------+---------------------+--------+-----------------+
| ID | CREATED AT | CREATED BY | MODIFIED AT | STATUS | DESCRIPTION |
+----------------------+---------------------+----------------------+---------------------+--------+-----------------+
| epd2ohv6ur6a******** | 2023-10-20 08:34:01 | ajeef73j5iq9******** | 2023-10-20 08:34:05 | DONE | Update instance |
| epd2lcg5na2r******** | 2023-10-20 08:32:28 | ajeef73j5iq9******** | 2023-10-20 08:32:55 | DONE | Stop instance |
+----------------------+---------------------+----------------------+---------------------+--------+-----------------+
By default, operation information is displayed as text. To get more detailed information, specify the yaml
or json
output data format using the --format
parameter:
yc compute instance list-operations epdplu8jn7sr******** --format yaml
Result:
- id: epd2ohv6ur6a********
description: Update instance
created_at: "2023-10-20T08:34:01Z"
created_by: ajeef73j5iq9********
modified_at: "2023-10-20T08:34:05Z"
done: true
metadata:
'@type': type.googleapis.com/yandex.cloud.compute.v1.UpdateInstanceMetadata
instance_id: epdplu8jn7sr********
response:
'@type': type.googleapis.com/yandex.cloud.compute.v1.Instance
id: epdplu8jn7sr********
folder_id: b1g86q4m5vej********
created_at: "2023-10-02T13:19:45Z"
name: rewq
zone_id: ru-central1-a
platform_id: standard-v3
resources:
memory: "2147483648"
cores: "2"
core_fraction: "100"
status: STOPPED
...
- id: epd2lcg5na2r********
description: Stop instance
created_at: "2023-10-20T08:32:28Z"
created_by: ajeef73j5iq9********
modified_at: "2023-10-20T08:32:55Z"
done: true
metadata:
'@type': type.googleapis.com/yandex.cloud.compute.v1.StopInstanceMetadata
instance_id: epdplu8jn7sr********
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 VM, use either the listOperations REST API method for the Instance resource or the InstanceService/ListOperations gRPC API call.
Getting detailed information about an operation
-
Get a list of operations for the resource.
-
Copy the operation ID.
-
Get operation details:
CLIAPIIf you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the
yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the--folder-name
or--folder-id
parameter.Run this command:
yc operation get <operation_ID>
Result:
id: ef3ovrdqhhf9******** description: Delete instance created_at: "2023-10-17T16:08:10Z" created_by: ajejisqqifen******** modified_at: "2023-10-17T16:08:41Z" done: true metadata: '@type': type.googleapis.com/yandex.cloud.compute.v1.DeleteInstanceMetadata instance_id: ef3su74qmfp4******** response: '@type': type.googleapis.com/google.protobuf.Empty value: {}
Use the get REST API method for the Operation resource or the OperationService/Get gRPC API call.