pycloudlib.ibm_classic.instance module

IBM Classic instance class.

class pycloudlib.ibm_classic.instance.IBMClassicInstance(key_pair, *, softlayer_client: BaseClient, vs_manager: VSManager, instance: dict, username: str | None = None)[source]

Bases: BaseInstance

IBM Classic instance class.

__init__(key_pair, *, softlayer_client: BaseClient, vs_manager: VSManager, instance: dict, username: str | None = None)[source]

Set up instance.

console_log()[source]

Return the instance console log.

Raises NotImplementedError if the cloud does not support fetching the console log for this instance.

static create_raw_instance(vs_manager: VSManager, target_image_global_identifier: str, hostname: str, flavor: str, datacenter: str, public_security_group_ids: List[int], private_security_group_ids: List[int], ssh_key_ids: List[int], domain_name: str, **kwargs)[source]

Verify instance configuration and create instance.

Parameters:
  • vs_manager – Softlayer VSManager (Virtual Server Manager) instance

  • target_image_global_identifier – image global identifier

  • hostname – instance hostname

  • flavor – instance flavor

  • datacenter – datacenter region

  • public_security_group_ids – list of public security group ids

  • private_security_group_ids – list of private security group ids

  • ssh_key_ids – list of ssh key ids

  • domain_name – domain name

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.

shutdown(wait=True, **kwargs)[source]

Shutdown the instance.

Parameters:

wait – wait for the instance to shutdown

start(wait=True)[source]

Start the instance.

Parameters:

wait – wait for the instance to start.

wait_for_delete(**kwargs)[source]

Wait for instance to be deleted.

wait_for_restart(old_boot_id)[source]

Wait for instance to be restarted and cloud-init to be complete.

old_boot_id is the boot id prior to restart

wait_for_stop(**kwargs)[source]

Wait for instance stop.