Viewing operations with the service's resources
All actions with Compute Cloud resources are logged as a list of operations. Each operation is assigned a unique ID.
Getting a list of operations
Note
Compute Cloud stores resource operations for the last two weeks.
To view all operations with the resources, in the left-hand panel, select
Operations. 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 service resources.
-
In the management console
, open the folder the VM is in. -
Select Compute Cloud.
-
In the left-hand panel, select
Virtual machines. -
Select the VM you need.
-
Go to the
Operations panel for the selected VM.The list that opens shows the operations for the selected VM and the resources attached to it.
If you do not 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 get a list of operations for an Compute Cloud resource, run this command:
yc compute <resource_type> list-operations <resource_name_or_ID>
Example
Get 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, information about operations is provided as text. To get detailed information, specify the yaml
or json
output data format using the --format
flag:
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, to obtain a list of operations 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 ID of the operation.
-
Get detailed information about the operation:
CLIAPIIf you do not 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.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.