def get_vm_nic_detail(vcip, vmid, nic): url = 'https://' + vcip + '/rest/vcenter/vm/' + vmid + '/hardware/ethernet/' + nic r = vc_session.get(url,) return r.json()
def get_vm_power_status(vcip, vmid): url = 'https://' + vcip + '/rest/vcenter/vm/' + vmid + '/power' r = vc_session.get(url) return r.json()['value']
def get_vm_nics(vcip, vmid): url = 'https://' + vcip + '/rest/vcenter/vm/' + vmid + '/hardware/ethernet' r = vc_session.get(url) return r.json()
def get_vm_mem(vcip, vmid): url = 'https://' + vcip + '/rest/vcenter/vm/' + vmid + '/hardware/memory/' r = vc_session.get(url) return r.json()
def get_vms_name_id(vcip): url = 'https://' + vcip + '/rest/vcenter/vm' r = vc_session.get(url) return {x['name']: x['vm'] for x in r.json()['value']}
def get_vms(vcip): url = 'https://' + vcip + '/rest/vcenter/vm' r = vc_session.get(url) return r.json()['value']
def get_folders(vcip): url = 'https://' + vcip + '/rest/vcenter/folder' r = vc_session.get(url) return r.json()
def get_datastores(vcip): url = 'https://' + vcip + '/rest/vcenter/datastore' r = vc_session.get(url) return r.json()
def get_hosts(vcip): url = 'https://' + vcip + '/rest/vcenter/host' r = vc_session.get(url) return r.json()
def get_networks(vcip): url = 'https://' + vcip + '/rest/vcenter/network' r = vc_session.get(url) return r.json()