pycloudlib.openstack.instance module
Openstack instance type.
- class pycloudlib.openstack.instance.OpenstackInstance(key_pair, instance_id, network_id, connection=None, *, username: str | None = None)[source]
Bases:
BaseInstance
Openstack instance object.
- __init__(key_pair, instance_id, network_id, connection=None, *, username: str | None = None)[source]
Set up the instance.
- Parameters:
key_pair – A KeyPair for SSH interactions
instance_id – The instance id representing the cloud instance
network_id – if of the network this instance was created on
connection – The connection used to create this instance. If None, connection will be created.
username – username to use when connecting via SSH
- add_network_interface(**kwargs) str [source]
Add nic to running instance.
Returns IP address in string form
- delete(wait=True) List[Exception] [source]
Delete the instance.
- Parameters:
wait – wait for instance to be deleted
- property id: str
Return instance id.
- property ip
Return IP address of instance.
- property name
Return instance name.