google.cloud.forseti.common.gcp_type.instance_group module

A Compute InstanceGroup.

See:
https://cloud.google.com/compute/docs/reference/latest/instanceGroups
class InstanceGroup(**kwargs)[source]

Bases: object

Represents InstanceGroup resource.

_create_json_str()[source]

Creates a json string based on the object attributes.

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

Creates an InstanceGroup from an instance group dict.

Parameters:
  • instance_group (dict) – An instance group resource dict.
  • project_id (str) – A project id for the resource.
Returns:

A new InstanceGroup object.

Return type:

InstanceGroup

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

Creates an InstanceGroup from an instance group JSON string.

Parameters:
  • json_string (str) – A json string representing the instance group.
  • project_id (str) – A project id for the resource.
Returns:

A new InstanceGroup object.

Return type:

InstanceGroup

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 instance group.

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

Construct a Key from specific values.

One and only one of (region, zone) must be specified.

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

the key

Return type:

Key

Raises:

ValueError – an invalid combination of arguments was provided.

classmethod 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

name

Returns:name
Return type:str
Type:Object property
project_id

project_id

Returns:project_id
Return type:str
Type:Object property
region

region

Returns:region
Return type:str
Type:Object property
zone

zone

Returns:zone
Return type:str
Type:Object property