Class Variable (0.31.0)

Variable(name, config)

Parameters

NameDescription
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.

Inheritance

builtins.object > Variable

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
TypeDescription
`ValueErrorif the variable is missing a name.
Returns
TypeDescription
strThe full name based on config and variable names.

path

URL path for the variable's APIs.

Returns
TypeDescription
strThe URL path based on config and variable names.

state

Returns
TypeDescription
strIf set, one of "UPDATED", "DELETED", or defaults to "VARIABLE_STATE_UNSPECIFIED".

update_time

Exceptions
TypeDescription
ValueErrorif value is not a valid RFC3339 timestamp

value

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

Methods

exists

exists(client=None)
Parameter
NameDescription
client Client

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

Returns
TypeDescription
boolTrue if the variable exists in Cloud RuntimeConfig.

from_api_repr

from_api_repr(resource, config)

Factory: construct a Variable given its API representation

Parameters
NameDescription
resource dict

change set representation returned from the API.

config Config

The config to which this variable belongs.

Returns
TypeDescription
VariableVariable 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
NameDescription
client Client

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