Sha256: a05c870ccbf3afca84f9e690898e1be560a8851e5a922a5877af0298d295e99c

Contents?: true

Size: 651 Bytes

Versions: 26

Compression:

Stored size: 651 Bytes

Contents

module Cuboid
module Rest
class Server
module Routes

module Grid

    def self.registered( app )

        app.get '/grid' do
            ensure_agent!

            handle_error do
                json [Options.agent.url] + agent.statistics['node']['peers']
            end
        end

        app.get '/grid/:agent' do |url|
            ensure_agent!

            handle_error { json connect_to_agent( url ).statistics }
        end

        app.delete '/grid/:agent' do |url|
            ensure_agent!

            handle_error do
                unplug_agent( url )
            end

            json nil
        end

    end

end

end
end
end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
cuboid-0.2.11 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.10 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.9 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.8 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.7 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.6 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.5 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.4.2 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.4.1 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.4 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.3 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.2 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2.1 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.2 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.1.9.1 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.1.9 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.1.8 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.1.7 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.1.6.1 lib/cuboid/rest/server/routes/grid.rb
cuboid-0.1.6 lib/cuboid/rest/server/routes/grid.rb