Deleting a Variable

This page explains how to delete variables. To learn more about variables and the Runtime Configurator service, Runtime Configurator Fundamentals.

To learn how to create a variable, see Setting and Getting Data.

Before you begin

Deleting a variable

You can delete a single variable or recursively delete all variables under a specific path.

Deployment Manager

Delete a variable that is part of a deployment using one of the following methods:

gcloud

To delete a variable with the Google Cloud CLI, use the runtime-config configs variables delete command:

gcloud beta runtime-config configs variables unset [VARIABLE_KEY] --config-name [CONFIG_NAME]

where [VARIABLE_KEY] is the key of the variable and [CONFIG_NAME] is the name of the config this variable belongs to.

If you want to recursively delete all variables under a certain path, provide the --recursive flag.

The gcloud CLI returns a response like:

Deleted [https://runtimeconfig.googleapis.com/v1beta1/projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_KEY].

API

In the REST API, make a DELETE request to the following URI to delete a new variable:

https://runtimeconfig.googleapis.com/v1beta1/projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_KEY]

where:

  • [PROJECT_ID] is the project ID for this request.
  • [CONFIG_NAME] is the name for this configuration.
  • [VARIABLE_KEY] is the variable to delete.

    If you want to recursively delete all variables under a specific pass, provide a payload with your request that has the recursive property set to true:

    { "recursive": true }

    If successful, the API returns an empty response.

    To learn more about the method, read the variables().delete documentation.

What's next?