This document describes how to delete a parameter template version.
Consider deleting a parameter template version in the following scenarios:
- The parameter template version is obsolete and is no longer needed.
- The parameter template version contains sensitive information that needs to be permanently removed.
- You want to simplify the management of parameter template versions by deleting old and unused versions.
Required roles
To get the permission that
you need to delete a parameter template version,
ask your administrator to grant you the
Parameter Manager Parameter Version Manager (roles/parametermanager.parameterVersionManager) IAM role on the project, folder, or organization.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the
parametermanager.templateversions.delete
permission,
which is required to
delete a parameter template version.
You might also be able to get this permission with custom roles or other predefined roles.
Delete a parameter template version
To delete a parameter version, use one of the following methods:
Global parameters
Console
-
In the Google Cloud console, go to the Parameter Manager page.
-
Navigate to the Templates tab. You'll see the list of templates for that project.
-
Click the template name. The template details page opens to the Versions tab, which lists all versions of the template.
-
Select the template version that you want to delete.
-
Click the Actions menu associated with that template version, and then click Delete.
-
In the confirmation dialog that appears, enter the TEMPLATE_ID to confirm, and then click Delete.
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID
- TEMPLATE_ID: the name of the template
- TEMPLATE_VERSION_ID: the ID of the template version
HTTP method and URL:
DELETE https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID/versions/TEMPLATE_VERSION_ID
Request JSON body:
{}
To send your request, choose one of these options:
curl
Save the request body in a file named request.json,
and execute the following command:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID/versions/TEMPLATE_VERSION_ID"
PowerShell
Save the request body in a file named request.json,
and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID/versions/TEMPLATE_VERSION_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{}
Regional parameters
Console
-
In the Google Cloud console, go to the Parameter Manager page.
-
Navigate to the Templates tab. You'll see the list of templates for that project.
-
Click the template name. The template details page opens to the Versions tab, which lists all versions of the template.
-
Select the template version that you want to delete.
-
Click the Actions menu associated with that template version, and then click Delete.
-
In the confirmation dialog that appears, enter the TEMPLATE_ID to confirm, and then click Delete.
REST
Before using any of the request data, make the following replacements:
- LOCATION: the Google Cloud location of the parameter template
- PROJECT_ID: the Google Cloud project ID
- TEMPLATE_ID: the name of the template
- TEMPLATE_VERSION_ID: the ID of the template version
HTTP method and URL:
DELETE https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID/versions/TEMPLATE_VERSION_ID
Request JSON body:
{}
To send your request, choose one of these options:
curl
Save the request body in a file named request.json,
and execute the following command:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID/versions/TEMPLATE_VERSION_ID"
PowerShell
Save the request body in a file named request.json,
and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID/versions/TEMPLATE_VERSION_ID" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{}