pycloudlib.oci.utils module

Utilities for OCI images and instances.

pycloudlib.oci.utils.get_subnet_id(network_client: oci.core.VirtualNetworkClient, compartment_id: str, availability_domain: str) → str[source]

Get a subnet id linked to availability_domain.

From specified compartment select the first subnet linked to availability_domain or the first one.

  • network_client – Instance of VirtualNetworkClient.
  • compartment_id – Compartment where the subnet has to belong
  • availability_domain – Domain to look for subnet id in.

The updated version of the current_data

  • Exception if unable to determine subnet_id for
  • availability_domain
pycloudlib.oci.utils.wait_till_ready(func, current_data, desired_state, sleep_seconds=1000)[source]

Wait until the results of function call reach a desired lifecycle state.

  • func – The function to call
  • current_data – Structure containing the initial id and lifecycle state
  • desired_state – Desired value of “lifecycle_state”
  • sleep_seconds – How long to wait in seconds

The updated version of the current_data