dell_storagecenter_driver/dell_storagecenter_api.py
def open_connection(self):
        """Authenticate against Dell Enterprise Manager.

        :raises: VolumeBackendAPIException.
        """

        payload = {}
        payload['Application'] = 'Flocker REST Driver'
        payload['ApplicationVersion'] = self.APIVERSION
        r = self.client.post('ApiConnection/Login',
                             payload)

        if not self._check_result(r):
            raise Exception('Failed to connect to Enterprise Manager.')

        # We should be logged in.  Try to grab the api version out of the
        # response.
        try:
            apidict = self._get_json(r)
            version = apidict['apiVersion']
            splitver = version.split('.')
            # REST API only available starting with 2.0, but 2.0 and 2.1
            # did filtering a little differently
            if splitver[0] == '2' and splitver[1] in ['0', '1']:
                self.legacypayloadfilters = True
        except Exception:
            # Good return but not the login response we were expecting.
            # Log it and error out.
            LOG.error('Unrecognized Login Response: %s', r)
Authenticate against Dell Enterprise Manager.

        :raises: VolumeBackendAPIException.
        
Authenticate against Dell Enterprise Manager.
Authenticate against Dell Enterprise Manager .
def open_connection(self):
        payload = {}
        payload['Application'] = 'Flocker REST Driver'
        payload['ApplicationVersion'] = self.APIVERSION
        r = self.client.post('ApiConnection/Login',
                             payload)
        if not self._check_result(r):
            raise Exception('Failed to connect to Enterprise Manager.')
        try:
            apidict = self._get_json(r)
            version = apidict['apiVersion']
            splitver = version.split('.')
            if splitver[0] == '2' and splitver[1] in ['0', '1']:
                self.legacypayloadfilters = True
        except Exception:
            LOG.error('Unrecognized Login Response: %s', r)
def open_connection ( self ) : payload = { } payload [ 'Application' ] = 'Flocker REST Driver' payload [ 'ApplicationVersion' ] = self . APIVERSION r = self . client . post ( 'ApiConnection/Login' , payload ) if not self . _check_result ( r ) : raise Exception ( 'Failed to connect to Enterprise Manager.' ) try : apidict = self . _get_json ( r ) version = apidict [ 'apiVersion' ] splitver = version . split ( '.' ) if splitver [ 0 ] == '2' and splitver [ 1 ] in [ '0' , '1' ] : self . legacypayloadfilters = True except Exception : LOG . error ( 'Unrecognized Login Response: %s' , r )
Authenticate against Dell Enterprise Manager.
Authenticate against Dell Enterprise Manager .
"""Authenticate against Dell Enterprise Manager.

        :raises: VolumeBackendAPIException.
        """ # We should be logged in.  Try to grab the api version out of the # response. # REST API only available starting with 2.0, but 2.0 and 2.1 # did filtering a little differently # Good return but not the login response we were expecting. # Log it and error out.
None
self