List and view instances

You can use the gcloud CLI to list all Secure Source Manager instances in your project. For more information on Secure Source Manager instances, see the [Secure Source Manager overview][ssm-overview].

Required roles

To get the permissions that you need to list instances, ask your administrator to grant you the Secure Source Manager Instance Manager (roles/securesourcemanager.instanceManager) IAM role on the instance project. For more information about granting roles, see Manage access to projects, folders, and organizations.

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 instances in project

Run the following command to get a list of Secure Source Manager instances in your project:

gcloud beta source-manager instances list --region=REGION

Replace REGION with the location you want to list the instances from.

The response will look like the following:

INSTANCE_ID: my-instance
LOCATION: us-central1
STATE: ACTIVE
CREATE_TIME: 2023-02-27T20:57:52
UPDATE_TIME: 2023-02-27T21:11:59
HTML_HOST: my-instance-098765432109.us-central1.sourcemanager.dev

You can access the instance by entering the value of HTML_HOST in a browser address bar.

Get instance details

Run the following command to get details of an instance:

gcloud beta source-manager instances describe INSTANCE_ID \
    --region=REGION

Replace the following:

  • INSTANCE_ID with the name of your instance.
  • REGION with the location of your instance. For information on supported locations, see Locations.

The response includes details of your instance similar to the following:

createTime: '2023-02-27T20:57:52.310148676Z'
hostConfig:
  api: my-instance-123456789098-api.us-central1.sourcemanager.dev
  gitHttp: my-instance-123456789098-git.us-central1.sourcemanager.dev
  gitSsh: my-instance-123456789098-ssh.us-central1.sourcemanager.dev
  html: my-instance-123456789098.us-central1.sourcemanager.dev
name: projects/my-project/locations/us-central1/instances/my-instance
state: ACTIVE
updateTime: '2023-02-27T21:11:59.538591815Z'

What's next