google.cloud.forseti.common.gcp_type.instance_template module

A Compute InstanceTemplate.

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

Bases: object

Represents InstanceTemplate resource.

_create_json_str()[source]

Creates a json string based on the object attributes.

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

Creates an InstanceTemplate from an instance template dict.

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

A new InstanceTemplate object.

Return type:

InstanceTemplate

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

Creates an InstanceTemplate from an instance template JSON string.

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

A new InstanceTemplate object.

Return type:

InstanceTemplate

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

static from_args(project_id, name)[source]

Construct a Key from specific values.

Parameters:
  • project_id (str) – project_id
  • name (str) – name
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