예제 #1
0
	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
예제 #2
0
	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"]
예제 #3
0
    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
예제 #4
0
    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"]