Variable(name, config)
A variable in the Cloud RuntimeConfig service.
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. |
Inheritance
builtins.object > VariableProperties
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
Type | Description |
`ValueError | if the variable is missing a name. |
Type | Description |
str | The full name based on config and variable names. |
path
URL path for the variable's APIs.
Type | Description |
str | The URL path based on config and variable names. |
state
Retrieve the state of the variable.
Type | Description |
str | If set, one of "UPDATED", "DELETED", or defaults to "VARIABLE_STATE_UNSPECIFIED". |
text
Text of the variable, as string.
Type | Description |
str or ``NoneType`` | The text of the variable or ``None`` if the property is not set locally. |
update_time
Retrieve the timestamp at which the variable was updated.
Type | Description |
ValueError | if value is not a valid RFC3339 timestamp |
value
Value of the variable, as bytes.
Type | Description |
bytes or ``NoneType`` | The value of the variable or ``None`` if the property is not set locally. |
Methods
create
create(client=None)
API call: create the variable via a POST request
Name | Description |
client |
Client
(Optional) The client to use. If not passed, falls back to the |
Type | Description |
bool | True if the variable has been created, False on error. |
exists
exists(client=None)
API call: test for the existence of the variable via a GET request
Name | Description |
client |
Client
(Optional) The client to use. If not passed, falls back to the |
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
Name | Description |
resource |
dict
change set representation returned from the API. |
config |
Config
The config to which this variable belongs. |
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.
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)
API call: update the variable via a PUT request
Name | Description |
client |
Client
(Optional) The client to use. If not passed, falls back to the |
Type | Description |
bool | True if the variable has been created, False on error. |