def showSubnet(quantumUrl, token, subnet_id): #print 'ENTER showSubnet' address = openstackUtils.parseAddress(quantumUrl) url = openstackUtils.parseBaseURL(quantumUrl, address) + '/v2.0/subnets/' + subnet_id headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showVolume(cinderUrl, token, volume_id): #print 'ENTER showVolume' address = openstackUtils.parseAddress(cinderUrl) url = VOLS_ID % (openstackUtils.parseBaseURL(cinderUrl, address), volume_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showNetwork(quantumUrl, token, network_id): #print 'ENTER showNetwork' address = openstackUtils.parseAddress(quantumUrl) url = openstackUtils.parseBaseURL(quantumUrl, address) + '/v2.0/networks/' + network_id headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listcgDetails(cinderUrl, token): #print 'ENTER listVolumeDetails' address = openstackUtils.parseAddress(cinderUrl) url = openstackUtils.parseBaseURL( cinderUrl, address) + '/consistencygroups' + '/detail' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listVolumeSummaries(cinderUrl, token): #print 'ENTER listVolumeSummaries' address = openstackUtils.parseAddress(cinderUrl) url = VOLS % openstackUtils.parseBaseURL(cinderUrl, address) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showTenantUsage(novaUrl, token, tenant_id): #print 'ENTER showTenantUsage' address = openstackUtils.parseAddress(novaUrl) url = TENANT_USE_ID % (openstackUtils.parseBaseURL(novaUrl, address), tenant_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def getValidationResult(validatorUrl, token): print "ENTER getValidationResult() method" address = openstackUtils.parseAddress(validatorUrl) url = openstackUtils.parseBaseURL(validatorUrl, address) + '/v1/validate/result' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showOnboardingTaskDetails(novaUrl, token, hostName, id): address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + '/os-hosts/' + hostName +\ '/onboard/' + str(id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listVIOSClusters(novaUrl, token, hmcName): address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + \ '/ibm-hmcs/' + hmcName +\ '/ssps' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listOnboardingTasks(novaUrl, token, hostName): address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + '/os-hosts/' + hostName +\ '/onboard' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listUnmanagedServers(novaUrl, token, hostName): address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + \ '/os-hosts/' + hostName + '/all-servers' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def getSCGs(novaUrl, token): #print 'ENTER showFlavor' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + '/storage-connectivity-groups' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listUsers2(keystoneUrl, token): #print 'ENTER listUsers' address = openstackUtils.parseAddress(keystoneUrl) url = openstackUtils.parseBaseURL(keystoneUrl, address) + '/users' headers = {'X-Auth-Token': token} #return restUtils.getJSON(address, url, headers)['users'] return restUtils.getJSON(address, url, headers)
def showUser(keystoneUrl, token, user_id): #print 'ENTER showUser' address = openstackUtils.parseAddress(keystoneUrl) url = openstackUtils.parseBaseURL(keystoneUrl, address) + '/users/' + user_id headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)['user']
def listexistingHosts(novaUrl, token): address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL( novaUrl, address ) + '/os-hypervisors/' + '/detail?include_remote_restart_enabled=true' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showPlacementPolicy(novaUrl, token, policy_id): #print 'ENTER showPlacementPolicy' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + \ '/ego/policy/placement/' + str(policy_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listImages(glanceUrl, token): #print 'ENTER listImages' address = openstackUtils.parseAddress(glanceUrl) url = openstackUtils.parseBaseURL(glanceUrl, address) + '/v2.0/images?limit=400' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listPlacementPolicies(novaUrl, token): #print 'ENTER listPlacementPolicies' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + '/ego/policy/placement' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showExtension(novaUrl, token, extension_id): #print 'ENTER showExtension' address = openstackUtils.parseAddress(novaUrl) url = EXTS_ID % (openstackUtils.parseBaseURL(novaUrl, address), extension_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showHypervisor(novaUrl, token, hypervisor_id): #print 'ENTER showHypervisor' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + \ '/os-hypervisors/' + str(hypervisor_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showVolumeAttachment(novaUrl, token, server_id, attachment_id): #print 'ENTER showVolumeAttachment' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + '/servers/' + \ server_id + '/os-volume_attachments/' + attachment_id headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showHost(novaUrl, token, host_name): #print 'ENTER showHost' address = openstackUtils.parseAddress(novaUrl) url = HOSTS_NAME % (openstackUtils.parseBaseURL(novaUrl, address), host_name) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listHypervisorDetails(novaUrl, token): #print 'ENTER listHypervisorDetails' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL(novaUrl, address) + \ '/os-hypervisors/detail' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showServer_per_host(novaUrl, token, server_id, host_id): #print 'ENTER showServer' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL( novaUrl, address) + "/" + server_id + '?host=' + host_id headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showServerDiagnostics(novaUrl, token, server_id): #print 'ENTER showServerDiagnostics' address = openstackUtils.parseAddress(novaUrl) url = SVR_DIAGS % (openstackUtils.parseBaseURL(novaUrl, address), server_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listServerSummaries_host(novaUrl, token, host_id): #print 'ENTER listServerSummaries' address = openstackUtils.parseAddress(novaUrl) url = openstackUtils.parseBaseURL( novaUrl, address) + "/servers/detail?host=" + host_id headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showTenantQuotaSetDefaults(novaUrl, token, tenant_id): #print 'ENTER showTenantQuotaSetDefaults' address = openstackUtils.parseAddress(novaUrl) url = QUOTA_SETS_DFLT % (openstackUtils.parseBaseURL(novaUrl, address), tenant_id) headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def showv3Tenants(address, token): #print 'ENTER showv2Tenants' # address = address + ':5000' # url = '/v2.0/tenants' url = '/powervc/openstack/identity/v3.0/tenants' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)
def listUsersForGroup(keystoneUrl, token, group_id): #print 'ENTER listUsersForGroup' address = openstackUtils.parseAddress(keystoneUrl) url = openstackUtils.parseBaseURL( keystoneUrl, address) + '/groups/' + group_id + '/users' headers = {'X-Auth-Token': token} return restUtils.getJSON(address, url, headers)['users']
def showImage(glanceUrl, token, image_id): #print 'ENTER showImage' address = openstackUtils.parseAddress(glanceUrl) url = openstackUtils.parseBaseURL(glanceUrl, address) + '/v2.0/images/' + image_id headers = {'X-Auth-Token': token} # return restUtils.getJSON(address, url, headers) return restUtils.getJSON(address, url, headers)