[Yandex Cloud documentation](../../index.md) > [Yandex MetaData Hub](../index.md) > Connection Manager > Step-by-step guides > Viewing a connection

# Viewing connection information


## Getting a list of connections {#connection-list}


{% note info %}

The connection list only displays those connections to which the user has access (the [`connection-manager.auditor`](../security/connection-manager-roles.md#connection-manager-auditor) or [`connection-manager.viewer`](../security/connection-manager-roles.md#connection-manager-viewer) role). A user with access permissions for a folder will be able to view all connections in that folder.

{% endnote %}


{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
  1. [Go](../../console/operations/select-service.md#select-service) to **Yandex MetaData Hub**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/plug-connection.svg) **Connection manager**.

- 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 connections:

  1. See the description of the CLI command for getting a list of connections:

      ```bash
      yc metadata-hub connection-manager connection list --help
      ```

  1. Get the list of connections by running this comand:
      
      ```bash
      yc metadata-hub connection-manager connection list
      ```

      To get only specific connections, provide one or more flags in the command:

      * `--db-type`: Database type. Possible values: `postgresql`, `mysql`, `clickhouse`, `mongodb`, `kafka`, `redis`, `opensearch`, `trino`, `valkey`, `greenplum`.

      * `--is-manual`: Connections created manually.

      * `--mdb-cluster-id`: Cluster ID.

      * `--is-on-premise`: Connections to custom installations.
      
      For example, to get the connections to custom `mysql` DB installations, run this command:
      
      ```bash
      yc metadata-hub connection-manager connection list \
        --db-type mysql \
        --is-on-premise
      ```

- API {#api}

  To get the list of Connection Manager connections in the default folder, use the [Connection.List](../connection-manager/api-ref/Connection/list.md) REST API method or the [ConnectionService.List](../connection-manager/api-ref/grpc/Connection/list.md) gRPC API method.

  To view the list of connections in a different folder, provide the folder ID in the request. [Learn more about how to get a folder ID](../../resource-manager/operations/folder/get-id.md).

{% endlist %}

## Viewing connection information {#connection-get}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
  1. [Go](../../console/operations/select-service.md#select-service) to **Yandex MetaData Hub**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/plug-connection.svg) **Connection manager**.
  1. Click the line with the connection to view its details.

- 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 information about a connection:
  
  1. See the description of the CLI command for getting information about a connection:

      ```bash
      yc metadata-hub connection-manager connection get --help
      ```

  1. Get information about a connection by running this command:
      
      ```bash
      yc metadata-hub connection-manager connection get <connection_ID>
      ```

      You can get the connection ID with the [list of connections](#connection-list) in the folder.

- API {#api}
  
  To get information about a Connection Manager connection, use the [Connection.Get](../connection-manager/api-ref/Connection/get.md) REST API method or the [ConnectionService.Get](../connection-manager/api-ref/grpc/Connection/get.md) gRPC API method and provide the connection ID in the request.

  You can get the connection ID with the [list of connections](view-connection.md#connection-list) in the folder.

{% endlist %}

## Viewing connection dependencies {#dependencies}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
  1. [Go](../../console/operations/select-service.md#select-service) to **Yandex MetaData Hub**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/plug-connection.svg) **Connection manager** and click the name of the connection you need.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/nodes-right.svg) **Dependencies**.

     The [dependency](../concepts/connection-manager.md#dependencies) list shows managed database clusters and service instances that use Connection Manager to store connection information. Click a line in the dependency list to go to a cluster or service instance.

- 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 information about connection dependencies:
  
  1. See the description of the CLI command for getting information about command dependencies:

      ```bash
      yc metadata-hub connection-manager connection resolve-cluster --help
      ```

  1. Get information about connection dependencies by running this command:
      
      ```bash
      yc metadata-hub connection-manager connection resolve-cluster <connection_ID>
      ```

      You can get the connection ID with the [list of connections](#connection-list) in the folder.

      {% note info %}
      
      For connections to managed database clusters, the `resolve-cluster` command returns the cluster topology. For connections to custom database installations, it returns the same information as the [get](#connection-get) command.
      
      {% endnote %}

- API {#api}
  
  To get information about Connection Manager connection dependencies, use the [Connection.ResolveCluster](../connection-manager/api-ref/Connection/resolveCluster.md) REST API method or the [ConnectionService.ResolveCluster](../connection-manager/api-ref/grpc/Connection/resolveCluster.md) gRPC API method and provide the connection ID in the request.

  You can get the connection ID with the [list of connections](view-connection.md#connection-list) in the folder.

  {% note info %}

  For connections to managed database clusters, the `ResolveCluster` method returns the cluster topology. For connections to custom database installations, it returns the same information as the [Get](view-connection.md#connection-get) method.

  {% endnote %}

{% endlist %}

## Viewing the history of operations {#operations}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
  1. [Go](../../console/operations/select-service.md#select-service) to **Yandex MetaData Hub**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/plug-connection.svg) **Connection manager** and click the name of the connection you need.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/list-check.svg) **Operations**.

     In the list of operations, you can view all the operations for the selected connection since its creation:

     * `Create`: Connection created.
     * `Update`: Connection updated.
     * `Delete`: Connection deleted.
     * `Set access bindings`: Connection user roles assigned.
     * `Update access bindings`: Connection user roles updated.

     You can also view the technical operations:

     * `Bump version`: Secret version for MDB connections updated.
     * `Update references`: Connection references updated.
     * `Update version references`: Updated the connection version references used when creating or deleting an MDB cluster backup.
     * `Delete version`: Connection version deleted after removing the most recent MDB cluster backup.

- 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 information about completed operations for a specific connection:
  
  1. See the description of the CLI command for getting information about completed operations:

      ```bash
      yc metadata-hub connection-manager connection list-operations --help
      ```

  1. Get information about completed operations by running this command:
      
      ```bash
      yc metadata-hub connection-manager connection list-operations <connection_ID>
      ```

      You can get the connection ID with the [list of connections](#connection-list) in the folder.

- API {#api}
  
  To get information about operations performed for a specific Connection Manager connection, use the [Connection.ListOperations](../connection-manager/api-ref/Connection/listOperations.md) REST API method or the [ConnectionService.ListOperations](../connection-manager/api-ref/grpc/Connection/listOperations.md) gRPC API method and provide the connection ID in the request.

  You can get the connection ID with the [list of connections](view-connection.md#connection-list) in the folder.

{% endlist %}