port="8080" vm_fqn = 'fqn6' vm_ip = '130.206.80.112' product_name = 'tomcat' product_version = '6' vdc = '60b4125450fc4a109f50357894ba2e28' keystone_ip = "130.206.80.63" keystone_port = "35357" #vdc = 'ebe6d9ec7b024361b7a3882c65a57dda' user = '******' password='******' project ='henarproject' token = utils.obtainToken (keystone_ip, keystone_port, user, password, project) print(token) headers = {'Content-Type': 'application/xml', 'X-Auth-Token': token , 'Tenant-ID': vdc} print(headers) print('Get products in the software catalogue: ') resource = "/sdc/rest/catalog/product" data1 = utils.doRequestHttpOperation(domine, port,resource, 'GET',None, headers) print(" OK") dom = parseString(data1) try: product = (dom.getElementsByTagName('product'))[0] productname = product.firstChild.firstChild.nodeValue print('First product in the software catalogue') print(" OK " + productname)
port = "8080" resource = "/sdc/rest/catalog/product" vm_fqn = 'fqn6' vm_ip = '130.206.80.114' product_name = 'test' product_version = '0.1' #vdc = 'test3' keystone_ip = "130.206.80.63" keystone_port = "35357" vdc = '60b4125450fc4a109f50357894ba2e28' user = '******' password = '******' project = 'henarproject' token = utils.obtainToken(keystone_ip, keystone_port, user, password, project) print(token) headers = { 'Content-Type': 'application/xml', 'X-Auth-Token': token, 'Tenant-ID': vdc } print(headers) print('Get products in the software catalogue: ') resource = "/sdc/rest/catalog/product" data1 = utils.doRequestHttpOperation(domine, port, resource, 'GET', None, headers) dom = parseString(data1)