Module: Idcf::Dns::ClientExtensions::Zone
- Included in:
- Idcf::Dns::Client
- Defined in:
- lib/idcf/dns/client_extensions/zone.rb
Overview
SDK APIs for zone resource
Instance Method Summary collapse
-
#create_zone(attributes, headers = {}) ⇒ Response
Create a new zone.
-
#delete_zone(uuid, headers = {}) ⇒ Response
Delete a zone.
-
#get_zone(uuid, headers = {}) ⇒ Response
Get a zone.
-
#list_zones(headers = {}) ⇒ Response
Get list of existing zones.
-
#update_zone(uuid, attributes, headers = {}) ⇒ Response
Update a zone.
-
#zone(uuid, headers = {}) ⇒ Resources::Zone
Get a zone object.
-
#zones(headers = {}) ⇒ Array<Resources::Zone>
Get an array of existing zone objects.
Instance Method Details
#create_zone(attributes, headers = {}) ⇒ Response
Create a new zone.
74 75 76 77 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 74 def create_zone(attributes, headers = {}) Validators::Zone.validate_attributes!(attributes, :create) post!("zones", attributes, headers) end |
#delete_zone(uuid, headers = {}) ⇒ Response
Delete a zone.
91 92 93 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 91 def delete_zone(uuid, headers = {}) delete!("zones/#{uuid}", {}, headers) end |
#get_zone(uuid, headers = {}) ⇒ Response
Get a zone.
160 161 162 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 160 def get_zone(uuid, headers = {}) get!("zones/#{uuid}", {}, headers) end |
#list_zones(headers = {}) ⇒ Response
Get list of existing zones
180 181 182 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 180 def list_zones(headers = {}) get!("zones", {}, headers) end |
#update_zone(uuid, attributes, headers = {}) ⇒ Response
Update a zone.
256 257 258 259 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 256 def update_zone(uuid, attributes, headers = {}) Validators::Zone.validate_attributes!(attributes, :update) put!("zones/#{uuid}", attributes, headers) end |
#zone(uuid, headers = {}) ⇒ Resources::Zone
Get a zone object.
266 267 268 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 266 def zone(uuid, headers = {}) Resources::Zone.new(self, get_zone(uuid, headers).body) end |
#zones(headers = {}) ⇒ Array<Resources::Zone>
Get an array of existing zone objects.
274 275 276 277 278 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 274 def zones(headers = {}) list_zones(headers).resources.map do |zone| Resources::Zone.new(self, zone) end end |