google.cloud.forseti.common.gcp_type.backend_service module

A Compute Backend Service.

See: https://cloud.google.com/compute/docs/reference/latest/backendServices

class BackendService(**kwargs)[source]

Bases: google.cloud.forseti.common.gcp_type.resource.Resource

Represents BackendService resource.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 199
_abc_registry = <_weakrefset.WeakSet object>
_create_json_str()[source]

Creates a json string based on the object attributes.

Returns:json str.
Return type:str
classmethod from_dict(full_name, backend_service, project_id=None)[source]

Creates a BackendService from dict.

Parameters:
  • full_name (str) – The full resource name and ancestory.
  • backend_service (dict) – A backend service resource dict.
  • project_id (str) – A project id for the resource.
Returns:

A new BackendService object.

Return type:

BackendService

static from_json(full_name, json_string, project_id=None)[source]

Creates a BackendService from a backend service JSON string.

Parameters:
  • full_name (str) – The full resource name and ancestory.
  • json_string (str) – A json string representing the backend service.
  • project_id (str) – A project id for the resource.
Returns:

A new BackendService object.

Return type:

BackendService

json

Returns the json string representation of the resource.

Returns:json str.
Return type:str
key

Returns a Key identifying the object.

Returns:the key
Return type:Key
class Key(object_kind, object_path)[source]

Bases: google.cloud.forseti.common.gcp_type.key.Key

An identifier for a specific backend service.

static from_args(project_id, name, region=None)[source]

Construct a Key from specific values.

Parameters:
  • project_id (str) – project_id
  • name (str) – name
  • region (str) – region (optional)
Returns:

the key

Return type:

Key

static from_url(url)[source]

Construct a Key from a URL.

Parameters:url (str) – Object reference URL
Returns:the key
Return type:Key
Raises:ValueError – Required parameters are missing.
name

Object property – name.

Returns:name
Return type:str
project_id

Object property – project_id.

Returns:project_id
Return type:str