List parameters and view parameter details
Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to retrieve a list of all parameters within a project and view metadata associated with each parameter.
A parameter acts as a container for its versions. While the parameter stores metadata like name and format, the individual parameter versions hold the actual data payload.
Required roles
To get the permissions that
you need to list parameters,
ask your administrator to grant you the
Parameter Manager Parameter Viewer (roles/parametermanager.parameterViewer) IAM role on the 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
To list all parameters in a project, folder, or organization, use one of the following methods:
Global parameters
Console
-
In the Google Cloud console, go to the Secret Manager page.
-
Click Parameter Manager to go to the Parameter Manager page. You'll see a list of all the parameters in that project.
gcloud
Before using any of the command data below, make the following replacements:
- PROJECT_ID: the Google Cloud project ID
Execute the following command:
Linux, macOS, or Cloud Shell
gcloudparametermanagerparameterslist--location=global--project=PROJECT_ID
Windows (PowerShell)
gcloudparametermanagerparameterslist--location=global--project=PROJECT_ID
Windows (cmd.exe)
gcloudparametermanagerparameterslist--location=global--project=PROJECT_ID
You should receive a response similar to the following:
projects/production-1/locations/global/parameters/allowed_ip_ranges UNFORMATTED {'iamPolicyUidPrincipal': 'principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/d81462f3-f333-49d6-8a37-18ba24ad21b3'} 2024年10月23日T09:58:00.195567192Z 2024年10月23日T09:58:00.521576004Z
projects/production-1/locations/global/parameters/app_config FORMATTED {'iamPolicyUidPrincipal': 'principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/4d3737fa-ab28-47f3-8ca7-4ea4d3de6305'} 2024年10月25日T13:54:53.162338414Z 2024年10月25日T13:54:53.444576707Z
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID
HTTP method and URL:
GET https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/parameters
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"
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" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{
"parameters": [
{
"name": "projects/production-1/locations/global/parameters/app_config",
"createTime": "2024-10-15T08:39:05.191747694Z",
"updateTime": "2024-10-15T08:39:05.530311092Z",
"format": "YAML",
"policyMember": {
"iamPolicyUidPrincipal": "principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/c86ca5bc-f4c2-439d-b62c-d578b4b78b12"
}
},
{
"name": "projects/production-1/locations/global/parameters/allowed_ip_ranges",
"createTime": "2024-10-15T08:31:53.250487112Z",
"updateTime": "2024-10-15T08:31:53.576010644Z",
"format": "UNFORMATTED",
"policyMember": {
"iamPolicyUidPrincipal": "principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/c0100d79-7c8d-4da3-8eb6-fe2a35843d9b"
}
}
]
}
C#
To run this code, first set up a C# development environment and install the Parameter Manager C# SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
usingGoogle.Api.Gax ;
usingGoogle.Api.Gax.ResourceNames ;
usingGoogle.Cloud.ParameterManager.V1 ;
publicclassListParametersSample
{
/// <summary>
/// This function lists parameter using the Parameter Manager SDK for GCP.
/// </summary>
/// <param name="projectId">The ID of the project where the parameter is located.</param>
/// <returns>A list of Parameter objects.</returns>
publicIEnumerable<Parameter>ListParameters(stringprojectId)
{
// Create the client.
ParameterManagerClient client=ParameterManagerClient .Create ();
// Build the parent resource name.
LocationName parent=newLocationName (projectId,"global");
// Call the API to list the parameters.
PagedEnumerable<ListParametersResponse,Parameter>response=client.ListParameters (parent);
// Print each parameter name.
foreach(Parameterparameterinresponse)
{
Console.WriteLine($"Found parameter {parameter.Name} with format {parameter.Format}");
}
// Return the list of parameters.
returnresponse;
}
}Go
To run this code, first set up a Go development environment and install the Parameter Manager Go SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
import(
"context"
"fmt"
"io"
parametermanager"cloud.google.com/go/parametermanager/apiv1"
parametermanagerpb"cloud.google.com/go/parametermanager/apiv1/parametermanagerpb"
"google.golang.org/api/iterator"
)
// listParam lists parameters using the Parameter Manager SDK for GCP.
//
// w: The io.Writer object used to write the output.
// projectID: The ID of the project where the parameters are located.
//
// The function returns an error if the parameter listing fails.
funclistParams(wio.Writer,projectIDstring)error{
// Create a context and a Parameter Manager client.
ctx:=context.Background()
client,err:=parametermanager.NewClient (ctx)
iferr!=nil{
returnfmt.Errorf("failed to create Parameter Manager client: %w",err)
}
deferclient.Close ()
// Construct the name of the list parameter.
parent:=fmt.Sprintf("projects/%s/locations/global",projectID)
// Build the request to list parameters.
req:=¶metermanagerpb.ListParametersRequest{
Parent:parent,
}
// Call the API to list parameters.
parameters:=client.ListParameters(ctx,req)
for{
parameter,err:=parameters.Next()
iferr==iterator.Done{
break
}
iferr!=nil{
returnfmt.Errorf("failed to list parameters: %w",err)
}
fmt.Fprintf(w,"Found parameter %s with format %s \n",parameter.Name,parameter.Format.String())
}
returnnil
}
Java
To run this code, first set up a Java development environment and install the Parameter Manager Java SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
importcom.google.cloud.parametermanager.v1.LocationName ;
importcom.google.cloud.parametermanager.v1.ParameterManagerClient ;
importcom.google.cloud.parametermanager.v1.ParameterManagerClient.ListParametersPagedResponse ;
importjava.io.IOException;
/** Class to demonstrate listing parameter using the parameter manager SDK for GCP. */
publicclass ListParams{
publicstaticvoidmain(String[]args)throwsIOException{
// TODO(developer): Replace these variables before running the sample.
StringprojectId="your-project-id";
// Call the method to list parameters.
listParams(projectId);
}
// This is an example snippet for listing all parameters in given project.
publicstaticListParametersPagedResponse listParams(StringprojectId)throwsIOException{
// Initialize the client that will be used to send requests. This client only
// needs to be created once, and can be reused for multiple requests.
try(ParameterManagerClient client=ParameterManagerClient .create()){
StringlocationId="global";
// Build the parent name from the project.
LocationName location=LocationName .of(projectId,locationId);
// Get all parameters.
ListParametersPagedResponse response=client.listParameters(location.toString ());
// List all parameters.
response
.iterateAll()
.forEach(parameter->
System.out.printf("Found parameter %s with format %s\n",
parameter.getName(),parameter.getFormat()));
returnresponse;
}
}
}Node.js
To run this code, first set up a Node.js development environment and install the Parameter Manager Node.js SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'my-project';
// Imports the Parameter Manager library
const{ParameterManagerClient}=require('@google-cloud/parametermanager');
// Instantiates a client
constclient=newParameterManagerClient ();
asyncfunctionlistParams(){
// Construct the parent string for listing parameters globally
constparent=client.locationPath (projectId,'global');
constrequest={
parent:parent,
};
// Use listParametersAsync to handle pagination automatically
constparameters=awaitclient.listParametersAsync (request);
forawait(constparameterofparameters){
console.log(
`Found parameter ${parameter.name} with format ${parameter.format}`
);
}
returnparameters;
}
returnawaitlistParams();PHP
To run this code, first learn about using PHP on Google Cloud and install the Parameter Manager PHP SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
// Import necessary classes for list a parameters.
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\ListParametersRequest;
use Google\Cloud\ParameterManager\V1\ParameterFormat;
/**
* Lists a parameters using the Parameter Manager SDK for GCP.
*
* @param string $projectId The Google Cloud Project ID (e.g. 'my-project')
*/
function list_params(string $projectId): void
{
// Create a client for the Parameter Manager service.
$client = new ParameterManagerClient();
// Build the resource name of the parameter.
$parent = $client->locationName($projectId, 'global');
// Prepare the request to list the parameters.
$request = (new ListParametersRequest())
->setParent($parent);
// Retrieve the parameter using the client.
foreach ($client->listParameters($request) as $parameter) {
printf('Found parameter %s with format %s' . PHP_EOL, $parameter->getName(), ParameterFormat::name($parameter->getFormat()));
}
}Python
To run this code, first set up a Python development environment and install the Parameter Manager Python SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
deflist_params(project_id: str) -> None:
"""
Lists all parameters in the global location for the specified
project using the Google Cloud Parameter Manager SDK.
Args:
project_id (str): The ID of the project
where the parameters are located.
Returns:
None
Example:
list_params(
"my-project"
)
"""
# Import the necessary library for Google Cloud Parameter Manager.
fromgoogle.cloudimport parametermanager_v1
# Create the Parameter Manager client.
client = parametermanager_v1 .ParameterManagerClient ()
# Build the resource name of the parent project in the global location.
parent = client.common_location_path (project_id, "global")
# List all parameters in the specified parent project.
for parameter in client.list_parameters (parent=parent):
print(f"Found parameter {parameter.name} with format {parameter.format_.name}")
Ruby
To run this code, first set up a Ruby development environment and install the Parameter Manager Ruby SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
require"google/cloud/parameter_manager"
##
# List a parameters
#
# @param project_id [String] The Google Cloud project (e.g. "my-project")
#
deflist_paramsproject_id:
# Create a Parameter Manager client.
client=Google::Cloud::ParameterManager .parameter_manager
# Build the resource name of the parent project.
parent=client.location_path project:project_id,location:"global"
# List the parameters.
param_list=client.list_parametersparent:parent
# Print out all parameters.
param_list.eachdo|param|
puts"Found parameter #{param.name} with format #{param.format }"
end
endRegional parameters
Console
-
In the Google Cloud console, go to the Secret Manager page.
-
Click Parameter Manager to go to the Parameter Manager page. You'll see a list of all the parameters in that project.
gcloud
Before using any of the command data below, make the following replacements:
- LOCATION: the Google Cloud location of the parameter
- PROJECT_ID: the Google Cloud project ID
Execute the following command:
Linux, macOS, or Cloud Shell
gcloudparametermanagerparameterslist--location=LOCATION--project=PROJECT_ID
Windows (PowerShell)
gcloudparametermanagerparameterslist--location=LOCATION--project=PROJECT_ID
Windows (cmd.exe)
gcloudparametermanagerparameterslist--location=LOCATION--project=PROJECT_ID
You should receive a response similar to the following:
projects/production-1/locations/us-central1/parameters/allowed_ip_ranges UNFORMATTED {'iamPolicyUidPrincipal': 'principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/us-central1/parameters/d81462f3-f333-49d6-8a37-18ba24ad21b3'} 2024年10月23日T09:58:00.195567192Z 2024年10月23日T09:58:00.521576004Z
projects/production-1/locations/us-central1/parameters/app_config FORMATTED {'iamPolicyUidPrincipal': 'principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/us-central1/parameters/4d3737fa-ab28-47f3-8ca7-4ea4d3de6305'} 2024年10月25日T13:54:53.162338414Z 2024年10月25日T13:54:53.444576707Z
REST
Before using any of the request data, make the following replacements:
- LOCATION: the Google Cloud location of the parameters
- PROJECT_ID: the Google Cloud project ID
HTTP method and URL:
GET https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/parameters
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"
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" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{
"parameters": [
{
"name": "projects/production-1/locations/us-central1/parameters/app_config",
"createTime": "2024-10-30T05:27:28.934719122Z",
"updateTime": "2024-10-30T05:27:29.010260475Z",
"format": "YAML",
"policyMember": {
"iamPolicyUidPrincipal": "principal://parametermanager.googleapis.com/projects/463050620945/uid/locations/us-central1/parameters/6ffe4045-0778-490a-a786-d77b124e2613"
}
},
{
"name": "projects/production-1/locations/us-central1/parameters/allowed_ip_ranges",
"createTime": "2024-10-29T06:18:23.070009070Z",
"updateTime": "2024-10-29T06:18:23.123580038Z",
"format": "UNFORMATTED",
"policyMember": {
"iamPolicyUidPrincipal": "principal://parametermanager.googleapis.com/projects/463050620945/uid/locations/us-central1/parameters/a7d81e39-3f53-4794-b3c6-484800a18c32"
}
}
]
}
C#
To run this code, first set up a C# development environment and install the Parameter Manager C# SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
usingGoogle.Api.Gax ;
usingGoogle.Api.Gax.ResourceNames ;
usingGoogle.Cloud.ParameterManager.V1 ;
publicclassListRegionalParametersSample
{
/// <summary>
/// This function lists all regional parameters using the Parameter Manager SDK for GCP.
/// </summary>
/// <param name="projectId">The ID of the project where the parameter is located.</param>
/// <param name="locationId">The ID of the region where the parameter is located.</param>
/// <returns>A list of Parameter objects.</returns>
publicIEnumerable<Parameter>ListRegionalParameters(
stringprojectId,
stringlocationId)
{
// Define the regional endpoint
stringregionalEndpoint=$"parametermanager.{locationId}.rep.googleapis.com";
// Create the client with the regional endpoint
ParameterManagerClient client=newParameterManagerClientBuilder
{
Endpoint=regionalEndpoint
}.Build ();
// Build the parent resource name for the regional locationId
LocationName parent=newLocationName (projectId,locationId);
// Call the API to list the parameters
PagedEnumerable<ListParametersResponse,Parameter>response=client.ListParameters (parent);
// Print each parameter name
foreach(Parameterparameterinresponse)
{
Console.WriteLine($"Found regional parameter {parameter.Name} with format {parameter.Format}");
}
// Return the list of parameters
returnresponse;
}
}Go
To run this code, first set up a Go development environment and install the Parameter Manager Go SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
import(
"context"
"fmt"
"io"
parametermanager"cloud.google.com/go/parametermanager/apiv1"
parametermanagerpb"cloud.google.com/go/parametermanager/apiv1/parametermanagerpb"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
)
// listRegionalParam lists all parameters regional using the Parameter Manager SDK for GCP.
//
// projectID: The ID of the project where the parameter is located.
// locationID: The ID of the region where the parameter is located.
// parameterID: The ID of the parameter to be listed.
//
// The function returns an error if the parameter listing fails
funclistRegionalParam(wio.Writer,projectID,locationIDstring)error{
// Create a new context.
ctx:=context.Background()
// Create a Parameter Manager client.
endpoint:=fmt.Sprintf("parametermanager.%s.rep.googleapis.com:443",locationID)
client,err:=parametermanager.NewClient (ctx,option.WithEndpoint(endpoint))
iferr!=nil{
returnfmt.Errorf("failed to create Parameter Manager client: %w",err)
}
deferclient.Close ()
// Construct the name of the parent resource to list parameters.
parent:=fmt.Sprintf("projects/%s/locations/%s",projectID,locationID)
// Build the request to list all parameters.
req:=¶metermanagerpb.ListParametersRequest{
Parent:parent,
}
// Call the API to list all parameters.
parameters:=client.ListParameters(ctx,req)
for{
parameter,err:=parameters.Next()
iferr==iterator.Done{
break
}
iferr!=nil{
returnfmt.Errorf("failed to list parameters: %w",err)
}
fmt.Fprintf(w,"Found regional parameter %s with format %s\n",parameter.Name,parameter.Format.String())
}
returnnil
}
Java
To run this code, first set up a Java development environment and install the Parameter Manager Java SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
importcom.google.cloud.parametermanager.v1.LocationName ;
importcom.google.cloud.parametermanager.v1.ParameterManagerClient ;
importcom.google.cloud.parametermanager.v1.ParameterManagerClient.ListParametersPagedResponse ;
importcom.google.cloud.parametermanager.v1.ParameterManagerSettings ;
importjava.io.IOException;
/**
* Class to demonstrate listing parameters for a specified region using the Parameter Manager SDK
* for GCP.
*/
publicclass ListRegionalParams{
publicstaticvoidmain(String[]args)throwsIOException{
// TODO(developer): Replace these variables before running the sample.
StringprojectId="your-project-id";
StringlocationId="your-location-id";
// Call the method to list parameters regionally.
listRegionalParams(projectId,locationId);
}
// This is an example snippet that list all parameters in a given region.
publicstaticListParametersPagedResponse listRegionalParams(StringprojectId,StringlocationId)
throwsIOException{
// Endpoint to call the regional parameter manager server
StringapiEndpoint=String.format("parametermanager.%s.rep.googleapis.com:443",locationId);
ParameterManagerSettings parameterManagerSettings=
ParameterManagerSettings .newBuilder().setEndpoint(apiEndpoint).build();
// Initialize the client that will be used to send requests. This client only
// needs to be created once, and can be reused for multiple requests.
try(ParameterManagerClient client=ParameterManagerClient .create(parameterManagerSettings)){
// Build the parent name from the project.
LocationName location=LocationName .of(projectId,locationId);
// Get all parameters.
ListParametersPagedResponse response=client.listParameters(location.toString ());
// List all parameters.
response
.iterateAll()
.forEach(parameter->
System.out.printf("Found regional parameter %s with format %s\n",
parameter.getName(),parameter.getFormat()));
returnresponse;
}
}
}Node.js
To run this code, first set up a Node.js development environment and install the Parameter Manager Node.js SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'my-project';
// const locationId = 'us-central1';
// Imports the Parameter Manager library
const{ParameterManagerClient}=require('@google-cloud/parametermanager');
// Adding the endpoint to call the regional parameter manager server
constoptions={
apiEndpoint:`parametermanager.${locationId}.rep.googleapis.com`,
};
// Instantiates a client with regional endpoint
constclient=newParameterManagerClient (options);
asyncfunctionlistRegionalParams(){
// Construct the parent string for listing parameters in a specific region
constparent=client.locationPath (projectId,locationId);
constrequest={
parent:parent,
};
// Use listParametersAsync to handle pagination automatically
constparameters=awaitclient.listParametersAsync (request);
forawait(constparameterofparameters){
console.log(
`Found regional parameter ${parameter.name} with format ${parameter.format}`
);
}
returnparameters;
}
returnawaitlistRegionalParams();PHP
To run this code, first learn about using PHP on Google Cloud and install the Parameter Manager PHP SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
// Import necessary classes for list a parameters.
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\ListParametersRequest;
use Google\Cloud\ParameterManager\V1\ParameterFormat;
/**
* Lists a regional parameters using the Parameter Manager SDK for GCP.
*
* @param string $projectId The Google Cloud Project ID (e.g. 'my-project')
* @param string $locationId The Parameter Location (e.g. 'us-central1')
*/
function list_regional_params(string $projectId, string $locationId): void
{
// Specify regional endpoint.
$options = ['apiEndpoint' => "parametermanager.$locationId.rep.googleapis.com"];
// Create a client for the Parameter Manager service.
$client = new ParameterManagerClient($options);
// Build the resource name of the parameter.
$parent = $client->locationName($projectId, $locationId);
// Prepare the request to list the parameters.
$request = (new ListParametersRequest())
->setParent($parent);
// Retrieve the parameter using the client.
foreach ($client->listParameters($request) as $parameter) {
printf('Found regional parameter %s with format %s' . PHP_EOL, $parameter->getName(), ParameterFormat::name($parameter->getFormat()));
}
}Python
To run this code, first set up a Python development environment and install the Parameter Manager Python SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
deflist_regional_params(project_id: str, location_id: str) -> None:
"""
Lists all parameters in the specified region for the specified
project using the Google Cloud Parameter Manager SDK.
Args:
project_id (str): The ID of the project where
the parameters are located.
location_id (str): The ID of the region where
the parameters are located.
Returns:
None
Example:
list_regional_params(
"my-project",
"us-central1"
)
"""
# Import the necessary library for Google Cloud Parameter Manager.
fromgoogle.cloudimport parametermanager_v1
# Create the Parameter Manager client with the regional endpoint.
api_endpoint = f"parametermanager.{location_id}.rep.googleapis.com"
client = parametermanager_v1 .ParameterManagerClient (
client_options={"api_endpoint": api_endpoint}
)
# Build the resource name of the parent project in the specified region.
parent = client.common_location_path (project_id, location_id)
# List all parameters in the specified parent project and region.
for parameter in client.list_parameters (parent=parent):
print(f"Found regional parameter {parameter.name} with format {parameter.format_.name}")
Ruby
To run this code, first set up a Ruby development environment and install the Parameter Manager Ruby SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
require"google/cloud/parameter_manager"
##
# List a regional parameters
#
# @param project_id [String] The Google Cloud project (e.g. "my-project")
# @param location_id [String] The location name (e.g. "us-central1")
#
deflist_regional_paramsproject_id:,location_id:
# Endpoint for the regional parameter manager service.
api_endpoint="parametermanager.#{location_id}.rep.googleapis.com"
# Create the Parameter Manager client.
client=Google::Cloud::ParameterManager .parameter_manager do|config|
config.endpoint=api_endpoint
end
# Build the resource name of the parent project.
parent=client.location_path project:project_id,location:location_id
# List the parameters.
param_list=client.list_parametersparent:parent
# Print out all parameters.
param_list.eachdo|param|
puts"Found regional parameter #{param.name} with format #{param.format }"
end
endView parameter details
To view the details of a specific parameter, use one of the following methods:
Global parameters
Console
-
In the Google Cloud console, go to the Secret Manager page.
-
Click Parameter Manager to go to the Parameter Manager page. You'll see the list of parameters for that project.
-
Click the name of the parameter to view its details.
-
On the parameter details page, click the Overview tab. This tab displays the general details and metadata associated with the parameter.
gcloud
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
gcloudparametermanagerparametersdescribePARAMETER_ID--location=globalWindows (PowerShell)
gcloudparametermanagerparametersdescribePARAMETER_ID--location=globalWindows (cmd.exe)
gcloudparametermanagerparametersdescribePARAMETER_ID--location=globalYou should receive a response similar to the following:
createTime: '2024-11-14T06:07:35.529019883Z' format: UNFORMATTED name: projects/production-1/locations/global/parameters/app_config policyMember: iamPolicyUidPrincipal: principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/307fa2aa-c769-496f-9362-f908d14bac71 updateTime: '2024-11-14T06:07:35.992040677Z'
REST
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
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"
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" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{
"name": "projects/production-1/locations/global/parameters/app_config",
"createTime": "2024-10-15T08:39:05.191747694Z",
"updateTime": "2024-10-15T08:39:05.530311092Z",
"format": "YAML",
"policyMember": {
"iamPolicyUidPrincipal": "principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/c86ca5bc-f4c2-439d-b62c-d578b4b78b12"
}
}
C#
To run this code, first set up a C# development environment and install the Parameter Manager C# SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
usingGoogle.Cloud.ParameterManager.V1 ;
publicclassGetParameterSample
{
/// <summary>
/// This function retrieves a parameter using the Parameter Manager SDK for GCP.
/// </summary>
/// <param name="projectId">The ID of the project where the parameter is located.</param>
/// <param name="parameterId">The ID of the parameter to be retrieved.</param>
/// <returns>The retrieved Parameter object.</returns>
publicParameterGetParameter(
stringprojectId,
stringparameterId)
{
// Create the client.
ParameterManagerClient client=ParameterManagerClient .Create ();
// Build the resource name for the parameter.
ParameterName parameterName=newParameterName (projectId,"global",parameterId);
// Call the API to get the parameter.
Parameterparameter=client.GetParameter (parameterName);
// Print the retrieved parameter name.
Console.WriteLine($"Found the parameter {parameter.Name} with format {parameter.Format}");
// Return the retrieved parameter.
returnparameter;
}
}Go
To run this code, first set up a Go development environment and install the Parameter Manager Go SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
import(
"context"
"fmt"
"io"
parametermanager"cloud.google.com/go/parametermanager/apiv1"
parametermanagerpb"cloud.google.com/go/parametermanager/apiv1/parametermanagerpb"
)
// getParam get parameter using the Parameter Manager SDK for GCP.
//
// w: The io.Writer object used to write the output.
// projectID: The ID of the project where the parameter is located.
// parameterID: The ID of the parameter to retrieved.
//
// The function returns an error if the parameter retrieval fails.
funcgetParam(wio.Writer,projectID,parameterIDstring)error{
// Create a context and a Parameter Manager client.
ctx:=context.Background()
client,err:=parametermanager.NewClient (ctx)
iferr!=nil{
returnfmt.Errorf("failed to create Parameter Manager client: %w",err)
}
deferclient.Close ()
// Construct the name of the parameter to get parameter.
name:=fmt.Sprintf("projects/%s/locations/global/parameters/%s",projectID,parameterID)
// Build the request to get parameter.
req:=¶metermanagerpb.GetParameterRequest{
Name:name,
}
// Call the API to get parameter.
param,err:=client.GetParameter(ctx,req)
iferr!=nil{
returnfmt.Errorf("failed to get parameter: %w",err)
}
// Find more details for the Parameter object here:
// https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
fmt.Fprintf(w,"Found parameter %s with format %s\n",param.Name,param.Format.String())
returnnil
}
Java
To run this code, first set up a Java development environment and install the Parameter Manager Java SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
importcom.google.cloud.parametermanager.v1.Parameter ;
importcom.google.cloud.parametermanager.v1.ParameterManagerClient ;
importcom.google.cloud.parametermanager.v1.ParameterName ;
importjava.io.IOException;
/** This class demonstrates how to get a parameter using the Parameter Manager SDK for GCP. */
publicclass GetParam{
publicstaticvoidmain(String[]args)throwsIOException{
// TODO(developer): Replace these variables before running the sample.
StringprojectId="your-project-id";
StringparameterId="your-parameter-id";
// Call the method to get a parameter.
getParam(projectId,parameterId);
}
// This is an example snippet for getting a parameter.
publicstaticParameter getParam(StringprojectId,StringparameterId)throwsIOException{
// Initialize the client that will be used to send requests. This client only
// needs to be created once, and can be reused for multiple requests.
try(ParameterManagerClient client=ParameterManagerClient .create()){
StringlocationId="global";
// Build the parameter name.
ParameterName parameterName=ParameterName .of(projectId,locationId,parameterId);
// Get the parameter.
Parameter parameter=client.getParameter(parameterName.toString ());
// Find more details for the Parameter object here:
// https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
System.out.printf(
"Found the parameter %s with format: %s\n",parameter.getName (),parameter.getFormat ());
returnparameter;
}
}
}Node.js
To run this code, first set up a Node.js development environment and install the Parameter Manager Node.js SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'my-project';
// const parameterId = 'my-parameter';
// Imports the Parameter Manager library
const{ParameterManagerClient}=require('@google-cloud/parametermanager');
// Instantiates a client
constclient=newParameterManagerClient ();
asyncfunctiongetParam(){
// Construct the fully qualified parameter name
constname=client.parameterPath (projectId,'global',parameterId);
// Get the parameter
const[parameter]=awaitclient.getParameter({
name:name,
});
// Find more details for the Parameter object here:
// https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
console.log(
`Found parameter ${parameter.name} with format ${parameter.format}`
);
returnparameter;
}
returnawaitgetParam();PHP
To run this code, first learn about using PHP on Google Cloud and install the Parameter Manager PHP SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
// Import necessary classes for retrieve a parameter version.
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\GetParameterRequest;
use Google\Cloud\ParameterManager\V1\ParameterFormat;
/**
* Retrieves a parameter using the Parameter Manager SDK for GCP.
*
* @param string $projectId The Google Cloud Project ID (e.g. 'my-project')
* @param string $parameterId The Parameter ID (e.g. 'my-param')
*/
function get_param(string $projectId, string $parameterId): void
{
// Create a client for the Parameter Manager service.
$client = new ParameterManagerClient();
// Build the resource name of the parameter.
$parameterName = $client->parameterName($projectId, 'global', $parameterId);
// Prepare the request to get the parameter.
$request = (new GetParameterRequest())
->setName($parameterName);
// Retrieve the parameter using the client.
$parameter = $client->getParameter($request);
// Print the retrieved parameter details.
printf('Found parameter %s with format %s' . PHP_EOL, $parameter->getName(), ParameterFormat::name($parameter->getFormat()));
}Python
To run this code, first set up a Python development environment and install the Parameter Manager Python SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
defget_param(project_id: str, parameter_id: str) -> parametermanager_v1.Parameter:
"""
Retrieves a parameter from the global location of the specified
project using the Google Cloud Parameter Manager SDK.
Args:
project_id (str): The ID of the project where the parameter is located.
parameter_id (str): The ID of the parameter to retrieve.
Returns:
parametermanager_v1.Parameter: An object representing the parameter.
Example:
get_param(
"my-project",
"my-global-parameter"
)
"""
# Import the necessary library for Google Cloud Parameter Manager.
fromgoogle.cloudimport parametermanager_v1
# Create the Parameter Manager client.
client = parametermanager_v1.ParameterManagerClient()
# Build the resource name of the parameter.
name = client.parameter_path(project_id, "global", parameter_id)
# Retrieve the parameter.
parameter = client.get_parameter(name=name)
# Show parameter details.
# Find more details for the Parameter object here:
# https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
print(f"Found the parameter {parameter.name} with format {parameter.format_.name}")Ruby
To run this code, first set up a Ruby development environment and install the Parameter Manager Ruby SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
require"google/cloud/parameter_manager"
##
# Retrieve a parameter
#
# @param project_id [String] The Google Cloud project (e.g. "my-project")
# @param parameter_id [String] The parameter name (e.g. "my-parameter")
#
defget_paramproject_id:,parameter_id:
# Create a Parameter Manager client.
client=Google::Cloud::ParameterManager .parameter_manager
# Build the resource name of the parent project.
name=client.parameter_path project:project_id,location:"global",parameter:parameter_id
# Retrieve the parameter.
param=client.get_parametername:name
# Print the retrieved parameter name.
puts"Found parameter #{param.name} with format #{param.format }"
endRegional parameters
Console
-
In the Google Cloud console, go to the Secret Manager page.
-
Click Parameter Manager to go to the Parameter Manager page. You'll see the list of parameters for that project.
-
Click the name of the parameter to view its details.
-
On the parameter details page, click the Overview tab. This tab displays the general details and metadata associated with the parameter.
gcloud
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
gcloudparametermanagerparametersdescribePARAMETER_ID--location=LOCATIONWindows (PowerShell)
gcloudparametermanagerparametersdescribePARAMETER_ID--location=LOCATIONWindows (cmd.exe)
gcloudparametermanagerparametersdescribePARAMETER_ID--location=LOCATIONYou should receive a response similar to the following:
createTime: '2024-11-14T06:07:35.529019883Z' format: UNFORMATTED name: projects/production-1/locations/us-central1/parameters/app_config policyMember: iamPolicyUidPrincipal: principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/us-central1/parameters/307fa2aa-c769-496f-9362-f908d14bac71 updateTime: '2024-11-14T06:07:35.992040677Z'
REST
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
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"
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" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{
"name": "projects/production-1/locations/us-central1/parameters/app_config",
"createTime": "2024-10-15T08:39:05.191747694Z",
"updateTime": "2024-10-15T08:39:05.530311092Z",
"format": "YAML",
"policyMember": {
"iamPolicyUidPrincipal": "principal://parametermanager.googleapis.com/projects/567445493557/uid/locations/global/parameters/c86ca5bc-f4c2-439d-b62c-d578b4b78b12"
}
}
C#
To run this code, first set up a C# development environment and install the Parameter Manager C# SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
usingGoogle.Cloud.ParameterManager.V1 ;
publicclassGetRegionalParameterSample
{
/// <summary>
/// This function retrieves a regional parameter using the Parameter Manager SDK for GCP.
/// </summary>
/// <param name="projectId">The ID of the project where the parameter is located.</param>
/// <param name="locationId">The ID of the region where the parameter is located.</param>
/// <param name="parameterId">The ID of the parameter to be retrieved.</param>
/// <returns>The retrieved Parameter object.</returns>
publicParameterGetRegionalParameter(
stringprojectId,
stringlocationId,
stringparameterId)
{
// Define the regional endpoint
stringregionalEndpoint=$"parametermanager.{locationId}.rep.googleapis.com";
// Create the client with the regional endpoint
ParameterManagerClient client=newParameterManagerClientBuilder
{
Endpoint=regionalEndpoint
}.Build ();
// Build the resource name for the parameter in the specified regional locationId
ParameterName parameterName=newParameterName (projectId,locationId,parameterId);
// Call the API to get the parameter
Parameterparameter=client.GetParameter (parameterName);
// Print the retrieved parameter name
Console.WriteLine($"Found the regional parameter {parameter.Name} with format {parameter.Format}");
// Return the retrieved parameter
returnparameter;
}
}Go
To run this code, first set up a Go development environment and install the Parameter Manager Go SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
import(
"context"
"fmt"
"io"
parametermanager"cloud.google.com/go/parametermanager/apiv1"
parametermanagerpb"cloud.google.com/go/parametermanager/apiv1/parametermanagerpb"
"google.golang.org/api/option"
)
// getRegionalParam gets a parameter regional using the Parameter Manager SDK for GCP.
//
// w: The io.Writer object used to write the output.
// projectID: The ID of the project where the parameter is located.
// locationID: The ID of the region where the parameter is located.
// parameterID: The ID of the parameter to be retrieved.
//
// The function returns an error if the parameter retrieval fails.
funcgetRegionalParam(wio.Writer,projectID,locationID,parameterIDstring)error{
// Create a new context.
ctx:=context.Background()
// Create a Parameter Manager client.
endpoint:=fmt.Sprintf("parametermanager.%s.rep.googleapis.com:443",locationID)
client,err:=parametermanager.NewClient (ctx,option.WithEndpoint(endpoint))
iferr!=nil{
returnfmt.Errorf("failed to create Parameter Manager client: %w",err)
}
deferclient.Close ()
// Construct the name of the parameter to retrieve.
name:=fmt.Sprintf("projects/%s/locations/%s/parameters/%s",projectID,locationID,parameterID)
// Build the request to get the parameter.
req:=¶metermanagerpb.GetParameterRequest{
Name:name,
}
// Call the API to get the parameter.
param,err:=client.GetParameter(ctx,req)
iferr!=nil{
returnfmt.Errorf("failed to get parameter: %w",err)
}
// Find more details for the Parameter object here:
// https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
fmt.Fprintf(w,"Found regional parameter %s with format %s\n",param.Name,param.Format.String())
returnnil
}
Java
To run this code, first set up a Java development environment and install the Parameter Manager Java SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
importcom.google.cloud.parametermanager.v1.Parameter ;
importcom.google.cloud.parametermanager.v1.ParameterManagerClient ;
importcom.google.cloud.parametermanager.v1.ParameterManagerSettings ;
importcom.google.cloud.parametermanager.v1.ParameterName ;
importjava.io.IOException;
/**
* This class demonstrates how to get a regional parameter using the Parameter Manager SDK for GCP.
*/
publicclass GetRegionalParam{
publicstaticvoidmain(String[]args)throwsIOException{
// TODO(developer): Replace these variables before running the sample.
StringprojectId="your-project-id";
StringlocationId="your-location-id";
StringparameterId="your-parameter-id";
// Call the method to get a regional parameter.
getRegionalParam(projectId,locationId,parameterId);
}
// This is an example snippet that gets a regional parameter.
publicstaticParameter getRegionalParam(StringprojectId,StringlocationId,StringparameterId)
throwsIOException{
// Endpoint to call the regional parameter manager server
StringapiEndpoint=String.format("parametermanager.%s.rep.googleapis.com:443",locationId);
ParameterManagerSettings parameterManagerSettings=
ParameterManagerSettings .newBuilder().setEndpoint(apiEndpoint).build();
// Initialize the client that will be used to send requests. This client only
// needs to be created once, and can be reused for multiple requests.
try(ParameterManagerClient client=ParameterManagerClient .create(parameterManagerSettings)){
// Build the parameter name.
ParameterName parameterName=ParameterName .of(projectId,locationId,parameterId);
// Get the parameter.
Parameter parameter=client.getParameter(parameterName.toString ());
// Find more details for the Parameter object here:
// https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
System.out.printf(
"Found the regional parameter %s with format %s\n",
parameter.getName (),parameter.getFormat ());
returnparameter;
}
}
}Node.js
To run this code, first set up a Node.js development environment and install the Parameter Manager Node.js SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'my-project';
// const locationId = 'us-central1';
// const parameterId = 'my-parameter';
// Imports the Parameter Manager library
const{ParameterManagerClient}=require('@google-cloud/parametermanager');
// Adding the endpoint to call the regional parameter manager server
constoptions={
apiEndpoint:`parametermanager.${locationId}.rep.googleapis.com`,
};
// Instantiates a client with regional endpoint
constclient=newParameterManagerClient (options);
asyncfunctiongetRegionalParam(){
// Construct the fully qualified parameter name
constname=client.parameterPath (projectId,locationId,parameterId);
// Get the parameter
const[parameter]=awaitclient.getParameter({
name:name,
});
// Find more details for the Parameter object here:
// https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
console.log(
`Found regional parameter ${parameter.name} with format ${parameter.format}`
);
returnparameter;
}
returnawaitgetRegionalParam();PHP
To run this code, first learn about using PHP on Google Cloud and install the Parameter Manager PHP SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
// Import necessary classes for retrieve a parameter version.
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\GetParameterRequest;
use Google\Cloud\ParameterManager\V1\ParameterFormat;
/**
* Retrieves a regional parameter using the Parameter Manager SDK for GCP.
*
* @param string $projectId The Google Cloud Project ID (e.g. 'my-project')
* @param string $locationId The Parameter Location (e.g. 'us-central1')
* @param string $parameterId The Parameter ID (e.g. 'my-param')
*/
function get_regional_param(string $projectId, string $locationId, string $parameterId): void
{
// Specify regional endpoint.
$options = ['apiEndpoint' => "parametermanager.$locationId.rep.googleapis.com"];
// Create a client for the Parameter Manager service.
$client = new ParameterManagerClient($options);
// Build the resource name of the parameter.
$parameterName = $client->parameterName($projectId, $locationId, $parameterId);
// Prepare the request to get the parameter.
$request = (new GetParameterRequest())
->setName($parameterName);
// Retrieve the parameter using the client.
$parameter = $client->getParameter($request);
// Print the retrieved parameter details.
printf('Found regional parameter %s with format %s' . PHP_EOL, $parameter->getName(), ParameterFormat::name($parameter->getFormat()));
}Python
To run this code, first set up a Python development environment and install the Parameter Manager Python SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
defget_regional_param(
project_id: str, location_id: str, parameter_id: str
) -> parametermanager_v1.Parameter:
"""
Retrieves a parameter from the specified region of the specified
project using the Google Cloud Parameter Manager SDK.
Args:
project_id (str): The ID of the project where the parameter is located.
location_id (str): The ID of the region where the parameter is located.
parameter_id (str): The ID of the parameter to retrieve.
Returns:
parametermanager_v1.Parameter: An object representing the parameter.
Example:
get_regional_param(
"my-project",
"us-central1",
"my-regional-parameter"
)
"""
# Import the necessary library for Google Cloud Parameter Manager.
fromgoogle.cloudimport parametermanager_v1
# Create the Parameter Manager client with the regional endpoint.
api_endpoint = f"parametermanager.{location_id}.rep.googleapis.com"
client = parametermanager_v1 .ParameterManagerClient (
client_options={"api_endpoint": api_endpoint}
)
# Build the resource name of the parameter.
name = client.parameter_path (project_id, location_id, parameter_id)
# Retrieve the parameter.
parameter = client.get_parameter (name=name)
# Show parameter details.
# Find more details for the Parameter object here:
# https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters#Parameter
print(f"Found the regional parameter {parameter.name} with format {parameter.format_.name}")Ruby
To run this code, first set up a Ruby development environment and install the Parameter Manager Ruby SDK. On Compute Engine or GKE, you must authenticate with the cloud-platform scope.
require"google/cloud/parameter_manager"
##
# Retrieve a regional parameter
#
# @param project_id [String] The Google Cloud project (e.g. "my-project")
# @param location_id [String] The location name (e.g. "us-central1")
# @param parameter_id [String] The parameter name (e.g. "my-parameter")
#
defget_regional_paramproject_id:,location_id:,parameter_id:
# Endpoint for the regional parameter manager service.
api_endpoint="parametermanager.#{location_id}.rep.googleapis.com"
# Create the Parameter Manager client.
client=Google::Cloud::ParameterManager .parameter_manager do|config|
config.endpoint=api_endpoint
end
# Build the resource name of the parent project.
name=client.parameter_path project:project_id,location:location_id,parameter:parameter_id
# Retrieve the parameter.
param=client.get_parametername:name
# Print the retrieved parameter name.
puts"Found regional parameter #{param.name} with format #{param.format }"
endThe response is the parameter object, which contains the metadata of the parameter.