This page describes how to retrieve a list of all the parameter versions associated with a parameter within a specified Google Cloud project and location.
Versions represent the specific setting or configuration value that the parameter holds at a given point in time. By looking at the list of versions, you can see how a parameter has changed over time and who made the change. This helps with auditing and troubleshooting. For example, if you're experiencing issues with your current configuration, examining disabled versions can help you understand what settings were previously used and potentially identify if a recent change caused the problem.
Required roles
To get the permissions that you need to list parameter versions,
ask your administrator to grant you the
Parameter Manager Parameter Viewer (roles/parametermanager.parameterViewer
) IAM role on the parameter, project, folder, or organization.
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.
List all parameters versions
To list all the parameter versions associated with a parameter, use the following command:
gcloud
List global parameter versions
Before using any of the command data below, make the following replacements:
- PARAMETER_ID: the name of the parameter
Execute the following command:
Linux, macOS, or Cloud Shell
gcloud beta parametermanager parameters versions list --parameter=PARAMETER_ID --location=global
Windows (PowerShell)
gcloud beta parametermanager parameters versions list --parameter=PARAMETER_ID --location=global
Windows (cmd.exe)
gcloud beta parametermanager parameters versions list --parameter=PARAMETER_ID --location=global
You should receive a response similar to the following:
NAME DISABLED CREATE_TIME UPDATE_TIME projects/production-1/locations/global/parameters/app_config/versions/configv3 2024-11-14T10:07:12.883361876Z 2024-11-14T10:07:13.331806596Z
List regional parameter versions
Before using any of the command data below, make the following replacements:
- PARAMETER_ID: the name of the parameter
- LOCATION: the Google Cloud location of the parameter
Execute the following command:
Linux, macOS, or Cloud Shell
gcloud beta parametermanager parameters versions list --parameter=PARAMETER_ID --location=LOCATION
Windows (PowerShell)
gcloud beta parametermanager parameters versions list --parameter=PARAMETER_ID --location=LOCATION
Windows (cmd.exe)
gcloud beta parametermanager parameters versions list --parameter=PARAMETER_ID --location=LOCATION
You should receive a response similar to the following:
NAME DISABLED CREATE_TIME UPDATE_TIME projects/production-1/locations/us-central1/parameters/app_config/versions/configv3 2024-11-14T10:07:12.883361876Z 2024-11-14T10:07:13.331806596Z
REST
List global parameter versions
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID
- PARAMETER_ID: the name of the parameter
HTTP method and URL:
GET https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/parameters/PARAMETER_ID/versions
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 GET \
-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/parameters/PARAMETER_ID/versions"
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 GET `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/parameters/PARAMETER_ID/versions" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "parameterVersions": [ { "name": "projects/production-1/locations/global/parameters/app_config/versions/configv3", "createTime": "2024-11-12T10:22:17.704800878Z", "updateTime": "2024-11-12T11:08:24.173199506Z", "disabled": true }, { "name": "projects/production-1/locations/global/parameters/app_config/versions/configv2", "createTime": "2024-11-12T10:26:44.168165094Z", "updateTime": "2024-11-12T10:26:44.483145675Z" } ] }
List regional parameter versions
Before using any of the request data, make the following replacements:
- LOCATION: the Google Cloud location of the parameter
- PROJECT_ID: the Google Cloud project ID
- PARAMETER_ID: the name of the parameter
HTTP method and URL:
GET https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/parameters/PARAMETER_ID/versions
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 GET \
-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/parameters/PARAMETER_ID/versions"
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 GET `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/parameters/PARAMETER_ID/versions" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "parameterVersions": [ { "name": "projects/production-1/locations/us-central1/parameters/app_config/versions/configv3", "createTime": "2024-10-30T05:27:51.206825427Z", "updateTime": "2024-10-30T05:27:51.442194863Z" } ] }