mixcoatl/infrastructure/volume.py
def attach(self, server_id, device_id=None, callback=None):
        """Attach a volume to a server

        :param server_id: Server to attach the volume
        :type server_id: int.
        :param callback: Optional callback to send the results
        :returns: :class:`Volume`
        :raises: :class:`VolumeException`
        """
        payload = {'attach': [{'server': {'server_id': server_id}}]}

        if device_id is not None:
            payload['attach'][0]['device_id'] = device_id

        self.put(self.PATH + '/' + str(self.volume_id),
                 data=json.dumps(camel_keys(payload)))

        if self.last_error is None:
            if callback is None:
                return self
            else:
                callback(self)
        else:
            raise VolumeException(self.last_error)
Attach a volume to a server

        :param server_id: Server to attach the volume
        :type server_id: int.
        :param callback: Optional callback to send the results
        :returns: :class:`Volume`
        :raises: :class:`VolumeException`
        
Attach a volume to a server
Attach a volume to a server
def attach(self, server_id, device_id=None, callback=None):
        payload = {'attach': [{'server': {'server_id': server_id}}]}
        if device_id is not None:
            payload['attach'][0]['device_id'] = device_id
        self.put(self.PATH + '/' + str(self.volume_id),
                 data=json.dumps(camel_keys(payload)))
        if self.last_error is None:
            if callback is None:
                return self
            else:
                callback(self)
        else:
            raise VolumeException(self.last_error)
def attach ( self , server_id , device_id = None , callback = None ) : payload = { 'attach' : [ { 'server' : { 'server_id' : server_id } } ] } if device_id is not None : payload [ 'attach' ] [ 0 ] [ 'device_id' ] = device_id self . put ( self . PATH + '/' + str ( self . volume_id ) , data = json . dumps ( camel_keys ( payload ) ) ) if self . last_error is None : if callback is None : return self else : callback ( self ) else : raise VolumeException ( self . last_error )
Attach a volume to a server
Attach a volume to a server
"""Attach a volume to a server

        :param server_id: Server to attach the volume
        :type server_id: int.
        :param callback: Optional callback to send the results
        :returns: :class:`Volume`
        :raises: :class:`VolumeException`
        """
None
None
self
server_id
Server to attach the volume
Server to attach the volume
device_id
callback
Optional callback to send the results
Optional callback to send the results