[Yandex Cloud documentation](../../index.md) > [Yandex Compute Cloud](../index.md) > [Step-by-step guides](index.md) > Viewing operations on service resources

# 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 {#get-operations}

{% note info %}

Compute Cloud stores data on resource operations for the last two weeks.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  To view operations with all the resources, select ![image](../../_assets/operations.svg) **Operations** in the left-hand panel. This will open the list of all operations, including those on currently deleted resources.
  
  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.

  1. In the [management console](https://console.yandex.cloud), open the folder with the VM.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../_assets/compute/vm-pic.svg) **Virtual machines**.
  1. Select the VM.
  1. Go to the ![image](../../_assets/operations.svg) **Operations** panel for the selected VM.

     This will open the list of operations with the VM and resources connected to it.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) 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 Compute Cloud resource, run this command:

  ```bash
  yc compute <resource_type> list-operations <resource_name_or_ID>
  ```

  **Example**

  Getting a list of operations for a VM:

  ```bash
  yc compute instance list-operations epdplu8jn7sr********
  ```

  Result:

  ```text
  +----------------------+---------------------+----------------------+---------------------+--------+-----------------+
  |          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 output as text. To get more details, use `--format` to specify the `yaml` or `json` output format:

  ```bash
  yc compute instance list-operations epdplu8jn7sr******** --format yaml
  ```

  Result:

  ```text
  - 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: {}
  ```

- API {#api}

  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](../api-ref/Instance/listOperations.md) REST API method for the [Instance](../api-ref/Instance/index.md) resource or the [InstanceService/ListOperations](../api-ref/grpc/Instance/listOperations.md) gRPC API call.

{% endlist %}

## Getting operation details {#get-operations-info}

1. [Get the list of operations](#get-operations) for the resource.
1. Copy the operation ID.
1. Get the operation details:

   {% list tabs group=instructions %}

   - CLI {#cli}

     If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

     The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) 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.

     Run this command:

     ```bash
     yc operation get <operation_ID>
     ```

     Result:

     ```text
     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: {}
     ```

   - API {#api}

     Use the [get](../api-ref/Operation/get.md) REST API method for the [Operation](../api-ref/Operation/index.md) resource or the [OperationService/Get](../api-ref/grpc/Operation/get.md) gRPC API call.

   {% endlist %}

#### Useful links {#see-also}

* [Working with operations](../../api-design-guide/concepts/about-async.md)