nautobot_ssot_vsphere.utilities

Utilities.

Submodules

Package Contents

Classes

VsphereClient

Class for interacting with VMWare vSphere.

Functions

tag_object(nautobot_object[, custom_field, tag_name])

Apply the given tag and custom field to the identified object.

class nautobot_ssot_vsphere.utilities.VsphereClient(vsphere_uri: str = defaults.VSPHERE_URI, username: str = defaults.VSPHERE_USERNAME, password: str = defaults.VSPHERE_PASSWORD, verify_ssl: bool = is_truthy(defaults.VSPHERE_VERIFY_SSL))

Class for interacting with VMWare vSphere.

_request(method: str, path: str, **kwargs)

Return a response object after making a request to by other methods.

Args:

method (str): Request method to call in self.session. path (str): uri path to call.

Returns:

Response: Response from the API.

get_vms() Dict

Get VMs.

get_vms_from_cluster(cluster: str) Dict

Get VMs.

get_vms_from_dc(datacenter: str) Dict

Get VMs.

get_datacenters() Dict

Get datacenters.

get_datacenter_details(datacenter: str) Dict

Get datacenters.

get_clusters() Dict

Get Clusters.

get_clusters_from_dc(datacenter: str) Dict

Get Clusters.

get_cluster_details(cluster_name: str) Dict

Get Clusters.

get_vm_details(vm_id: str) Dict

Get all VMs details.

get_host_from_cluster(cluster: str) Dict

Get hosts from cluster.

get_host_details(host: str) Dict

Get host details.

get_vm_interfaces(vm_id: str) Dict

Get all VM interfaces.

nautobot_ssot_vsphere.utilities.tag_object(nautobot_object: Any, custom_field: str = 'ssot-synced-from-vsphere', tag_name: str = 'SSoT Synced from vSphere')

Apply the given tag and custom field to the identified object.

Args:

nautobot_object (Any): Nautobot ORM Object custom_field (str): Name of custom field to update tag_name (Optional[str], optional): Tag name. Defaults to “SSoT Synced From vsphere”.