# Class Config (0.37.0)

0.37.0 (latest) 0.36.1 0.35.0 0.34.0 0.33.3 0.32.6 0.31.0 0.30.0 0.29.2

    Config(client, name)

A Config resource in the Cloud RuntimeConfig service.

This consists of metadata and a hierarchy of variables.

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

| ## Parameters ||
|---|---|
| **Name** | **Description** |
| `client` | `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.client.Client` A client which holds credentials and project configuration for the config (which requires a project). |
| `name` | `str` The name of the config. |

## Properties

### client

The client bound to this config.

### description

Description of the config object.

See
<https://cloud.google.com/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs#resource-runtimeconfig>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `` str, or `NoneType` `` | the description (None until set from the server). |

### full_name

Fully-qualified name of this variable.

Example:
`projects/my-project/configs/my-config`

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `` `ValueError `` | if the config is missing a name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `str` | The full name based on project and config names. |

### path

URL path for the config's APIs.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `str` | The URL path based on project and config names. |

### project

Project bound to the config.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `str` | the project (derived from the client). |

## Methods

### exists

    exists(client=None)

Determines whether or not this config exists.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `client` | `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.client.Client` (Optional) The client to use. If not passed, falls back to the `client` stored on the current config. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if the config exists in Cloud Runtime Configurator. |

### get_variable

    get_variable(variable_name, client=None)

API call: get a variable via a `GET` request.

This will return None if the variable doesn't exist::
> > > from google.cloud import runtimeconfig
> > > client = runtimeconfig.Client()
> > > config = client.config('my-config')
> > > print(config.get_variable('variable-name'))
> > > \<Variable: my-config, variable-name\>
> > > print(config.get_variable('does-not-exist'))
> > > None

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `variable_name` | `str` The name of the variable to retrieve. |
| `client` | `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.client.Client` (Optional) The client to use. If not passed, falls back to the `client` stored on the current config. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.variable.Variable or None` | The variable object if it exists, otherwise None. |

### list_variables

    list_variables(page_size=None, page_token=None, client=None)

API call: list variables for this config.

This only lists variable names, not the values.

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `page_size` | `int` Optional. The maximum number of variables in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by the API. |
| `page_token` | `str` Optional. If present, return the next batch of variables, using the value, which must correspond to the `nextPageToken` value returned in the previous response. Deprecated: use the `pages` property of the returned iterator instead of manually passing the token. |
| `client` | `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.client.Client` (Optional) The client to use. If not passed, falls back to the `client` stored on the current config. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `` `google.api_core.page_iterator.Iterator` `` | Iterator of [Variable](https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.variable.Variable) belonging to this project. |

### reload

    reload(client=None)

API call: reload the config via a `GET` request.

This method will reload the newest data for the config.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `client` | `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.client.Client` (Optional) The client to use. If not passed, falls back to the client stored on the current config. |

### variable

    variable(variable_name)

Factory constructor for variable object.

> [!NOTE]
> **Note:** This will not make an HTTP request; it simply instantiates a variable object owned by this config.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `variable_name` | `str` The name of the variable to be instantiated. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/python/docs/reference/runtimeconfig/latest/google.cloud.runtimeconfig.variable.Variable` | The variable object created. |