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

# Viewing operations with Key Management Service resources

The system logs all actions with Key Management Service 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}

  Below, you can learn how to get a list of operations for a symmetric key. The same steps apply to other resources.

  1. In the [management console](https://console.yandex.cloud), open the folder containing the symmetric key.
  1. Navigate to **Key Management Service**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/key.svg) **Symmetric keys**.
  1. Select the key you need.
  1. Go to the ![image](../../_assets/console-icons/list-check.svg) **Operations** panel for the selected key.

     You will see a list of operations with the selected symmetric key.

- 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 Key Management Service resource, run this command:

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

  **Example**

  Getting a list of operations for the symmetric key:

  ```bash
  yc kms symmetric-key list-operations epdplu8jn7sr********
  ```

  Result:

  ```text
  +----------------------+---------------------+----------------------+---------------------+--------+----------------------+
  |          ID          |     CREATED AT      |      CREATED BY      |     MODIFIED AT     | STATUS |     DESCRIPTION      |
  +----------------------+---------------------+----------------------+---------------------+--------+----------------------+
  | abji19ucm6b1******** | 2024-03-26 10:33:12 | aje9k8luj4qf******** | 2024-03-26 10:33:12 | DONE   | update key           |
  | abjluv2sk1sp******** | 2024-03-26 10:19:52 | aje9k8luj4qf******** | 2024-03-26 10:19:52 | DONE   | create symmetric key |
  +----------------------+---------------------+----------------------+---------------------+--------+----------------------+
  ```

  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 kms symmetric-key list-operations epdplu8jn7sr******** --format yaml
  ```

  Result:

  ```text
  - id: abji19ucm6b1********
    description: update key
    created_at: "2024-03-26T10:33:12.360289758Z"
    created_by: aje9k8luj4qf********
    modified_at: "2024-03-26T10:33:12.360314054Z"
    done: true
    metadata:
      '@type': type.googleapis.com/yandex.cloud.kms.v1.UpdateSymmetricKeyMetadata
      key_id: abjip2tl1frh********
    response:
      '@type': type.googleapis.com/google.protobuf.Empty
      value: {}
  - id: abjluv2sk1sp********
    description: create symmetric key
    created_at: "2024-03-26T10:19:52.794225911Z"
    created_by: aje9k8luj4qf********
    modified_at: "2024-03-26T10:19:52.794265993Z"
    done: true
    metadata:
      '@type': type.googleapis.com/yandex.cloud.kms.v1.CreateSymmetricKeyMetadata
      key_id: abjip2tl1frh********
      primary_version_id: abjg82vbog68********
    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, to obtain a list of operations for a symmetric key, use either the REST API [listOperations](../api-ref/SymmetricKey/listOperations.md) for the [SymmetricKey](../api-ref/SymmetricKey/index.md) resource or the [SymmetricKeyService/ListOperations](../api-ref/grpc/SymmetricKey/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: abji19ucm6b1********
      description: update key
      created_at: "2024-03-26T10:33:12.360Z"
      created_by: aje9k8luj4qf********
      modified_at: "2024-03-26T10:33:12.360Z"
      done: true
      metadata:
        '@type': type.googleapis.com/yandex.cloud.kms.v1.UpdateSymmetricKeyMetadata
        key_id: abjip2tl1frh********
      response:
        '@type': type.googleapis.com/yandex.cloud.kms.v1.SymmetricKey
        id: abjip2tl1frh********
        folder_id: b1g681qpemb4********
        created_at: "2024-03-26T10:19:52Z"
        name: sym-key
        status: ACTIVE
        primary_version:
          id: abjg82vbog68kv5jvj6s
          key_id: abjip2tl1frh********
          status: ACTIVE
          algorithm: AES_256
          created_at: "2024-03-26T10:19:52Z"
          primary: true
        default_algorithm: AES_192
      ```

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