2012-05-16 14:12:08 -04:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Cloudstack
|
|
|
|
class Zone < Fog::Model
|
|
|
|
identity :id, :aliases => 'id'
|
|
|
|
attribute :name
|
|
|
|
attribute :domain_id, :aliases => 'domainid'
|
|
|
|
attribute :domain_name, :aliases => ['domainname', 'domain']
|
|
|
|
attribute :network_type, :aliases => 'networktype'
|
|
|
|
attribute :security_groups_enabled, :aliases => ['securitygroupsenabled', 'securitygroupenabled']
|
|
|
|
attribute :allocation_state, :aliases => 'allocationstate'
|
|
|
|
attribute :zone_token, :aliases => 'zonetoken'
|
|
|
|
attribute :dhcp_provider, :aliases => 'dhcpprovider'
|
|
|
|
|
|
|
|
attr_accessor :dns1, :dns2, :internaldns1, :internaldns2, :guest_cidr_address
|
|
|
|
|
|
|
|
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,
|
2012-07-18 19:00:32 -04:00
|
|
|
'securitygroupenabled' => security_groups_enabled,
|
2012-05-16 14:12:08 -04:00
|
|
|
}
|
2012-12-22 18:28:53 -05:00
|
|
|
data = service.create_zone(options)
|
2012-05-16 14:12:08 -04:00
|
|
|
merge_attributes(data['createzoneresponse'])
|
|
|
|
end
|
|
|
|
end # Zone
|
|
|
|
end # Cloudstack
|
|
|
|
end # Compute
|
|
|
|
end # Fog
|
|
|
|
|