Class: Route

Inherits:
Object
  • Object
show all
Includes:
ConfigReader
Defined in:
lib/route.rb

Instance Method Summary collapse

Methods included from ConfigReader

#param

Constructor Details

#initialize ⇒ Route

Returns a new instance of Route.



8
9
10
# File 'lib/route.rb', line 8

def initialize
  @common = CommonRestUtils.new(param("rest_base_url") + "mcc/")
end

Instance Method Details

#add_zone ⇒ Object



48
49
# File 'lib/route.rb', line 48

def add_zone()
end

#copy_zone(from, to) ⇒ Object



37
38
39
40
41
# File 'lib/route.rb', line 37

def copy_zone(from, to)
  suffix = customer_suffix("dns/routezone/copy")
  body = {:FromDomainName => from, :ToDomainName => to}
  callMethod(suffix, :post, body)
end

#customer_suffix(suffix) ⇒ Object



12
13
14
# File 'lib/route.rb', line 12

def customer_suffix(suffix)
  "customers/" + param("acct-num") + "/" + suffix
end

#delete_zone(id) ⇒ Object



43
44
45
46
# File 'lib/route.rb', line 43

def delete_zone(id)
  suffix = customer_suffix("dns/routezone/" + id)
  callMethod(suffix, :delete)
end

#get_all_zones(status = nil, zone_type = nil) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/route.rb', line 20

def get_all_zones(status=nil, zone_type=nil)
  suffix = "dns/routezones"
  if status != nil && zone_type != nil
    suffix = suffix + "?status=" + status + "&zonetype=" + zone_type
  elsif status != nil
    suffix = suffix + "?status=" + status
  elsif zone_type != nil
    suffix = suffix + "?zonetype=" + zone_type
  end
  @common.callMethod(customer_suffix(suffix), :get)
end

#get_available_health_check_reintegration_methods ⇒ Object



79
80
81
# File 'lib/route.rb', line 79

def get_available_health_check_reintegration_methods()
  callMethod(non_customer_suffix("routereintegrationmethodtypes"), :get)
end

#get_available_health_check_types ⇒ Object



75
76
77
# File 'lib/route.rb', line 75

def get_available_health_check_types()
  callMethod(non_customer_suffix("routehealthchecktypes"), :get)
end

#get_available_http_methods ⇒ Object



67
68
69
# File 'lib/route.rb', line 67

def get_available_http_methods()
  callMethod(non_customer_suffix("routehttpmethodtypes"), :get)
end

#get_available_ip_versions ⇒ Object



71
72
73
# File 'lib/route.rb', line 71

def get_available_ip_versions()
  callMethod(non_customer_suffix("routehealthcheckipversion"), :get)
end

#get_available_record_types ⇒ Object



55
56
57
# File 'lib/route.rb', line 55

def get_available_record_types()
  callMethod(non_customer_suffix("routezonerecordtypes"), :get)
end

#get_available_route_groups ⇒ Object



63
64
65
# File 'lib/route.rb', line 63

def get_available_route_groups()
  callMethod(non_customer_suffix("routegrouptypes"), :get)
end

#get_available_zone_statuses ⇒ Object



59
60
61
# File 'lib/route.rb', line 59

def get_available_zone_statuses()
  callMethod(non_customer_suffix("routezonestatus"), :get)
end

#get_available_zone_types ⇒ Object



51
52
53
# File 'lib/route.rb', line 51

def get_available_zone_types()
  callMethod(non_customer_suffix("routezonetypes"), :get)
end

#get_zone(id, name) ⇒ Object



32
33
34
35
# File 'lib/route.rb', line 32

def get_zone(id, name)
  suffix = "dns/routezone?id=" + id + "&name=" + name
  callMethod(customer_suffix(suffix), :get)
end

#non_customer_suffix(suffix) ⇒ Object



16
17
18
# File 'lib/route.rb', line 16

def non_customer_suffix(suffix)
  "/dns/" + suffix
end