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

# Viewing operations with API Gateway resources

The system logs all actions with API Gateway resources as a list of operations. Each operation gets its own unique ID.

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

{% list tabs group=instructions %}

- Management console {#console}

  You can get a list of operations for a specific resource. The steps below describe how you can do this for an API gateway. The same steps apply to other resources as well.

  1. In the [management console](https://console.yandex.cloud), open the folder containing the API gateway.
  1. Navigate to **API Gateway**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/branches-right.svg) **API gateways**.
  1. Select the API gateway you need.
  1. Navigate to the **Operations** tab for the selected API gateway.

     You will see a list of operations with the selected API gateway.

- 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 API Gateway resource, run this command:

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

  **Example**

  Getting a list of operations for an API gateway:

  ```bash
  yc serverless api-gateway list-operations epdplu8jn7sr********
  ```

  Result:

  ```text
  +----------------------+---------------------+----------------------+---------------------+--------+------------------+
  |          ID          |     CREATED AT      |      CREATED BY      |     MODIFIED AT     | STATUS |   DESCRIPTION    |
  +----------------------+---------------------+----------------------+---------------------+--------+------------------+
  | d5d6ja2j20tj******** | 2024-06-21 09:59:41 | aje9k8luj4qf******** | 2024-06-21 09:59:43 | DONE   | operation_update |
  | d5dphtf4p0tp******** | 2024-06-21 09:51:17 | aje9k8luj4qf******** | 2024-06-21 09:51:20 | 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 serverless api-gateway list-operations <API_gateway_name_or_ID> --format yaml
  ```

  Result:

  ```text
  - id: d5d6ja2j20tj********
    description: operation_update
    created_at: "2024-06-21T09:59:41.804Z"
    created_by: aje9k8luj4qf********
    modified_at: "2024-06-21T09:59:43.519Z"
    done: true
    metadata:
      '@type': type.googleapis.com/yandex.cloud.serverless.apigateway.v1.UpdateApiGatewayMetadata
      api_gateway_id: d5dig9e60uco********
  ...
  ```

- API {#api}

  Use the `listOperations` REST API method for the relevant resource or the `<service>/ListOperations` gRPC API call.

  For example, for an API gateway, use either the [listOperations](../apigateway/api-ref/ApiGateway/listOperations.md) REST API method for the [ApiGateway](../apigateway/api-ref/ApiGateway/index.md) resource or the [ApiGatewayService/ListOperations](../apigateway/api-ref/grpc/ApiGateway/listOperations.md) gRPC API call.

{% endlist %}

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

1. [Get a list of operations](#get-operations) for the API gateway.
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: d5dphtf4p0tp********
        description: operation_create
        created_at: "2024-06-21T09:51:17.430Z"
        created_by: aje9k8luj4qf********
        modified_at: "2024-06-21T09:51:20.810Z"
        done: true
        metadata:
          '@type': type.googleapis.com/yandex.cloud.serverless.apigateway.v1.CreateApiGatewayMetadata
          api_gateway_id: d5dig9e60uco********
        response:
          '@type': type.googleapis.com/yandex.cloud.serverless.apigateway.v1.ApiGateway
          id: d5dig9e60uco********
          folder_id: b1g681qpemb4********
          created_at: "2024-06-21T09:51:17.489Z"
          name: operation-logs
          status: ACTIVE
          domain: d5dm1lba80md********.i9******.apigw.yandexcloud.net
          connectivity: {}
          log_options:
            folder_id: b1g681qpemb4********
          execution_timeout: 300s
      ```

    - API {#api}

      Use the [OperationService/Get](../apigateway/api-ref/grpc/Operation/get.md) gRPC API call.

    {% endlist %}

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

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