# File lib/fog/profitbricks/requests/compute/attach_volume.rb, line 61
        def attach_volume(datacenter_id, server_id, storage_id)
          if volume = data[:volumes]['items'].find do |vlm|
            vlm["id"] == storage_id && vlm["datacenter_id"] == datacenter_id
          end
          else
            raise Excon::Error::HTTPStatus, "Resource does not exist"
          end

          if server = data[:servers]['items'].find do |serv|
            serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
          end
          else
            raise Excon::Error::HTTPStatus, "Resource does not exist"
          end

          volume['properties'] = {}
          volume['properties']['name'] = volume['name']
          volume['properties']['size'] = volume['size']
          volume['properties']['bus'] = volume['bus']
          volume['properties']['type'] = volume['type']
          volume['properties']['licenceType'] = 'LINUX'

          if server['entities'] && server['entities']['volumes'] && server['entities']['volumes']['items']
            server['entities']['volumes']['items'] << volume
          else
            server['entities'] = {
              'volumes' => {
                'id'    => "#{server_id}/volumes",
                'type'  => 'collection',
                'href'  => "https=>//api.profitbricks.com/rest/v2/datacenters/#{datacenter_id}/servers/#{server_id}/volumes",
                'items' => [volume]
              }
            }
          end

          response        = Excon::Response.new
          response.status = 202
          response.body   = volume

          response
        end