pcf.particle.gcp.compute_engine package¶
Submodules¶
pcf.particle.gcp.compute_engine.vm_instance module¶
-
class
pcf.particle.gcp.compute_engine.vm_instance.
VMInstance
(particle_definition)¶ Bases:
pcf.core.gcp_resource.GCPResource
This is the implementation of Google’s compute service.
-
UNIQUE_KEYS
= ['gcp_resource.name']¶
-
_set_unique_keys
()¶ Logic that sets keys from state definition that are used to uniquely identify the storage bucket
-
_start
()¶ Creates the instance
Returns: response of gcp instances().insert()
-
_stop
()¶ Stops the instance
-
_terminate
()¶ Deletes the instance
Returns: response of gcp instances().delete()
-
_update
()¶ Not Implemented
-
equivalent_states
= {}¶
-
flavor
= 'compute'¶
-
get_status
()¶ Determines if the instance exists
Returns: status (dict)
-
is_state_definition_equivalent
()¶ Determines if desired_state_definition and current_state_definition are equivalent
Returns: bool
-
state_lookup
= {'PROVISIONING': <State.pending: 4>, 'RUNNING': <State.running: 1>, 'STAGING': <State.pending: 4>, 'STOPPED': <State.stopped: 2>, 'STOPPING': <State.pending: 4>, 'SUSPENDED': <State.terminated: 3>, 'SUSPENDING': <State.pending: 4>, 'TERMINATED': <State.terminated: 3>}¶
-
sync_state
()¶ Calls get status and then sets the current state.
-