Class: Fog::Compute::Cloudstack::Zone

Inherits:
Model
  • Object
show all
Defined in:
lib/rackspace-fog/cloudstack/models/compute/zone.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Attribute Details

#dns1Object

Returns the value of attribute dns1.



15
16
17
# File 'lib/rackspace-fog/cloudstack/models/compute/zone.rb', line 15

def dns1
  @dns1
end

#dns2Object

Returns the value of attribute dns2.



15
16
17
# File 'lib/rackspace-fog/cloudstack/models/compute/zone.rb', line 15

def dns2
  @dns2
end

#guest_cidr_addressObject

Returns the value of attribute guest_cidr_address.



15
16
17
# File 'lib/rackspace-fog/cloudstack/models/compute/zone.rb', line 15

def guest_cidr_address
  @guest_cidr_address
end

#internaldns1Object

Returns the value of attribute internaldns1.



15
16
17
# File 'lib/rackspace-fog/cloudstack/models/compute/zone.rb', line 15

def internaldns1
  @internaldns1
end

#internaldns2Object

Returns the value of attribute internaldns2.



15
16
17
# File 'lib/rackspace-fog/cloudstack/models/compute/zone.rb', line 15

def internaldns2
  @internaldns2
end

Instance Method Details

#saveObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rackspace-fog/cloudstack/models/compute/zone.rb', line 17

def save
  options = {
    'dns1'                  => dns1,
    'internaldns1'          => internaldns1,
    'name'                  => name,
    'networktype'           => network_type,
    'allocationstate'       => allocation_state,
    'dns2'                  => dns2,
    'domain'                => domain_name,
    'domainid'              => domain_id,
    'guestcidraddress'      => guest_cidr_address,
    'internaldns2'          => internaldns2,
    'securitygroupenabled'  => security_group_enabled,
  }
  data = connection.create_zone(options)
  merge_attributes(data['createzoneresponse'])
end