Sha256: 6f948b48e464e8d64207ae77046920ba689e6d850a4e6af76469fb4fdfc7d5cd

Contents?: true

Size: 651 Bytes

Versions: 26

Compression:

Stored size: 651 Bytes

Contents

module Cuboid
module Rest
class Server
module Routes

module Agent

    def self.registered( app )

        app.get '/agent/url' do
            ensure_agent!

            json Options.agent.url
        end

        app.put '/agent/url' do
            url = ::JSON.load( request.body.read ) || {}

            handle_error do
                connect_to_agent( url ).alive?

                @agent = nil
                Options.agent.url = url
                json nil
            end
        end

        app.delete '/agent/url' do
            ensure_agent!

            json @agent = Options.agent.url = 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/agent.rb
cuboid-0.2.10 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.9 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.8 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.7 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.6 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.5 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.4.2 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.4.1 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.4 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.3 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.2 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2.1 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.2 lib/cuboid/rest/server/routes/agent.rb
cuboid-0.1.9.1 lib/cuboid/rest/server/routes/dispatcher.rb
cuboid-0.1.9 lib/cuboid/rest/server/routes/dispatcher.rb
cuboid-0.1.8 lib/cuboid/rest/server/routes/dispatcher.rb
cuboid-0.1.7 lib/cuboid/rest/server/routes/dispatcher.rb
cuboid-0.1.6.1 lib/cuboid/rest/server/routes/dispatcher.rb
cuboid-0.1.6 lib/cuboid/rest/server/routes/dispatcher.rb