예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
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)
예제 #6
0
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)
예제 #7
0
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)
예제 #8
0
def removevNIC(novaUrl, token, serverid, attachment_id):
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(
        novaUrl,
        address) + '/servers/' + serverid + '/os-interface/' + attachment_id
    headers = {'X-Auth-Token': token}
    return restUtils.request('DELETE', address, url, headers)
예제 #9
0
def dettachVolume(novaUrl, token, vm_id, vol_id):
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(
        novaUrl,
        address) + "/servers/" + vm_id + "/os-volume_attachments/" + vol_id
    headers = {'X-Auth-Token': token}
    return restUtils.request('DELETE', address, url, headers)
예제 #10
0
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)
예제 #11
0
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)
예제 #12
0
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)
예제 #13
0
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 deleteImage(glanceUrl, token, image_id):
    #print 'ENTER deleteImage'
    address = openstackUtils.parseAddress(glanceUrl)
    url = openstackUtils.parseBaseURL(glanceUrl,
                                      address) + '/v2.0/images/' + image_id
    headers = {'X-Auth-Token': token}
    return restUtils.request('DELETE', address, url, headers)
예제 #15
0
def createServer(novaUrl, token, serverProps):
    #print 'ENTER createServer'
    address = openstackUtils.parseAddress(novaUrl)
    url = SVRS % openstackUtils.parseBaseURL(novaUrl, address)
    postBody = json.dumps({'server': serverProps})
    headers = {'X-Auth-Token': token}
    return restUtils.postJSON(address, url, postBody, headers)
예제 #16
0
def deleteVolumeAttachment(novaUrl, token, server_id, attachment_id):
    #print 'ENTER deleteVolumeAttachment'
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(novaUrl, address) + '/servers/' + \
        server_id + '/os-volume_attachments/' + attachment_id
    headers = {'X-Auth-Token': token}
    return restUtils.request('DELETE', address, url, headers)
예제 #17
0
def createServerAction(novaUrl, token, server_id, actionProps):
    #print 'ENTER createServerAction'
    address = openstackUtils.parseAddress(novaUrl)
    url = SVR_ACT % (openstackUtils.parseBaseURL(novaUrl, address), server_id)
    postBody = json.dumps(actionProps)
    headers = {'X-Auth-Token': token}
    return restUtils.postJSON(address, url, postBody, headers)
예제 #18
0
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)
예제 #19
0
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)
예제 #20
0
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)
예제 #21
0
def createFlavor(novaUrl, token, flavorProps):
    #print 'ENTER createFlavor'
    address = openstackUtils.parseAddress(novaUrl)
    url = FLAVS % openstackUtils.parseBaseURL(novaUrl, address)
    postBody = json.dumps({'flavor': flavorProps})
    headers = {'X-Auth-Token': token}
    return restUtils.postJSON(address, url, postBody, headers)
예제 #22
0
def unregisterneoHostwithpvc(novaUrl, token, host_name):
    #print 'ENTER deleteHost'
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(novaUrl, address) + \
        '/os-hosts/' + host_name + '/uninstall'
    headers = {'X-Auth-Token': token}
    return restUtils.request('DELETE', address, url, headers)
예제 #23
0
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)
예제 #24
0
def createSCGs(novaUrl, token, scg_props):
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(novaUrl,
                                      address) + '/storage-connectivity-groups'
    postBody = json.dumps({'storage_connectivity_group': scg_props})
    headers = {'X-Auth-Token': token}
    return restUtils.postJSON(address, url, postBody, headers)
예제 #25
0
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 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)
예제 #27
0
def onboardUnmanagedServers(novaUrl, token, hostName, serversProps):
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(novaUrl,
                                    address) + \
                                    '/os-hosts/' + hostName + '/onboard'
    postBody = json.dumps({'servers': serversProps})
    headers = {'X-Auth-Token': token}
    return restUtils.postJSON(address, url, postBody, headers)
예제 #28
0
def updatePlacementPolicy(novaUrl, token, policy_id, policyProps):
    #print 'ENTER updatePlacementPolicy'
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(novaUrl, address) + \
        '/ego/policy/placement/' + str(policy_id)
    putBody = json.dumps({'placement_policy': policyProps})
    headers = {'X-Auth-Token': token}
    return restUtils.putJSON(address, url, putBody, headers)
예제 #29
0
def HostMaintence(novaUrl, token, host_name, hyperProps):

    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(
        novaUrl, address) + '/ego/prs/hypervisor_maintenance/' + host_name
    headers = {'X-Auth-Token': token}
    putBody = json.dumps({'Maintenance': hyperProps})
    return restUtils.putJSON(address, url, putBody, headers)
예제 #30
0
def addvNIC_dy(novaUrl, token, serverid, network_id):
    address = openstackUtils.parseAddress(novaUrl)
    url = openstackUtils.parseBaseURL(novaUrl, address) + \
        '/servers/' + serverid + '/os-interface'
    postBody = json.dumps({"interfaceAttachment": {"net_id": network_id}})
    headers = {'X-Auth-Token': token}
    print '\nExiting from addvNic function..\n'
    return restUtils.postJSON(address, url, postBody, headers)