pycloudlib.gce.instance module
GCE instance.
- class pycloudlib.gce.instance.GceInstance(key_pair, instance_id, project, zone, credentials_path, *, name=None, username: str | None = None)[source]
Bases:
BaseInstanceGCE backed instance.
- __init__(key_pair, instance_id, project, zone, credentials_path, *, name=None, username: str | None = None)[source]
Set up the instance.
- Parameters:
key_pair – A KeyPair for SSH interactions
instance_id – Id returned when creating the instance
project – Project instance was created in
zone – Zone instance was created in
name – Name of the instance
username – username to use when connecting via SSH
- delete(wait=True) List[Exception][source]
Delete the instance.
- Parameters:
wait – wait for instance to be deleted
- property id
Return the instance id.
- property ip
Return IP address of instance.
- property name
Return the instance name.