Class Variable (0.34.0)

Variable(name, config)

Parameters

Name Description
name str

The name of the variable. This corresponds to the unique path of the variable in the config.

config Config

The config to which this variable belongs.

Properties

client

The client bound to this variable.

full_name

Fully-qualified name of this variable.

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

Exceptions
Type Description
`ValueError if the variable is missing a name.
Returns
Type Description
str The full name based on config and variable names.

path

URL path for the variable's APIs.

Returns
Type Description
str The URL path based on config and variable names.

state

Returns
Type Description
str If set, one of "UPDATED", "DELETED", or defaults to "VARIABLE_STATE_UNSPECIFIED".

text

Returns
Type Description
str or NoneType The text of the variable or None if the property is not set locally.

update_time

Exceptions
Type Description
ValueError if value is not a valid RFC3339 timestamp

value

Returns
Type Description
bytes or NoneType The value of the variable or None if the property is not set locally.

Methods

create

create(client=None)
Parameter
Name Description
client Client

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

Returns
Type Description
bool True if the variable has been created, False on error.

exists

exists(client=None)
Parameter
Name Description
client Client

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

Returns
Type Description
bool True if the variable exists in Cloud RuntimeConfig.

from_api_repr

from_api_repr(resource, config)

Factory: construct a Variable given its API representation

Parameters
Name Description
resource dict

change set representation returned from the API.

config Config

The config to which this variable belongs.

Returns
Type Description
Variable Variable parsed from resource.

reload

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

Parameter
Name Description
client Client

(Optional) The client to use. If not passed, falls back to the client stored on the current config.

update

update(client=None)
Parameter
Name Description
client Client

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

Returns
Type Description
bool True if the variable has been created, False on error.