Class: Epom::Zone

Inherits:
EpomElement show all
Defined in:
lib/epom/zone.rb

Class Method Summary collapse

Methods inherited from EpomElement

generic_method, login, method_missing, params_validation, respond_to?

Class Method Details

.extended_methodsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/epom/zone.rb', line 6

def self.extended_methods
  {
      :delete_zone => {
          :url => '/rest-api/zones/ZONE_ID/delete.do',
          :url_parameters => [:zoneId],
          :body_parameters => [:hash, :timestamp, :username],
          :method => :post
      },
      :get_zone_placements => {
          :url => '/rest-api/zones/ZONE_ID/placements.do',
          :url_parameters => [:zoneId],
          :body_parameters => [:hash, :timestamp, :username],
          :method => :get
      },
      :update_zone => {
          :url => '/rest-api/zones/update.do',
          :body_parameters => [:id, :siteId, :description, :name, :hash, :timestamp, :username],
          :method => :post
      },
      :create_zone => {
          :url => '/rest-api/zones/update.do',
          :body_parameters => [:siteId, :description, :name, :hash, :timestamp, :username],
          :method => :post
      }
  }
end

.replace_params_in_url(url, url_params) ⇒ Object



33
34
35
36
# File 'lib/epom/zone.rb', line 33

def self.replace_params_in_url(url, url_params)
   url.gsub!('ZONE_ID', url_params[:zoneId].to_s) if url.include?('ZONE_ID')
   url
end