Required roles
To get the permissions that you need to delete a repository, ask your administrator to grant you the following IAM roles:
-
Secure Source Manager Instance Accessor (
roles/securesourcemanager.instanceAccessor) on the Secure Source Manager instance -
Secure Source Manager Repo Admin (
roles/securesourcemanager.repoAdmin) on the repository
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.
Delete a repository
You can delete a repository using the gcloud, web interface, or API.
Web interface
-
To access the Secure Source Manager instance through its web interface, copy the following URL into your browser address bar.
INSTANCE_ID-PROJECT_NUMBER.LOCATION.sourcemanager.devReplace the following:
- INSTANCE_ID with the instance name.
- PROJECT_NUMBER with the instance's Google Cloud project number. For information on identifying projects, see Identifying projects.
- LOCATION with the instance's region.
- In the list of repositories, select the repository that you want to delete.
- Click Settings.
- In Repository Settings, click Delete This Repository.
gcloud
To delete a repository, run the following command:
gcloud source-manager repos delete REPOSITORY_ID --region=REGION --project=PROJECT_ID
Replace the following:
REPOSITORY_ID: The ID of the repository you want to delete.REGION: The region where the Secure Source Manager instance is located (for example,us-central1).PROJECT_ID: The project ID where the Secure Source Manager instance is located.
API
To delete your repository and all associated data, use the following HTTP method and URL.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the project ID 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:
DELETE https://securesourcemanager.googleapis.com/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:
"name":"operations/cc3ea26c-9b57-11ed-be0a-2e3b5910efef","metadata":{"@type":"type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata","createTime":"2023-01-23T19:54:49.904779921Z","endTime":"2023-01-23T19:54:50.947030402Z","target":"projects/my-project/locations/us-central1/repositories/my-repo","verb":"delete","apiVersion":"v1"},"done":true,"response":{"@type":"type.googleapis.com/google.protobuf.Empty"}
```
What's next
- Disable the Secure Source Manager API.
- Delete a Secure Source Manager instance.
- List and view instances.