Class: Dyn::Traffic::SecondaryZone

Inherits:
Object
  • Object
show all
Defined in:
lib/dyn/traffic/secondary_zone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dyn, zone, fqdn, contact_nickname, tsig_key_name, activate, deactivate, retransfer) ⇒ SecondaryZone

Returns a new instance of SecondaryZone.



6
7
8
9
10
11
12
13
14
15
# File 'lib/dyn/traffic/secondary_zone.rb', line 6

def initialize(dyn, zone, fqdn, contact_nickname, tsig_key_name, activate, deactivate, retransfer)
  @dyn = dyn
  @zone = zone
  @fqdn = fqdn
  @contact_nickname = contact_nickname
  @tsig_key_name = tsig_key_name  
  @activate = activate
  @deactivate = deactivate
  @retransfer = retransfer
end

Instance Attribute Details

#activate(activate = true) ⇒ Object

Returns the value of attribute activate.



4
5
6
# File 'lib/dyn/traffic/secondary_zone.rb', line 4

def activate
  @activate
end

#contact_nicknameObject

Returns the value of attribute contact_nickname.



4
5
6
# File 'lib/dyn/traffic/secondary_zone.rb', line 4

def contact_nickname
  @contact_nickname
end

#deactivate(deactivate = true) ⇒ Object

Returns the value of attribute deactivate.



4
5
6
# File 'lib/dyn/traffic/secondary_zone.rb', line 4

def deactivate
  @deactivate
end

#mastersObject

Returns the value of attribute masters.



4
5
6
# File 'lib/dyn/traffic/secondary_zone.rb', line 4

def masters
  @masters
end

#retransfer(retransfer = true) ⇒ Object

Returns the value of attribute retransfer.



4
5
6
# File 'lib/dyn/traffic/secondary_zone.rb', line 4

def retransfer
  @retransfer
end

#tsigObject

Returns the value of attribute tsig.



4
5
6
# File 'lib/dyn/traffic/secondary_zone.rb', line 4

def tsig
  @tsig
end

Instance Method Details

#create(contact_nickname, masters, tsig) ⇒ Object



49
50
51
# File 'lib/dyn/traffic/secondary_zone.rb', line 49

def create(contact_nickname, masters, tsig)
  @dyn.create("#{resource_path}")
end

#fqdn(value = nil) ⇒ Object



21
22
23
# File 'lib/dyn/traffic/secondary_zone.rb', line 21

def fqdn(value=nil)
  value ? (@fqdn = value; self) : @fqdn
end

#getObject



53
54
55
# File 'lib/dyn/traffic/secondary_zone.rb', line 53

def get()
  @dyn.get("#{resource_path}")
end

#resource_pathObject



45
46
47
# File 'lib/dyn/traffic/secondary_zone.rb', line 45

def resource_path
  "Secondary"
end

#to_jsonObject



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/dyn/traffic/secondary_zone.rb', line 73

def to_json
  {
    "zone" => @zone,
    "fqdn" => @fqdn,
    "contact_nickname" => @contact_nickname,
    "masters" => @masters,
    "tsig" => @tsig,
    "activate" => @activate,
    "deactivate" => @deactivate,
    "retransfer" => @retransfer
  }.to_json
end

#tsig_key_nameObject



29
30
31
# File 'lib/dyn/traffic/secondary_zone.rb', line 29

def tsig_key_name()
  value ? (@tsig_key_name = value; self) : @tsig_key_name
end

#update(contact_nickname, masters, tsig) ⇒ Object



57
58
59
# File 'lib/dyn/traffic/secondary_zone.rb', line 57

def update(contact_nickname, masters, tsig)
  @dyn.update("#{resource_path}")
end

#zone(value = nil) ⇒ Object



17
18
19
# File 'lib/dyn/traffic/secondary_zone.rb', line 17

def zone(value=nil)
  value ? (@zone = value; self) : @zone
end