class Croesus::ResourceDSL

Public Class Methods

new(name, &block) click to toggle source
# File lib/croesus/dsl/resource_dsl.rb, line 28
def initialize(name, &block)
  Croesus::ModFactory.instance_method(:initialize).bind(self).call(name)
  instance_eval(&block)
  @description ||= description
  @root ||= root
  add_description(@description)
  add_root_endpoint(@root)
end

Public Instance Methods

delete(path, &block) click to toggle source
# File lib/croesus/dsl/resource_dsl.rb, line 53
def delete(path,  &block) route 'DELETE',  path, &block end
get(path, &block) click to toggle source

The following HTTP methods are supported by the Delphix Appliance:

 GET - Retrieve data from the server where complex input is not needed.
       All GET requests are guaranteed to be read-only, but not all
       read-only requests are required to use GET. Simple input
       (strings, number, boolean values) can be passed as query
       parameters.
POST - Issue a read/write operation, or make a read-only call that
       requires complex input. The optional body of the call is
       expressed as JSON.

DELETE - Delete an object on the system. For languages that don’t provide

a native wrapper for DELETE, or for delete operations with
optional input, all delete operations can also be invoked as POST
to the same URL with /delete appended to it.
# File lib/croesus/dsl/resource_dsl.rb, line 51
def get(path,     &block) route 'GET',     path, &block end
post(path, &block) click to toggle source
# File lib/croesus/dsl/resource_dsl.rb, line 52
def post(path,    &block) route 'POST',    path, &block end
route(verb, path, &block) click to toggle source
# File lib/croesus/dsl/resource_dsl.rb, line 55
def route(verb, path, &block)
  add_method(Croesus::RouteDSL.new(verb, path, &block))
end