List and view repositories

This document outlines how to search for and view Secure Source Manager repositories by full or partial repository ID.

Required roles

To get the permissions that you need to search repositories, ask your administrator to grant you the following IAM roles:

For more information about granting roles, see Manage access.

You might also be able to get the required permissions through custom roles or other predefined roles.

For information on granting Secure Source Manager roles, see Access control with IAM and Grant users instance access.

List repositories

web interface

To view a list of all repositories you have access to, navigate to the Secure Source Manager web interface.

The My repositories tab displays all repositories you have access to view.

API

To list details for all repositories in a given region for your instance, use the following HTTP method and URL.

Before using any of the request data, make the following replacements:

  • INSTANCE_ID: the instance ID.
  • PROJECT_NUMBER: the project number of the Google Cloud project where Secure Source manager is running.
  • LOCATION: the region where your instance is located. For information on supported locations, see Locations.

HTTP method and URL:

GET https://INSTANCE_ID-PROJECT_NUMBER-api.LOCATION.sourcemanager.dev/v1/projects/PROJECT_ID/locations/LOCATION/repositories

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

    "repositories" : [
          {
            "createTime" : "2023-08-09T19:32:15Z",
            "instance" : "projects/012345678901/locations/us-central1/instances/my-instance",
            "name" : "projects/my-project/locations/us-central1/repositories/my-repo",
            "uris" : {
                "api" : "https://my-instance-012345678901-api.us-central1.sourcemanager.dev/v1/projects/my-project/locations/us-central1/repositories/my-repo",
                "gitHttps" : "https://my-instance-012345678901-git.us-central1.sourcemanager.dev/my-project/my-repo.git",
                "html" : "https://my-instance-012345678901.us-central1.sourcemanager.dev/my-project/my-repo"
            }
          }

List repositories in a private instance

Private Secure Source Manager instances use the CA pool provided at creation time to request and serve a SSL certificate to callers. The CA certificates provided to the SSM instance by this CA pool must be trusted by any tools used to connect to the private instance, such as web browsers and CLI tools.

web interface

To view a list of all repositories you have access to, navigate to the Secure Source Manager web interface.

The My repositories tab displays all repositories you have access to view.

API

To list details for all repositories in a given region for a private instance, use the following HTTP method and URL.

Before using any of the request data, make the following replacements:

HTTP method and URL:

GET https://INSTANCE_ID-PROJECT_NUMBER-api.LOCATION.p.sourcemanager.dev/v1/projects/PROJECT_ID/locations/LOCATION/repositories

To use curl to send your request, execute the following command:

curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  --cacert CA_CERT \
  "https://INSTANCE_ID-PROJECT_NUMBER-api.LOCATION.p.sourcemanager.dev/v1/projects/PROJECT_ID/locations/LOCATION/repositories"

You should receive a JSON response similar to the following:

"repositories" : [
      {
        "createTime" : "2023-08-09T19:32:15Z",
        "instance" : "projects/012345678901/locations/us-central1/instances/my-instance",
        "name" : "projects/my-project/locations/us-central1/repositories/my-repo",
        "uris" : {
            "api" : "https://my-instance-012345678901-api.us-central1.p.sourcemanager.dev/v1/projects/my-project/locations/us-central1/repositories/my-repo",
            "gitHttps" : "https://my-instance-012345678901-git.us-central1.p.sourcemanager.dev/my-project/my-repo.git",
            "html" : "https://my-instance-012345678901.us-central1.p.sourcemanager.dev/my-project/my-repo"
        }
      }
]

View details for a specific repository

To list details for a single repository, use the following HTTP method and URL.

Before using any of the request data, make the following replacements:

  • INSTANCE_ID: the Secure Source Manager instance ID.
  • PROJECT_NUMBER: the project number of the Google Cloud project where Secure Source manager is running.
  • LOCATION: the region where your instance is located. For information on supported locations, see Locations.
  • REPOSITORY_ID: the repository ID.

HTTP method and URL:

GET https://INSTANCE_ID-PROJECT_NUMBER-api.LOCATION.sourcemanager.dev/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

    {
      "createTime" : "2023-08-09T19:32:15Z",
      "instance" : "projects/012345678901/locations/us-central1/instances/my-instance",
      "name" : "projects/my-project/locations/us-central1/repositories/my-repo",
      "uris" : {
          "api" : "https://my-instance-012345678901-api.us-central1.sourcemanager.dev/v1/projects/my-project/locations/us-central1/repositories/my-repo",
          "gitHttps" : "https://my-instance-012345678901-git.us-central1.sourcemanager.dev/my-project/my-repo.git",
          "html" : "https://my-instance-012345678901.us-central1.sourcemanager.dev/my-project/my-repo"
      }
    }

View details for a repository in a private instance

To list details for a single repository in a private instance, use the following HTTP method and URL.

Before using any of the request data, make the following replacements:

HTTP method and URL:

GET https://INSTANCE_ID-PROJECT_NUMBER-api.LOCATION.p.sourcemanager.dev/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID

To use curl to send your request, execute the following command:

curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  --cacert CA_CERT \
  "https://INSTANCE_ID-PROJECT_NUMBER-api.LOCATION.p.sourcemanager.dev/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID"

You should receive a JSON response similar to the following:

{
  "createTime" : "2023-08-09T19:32:15Z",
  "instance" : "projects/012345678901/locations/us-central1/instances/my-instance",
  "name" : "projects/my-project/locations/us-central1/repositories/my-repo",
  "uris" : {
      "api" : "https://my-instance-012345678901-api.us-central1.p.sourcemanager.dev/v1/projects/my-project/locations/us-central1/repositories/my-repo",
      "gitHttps" : "https://my-instance-012345678901-git.us-central1.p.sourcemanager.dev/my-project/my-repo.git",
      "html" : "https://my-instance-012345678901.us-central1.p.sourcemanager.dev/my-project/my-repo"
  }
}

View repositories in the web interface

You can search for repositories within the My repositories tab by keyword.

  1. In the Secure Source Manager web interface, enter your search keyword in the Search repository names search bar.

    The search results include all repositories that include your keyword in their repository ID.

  2. Select the repository you want to view.

    The repository page opens.

What's next