Edit a parameter template

This document describes how to edit a parameter template's metadata. You can update the labels of a parameter template. You can't edit the parameter template name or value. To add a new value to your parameter template, you must add a parameter template version.

Required roles

To get the permission that you need to update a parameter template's metadata, ask your administrator to grant you the Parameter Manager Admin (roles/parametermanager.admin) 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.templates.update permission, which is required to update a parameter template's metadata.

You might also be able to get this permission with custom roles or other predefined roles.

Edit a parameter template

To edit a parameter template, use one of the following methods:

Global parameters

Console

  1. In the Google Cloud console, go to the Parameter Manager page.

    Go to Parameter Manager

  2. Navigate to the Templates tab. You'll see a list of all the parameter templates in that project.

  3. To edit a parameter template, use one of the following options:

    • Locate the parameter template in the list and click the Actions menu associated with that parameter template. In the Actions menu, click Edit.

    • Click the parameter template name to go to the parameter template details page. On the parameter template details page, click Edit.

  4. On the Edit parameter template page, update the properties of the parameter template as required, and then click Save.

REST

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the Google Cloud project ID
  • TEMPLATE_ID: the unique name of the parameter template
  • LABEL_KEY: the unique name of the label
  • LABEL_VALUE: the corresponding value of the label

HTTP method and URL:

PATCH https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID?update_mask=labels

Request JSON body:

{
  "labels": {
    "LABEL_KEY": "LABEL_VALUE"
  }
}

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 PATCH \
-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?update_mask=labels"

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 PATCH `
-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?update_mask=labels" | Select-Object -Expand Content

The response returns the updated parameter.

Regional parameters

Console

  1. In the Google Cloud console, go to the Parameter Manager page.

    Go to Parameter Manager

  2. Navigate to the Templates tab. You'll see a list of all the parameter templates in that project.

  3. To edit a parameter template, use one of the following options:

    • Locate the parameter template in the list and click the Actions menu associated with that parameter template. In the Actions menu, click Edit.

    • Click the parameter template name to go to the parameter template details page. On the parameter template details page, click Edit.

  4. On the Edit parameter template page, update the properties of the parameter template as required, and then click Save.

REST

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the Google Cloud project ID
  • LOCATION: the Google Cloud location of the parameter
  • TEMPLATE_ID: the unique name of the parameter template
  • LABEL_KEY: the unique name of the label
  • LABEL_VALUE: the corresponding value of the label

HTTP method and URL:

PATCH https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID?update_mask=labels

Request JSON body:

{
  "labels": {
    "LABEL_KEY": "LABEL_VALUE"
  }
}

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 PATCH \
-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/LOCATION/templates/TEMPLATE_ID?update_mask=labels"

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 PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID?update_mask=labels" | Select-Object -Expand Content

The response returns the updated parameter.

Edit labels for multiple parameter templates

  1. In the Google Cloud console, go to the Parameter Manager page.

    Go to Parameter Manager

  2. Navigate to the Templates tab. You'll see a list of all the parameter templates in that project.
  3. Select the parameter templates for which you want to edit the labels.
  4. Click Labels.
  5. In the Editing labels side panel, update the labels as required.
  6. Click Save.

What's next