def getVDC(self): """ Retrieve XML representation of the organization """ url = xml_helper.getHref(self.getOrganisation(),'vdc') headers = rest_helper.buildHeaders(Accept="application/*+xml;version=5.11",x_vcloud_authorization=self.xvcloud_authorization) response = requests.get(url, headers=headers) return response.content
def login(self,password): """ Login to VCA on demand service and get the OAuth Token """ url = "https://us-virginia-1-4.vchs.vmware.com/api/compute/api/sessions" headers = rest_helper.buildHeaders(Accept="application/*+xml;version=5.11",Authorization="Basic "+self._encode(password)) response = requests.post(url, headers=headers) self.baseCloudXML=response.content; self.xvcloud_authorization = response.headers["x-vcloud-authorization"]
def getVDC(self): """ Retrieve XML representation of the organization """ url = xml_helper.getHref(self.getOrganisation(), 'vdc') headers = rest_helper.buildHeaders( Accept="application/*+xml;version=5.11", x_vcloud_authorization=self.xvcloud_authorization) response = requests.get(url, headers=headers) return response.content
def login(self, password): """ Login to VCA on demand service and get the OAuth Token """ url = "https://us-virginia-1-4.vchs.vmware.com/api/compute/api/sessions" headers = rest_helper.buildHeaders( Accept="application/*+xml;version=5.11", Authorization="Basic " + self._encode(password)) response = requests.post(url, headers=headers) self.baseCloudXML = response.content self.xvcloud_authorization = response.headers["x-vcloud-authorization"]