'Attaches a volume.
:param  node: The node to which you\'re attaching the volume.
:type   node: :class:`Node`
:param  volume: The volume you\'re attaching.
:type   volume: :class:`StorageVolume`
:return:    Instance of class ``StorageVolume``
:rtype:     :class:`StorageVolume`'

def attach_volume(self, node, volume):

    action = (node.extra['href'] + '/volumes')
    body = {'id': volume.id}
    data = self.connection.request(action=action, headers={'Content-Type': 'application/json'}, data=body, method='POST', with_full_url=True)
    return self._to_volume(data.object, data.headers)
