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

# Viewing operations on Yandex Audit Trails resources

The system logs all actions with Audit Trails resources as a list of operations. Each operation gets an ID.

## Getting a list of operations {#get-operations}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), open the folder where the trail resides.
  1. Navigate to **Audit Trails**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/route.svg) **Trails**.
  1. Select the trail you need.
  1. Go to the ![image](../../_assets/console-icons/list-check.svg) **Operations** panel for the selected trail.

     You will see a list of operations with the selected trail.

- 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 a list of operations for a trail, run this command:

  ```bash
  yc audit-trails trail list-operations <trail_name_or_ID>
  ```

  Result:

  ```text
  +----------------------+---------------------+----------------------+---------------------+--------+------------------+
  |          ID          |     CREATED AT      |      CREATED BY      |     MODIFIED AT     | STATUS |   DESCRIPTION    |
  +----------------------+---------------------+----------------------+---------------------+--------+------------------+
  | cnpne9jsof71******** | 2024-03-26 16:57:32 | aje9k8luj4qf******** | 2024-03-26 16:57:32 | DONE   | operation_update |
  | cnp7308f90cf******** | 2024-03-26 16:50:22 | aje9k8luj4qf******** | 2024-03-26 16:50:23 | DONE   | operation_create |
  +----------------------+---------------------+----------------------+---------------------+--------+------------------+
  ```

  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 audit-trails trail list-operations <trail_name_or_ID> --format yaml
  ```

  Result:

  ```text
  - id: cnpne9jsof71********
    description: operation_update
    created_at: "2024-03-26T16:57:32.085739756Z"
    created_by: aje9k8luj4qf********
    modified_at: "2024-03-26T16:57:32.324291102Z"
    done: true
    metadata:
      '@type': type.googleapis.com/yandex.cloud.audittrails.v1.UpdateTrailMetadata
      trail_id: cnpr443sd0c0********
  - id: cnp7308f90cf********
    description: operation_create
    created_at: "2024-03-26T16:50:22.501Z"
    created_by: aje9k8luj4qf********
    modified_at: "2024-03-26T16:50:23.963321235Z"
    done: true
    metadata:
      '@type': type.googleapis.com/yandex.cloud.audittrails.v1.CreateTrailMetadata
      trail_id: cnpr443sd0c0********
  ```

- API {#api}

  Use the [listOperations](../api-ref/Trail/listOperations.md) REST API method for the [Trail](../api-ref/Trail/index.md) resource or the [TrailService/ListOperations](../api-ref/grpc/Trail/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: cnpne9jsof71********
      description: operation_update
      created_at: "2024-03-26T16:57:32.085Z"
      created_by: aje9k8luj4qf********
      modified_at: "2024-03-26T16:57:32.324Z"
      done: true
      metadata:
        '@type': type.googleapis.com/yandex.cloud.audittrails.v1.UpdateTrailMetadata
        trail_id: cnpr443sd0c0********
      response:
        '@type': type.googleapis.com/yandex.cloud.audittrails.v1.Trail
        id: cnpr443sd0c0********
        folder_id: b1g681qpemb4********
        created_at: "2024-03-26T16:50:22.505Z"
        updated_at: "2024-03-26T16:57:32.111Z"
        name: operat-ions
        destination:
          object_storage:
            bucket_id: for-********
            object_prefix: nuts
        service_account_id: ajeevjv1lv01********
        status: ACTIVE
        filter:
          path_filter:
            root:
              any_filter:
                resource:
                  id: b1g681qpemb4********
                  type: resource-manager.folder
          event_filter: {}
        cloud_id: b1gia87mbaom********
      ```

    - API {#api}

      Use 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)