Variables

Create / interact with Google Cloud RuntimeConfig variables.

google.cloud.runtimeconfig.variable.STATE_UNSPECIFIED()

The default variable state. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables#VariableState

google.cloud.runtimeconfig.variable.STATE_UPDATED()

Indicates the variable was updated, while variables.watch was executing. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables#VariableState

google.cloud.runtimeconfig.variable.STATE_DELETED()

Indicates the variable was deleted, while variables.watch was executing. See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables#VariableState

class google.cloud.runtimeconfig.variable.Variable(name, config)

Bases: object

A variable in the Cloud RuntimeConfig service.

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables

  • Parameters

property client()

The client bound to this variable.

create(client=None)

API call: create the variable via a POST request

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables/create

  • Parameters

    client (Client) – (Optional) The client to use. If not passed, falls back to the client stored on the variable’s config.

  • Return type

    bool

  • Returns

    True if the variable has been created, False on error.

exists(client=None)

API call: test for the existence of the variable via a GET request

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables/get

  • Parameters

    client (Client) – (Optional) The client to use. If not passed, falls back to the client stored on the variable’s config.

  • Return type

    bool

  • Returns

    True if the variable exists in Cloud RuntimeConfig.

classmethod from_api_repr(resource, config)

Factory: construct a Variable given its API representation

  • Parameters

  • Return type

    google.cloud.runtimeconfig.variable.Variable

  • Returns

    Variable parsed from resource.

property full_name()

Fully-qualified name of this variable.

Example: projects/my-project/configs/my-config/variables/my-var

  • Return type

    str

  • Returns

    The full name based on config and variable names.

  • Raises

    ValueError if the variable is missing a name.

property path()

URL path for the variable’s APIs.

  • Return type

    str

  • Returns

    The URL path based on config and variable names.

reload(client=None)

API call: reload the variable via a GET request.

This method will reload the newest data for the variable.

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs/get

property state()

Retrieve the state of the variable.

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables#VariableState

  • Return type

    str

  • Returns

    If set, one of "UPDATED", "DELETED", or defaults to "VARIABLE_STATE_UNSPECIFIED".

property text()

Text of the variable, as string.

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables

  • Return type

    str or NoneType

  • Returns

    The text of the variable or None if the property is not set locally.

update(client=None)

API call: update the variable via a PUT request

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables/update

  • Parameters

    client (Client) – (Optional) The client to use. If not passed, falls back to the client stored on the variable’s config.

  • Return type

    bool

  • Returns

    True if the variable has been created, False on error.

property update_time()

Retrieve the timestamp at which the variable was updated.

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables

  • Returns

    DatetimeWithNanoseconds, datetime.datetime or NoneType: Datetime object parsed from RFC3339 valid timestamp, or None if the property is not set locally.

  • Raises

    ValueError – if value is not a valid RFC3339 timestamp

property value()

Value of the variable, as bytes.

See https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables

  • Return type

    bytes or NoneType

  • Returns

    The value of the variable or None if the property is not set locally.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.