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.
15 16 17 18 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 15 def create_zone(attributes, headers = {}) Validators::Zone.validate_attributes!(attributes, :create) post!("zones", attributes, headers) end |
#delete_zone(uuid, headers = {}) ⇒ Response
Delete a zone.
25 26 27 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 25 def delete_zone(uuid, headers = {}) delete!("zones/#{uuid}", {}, headers) end |
#get_zone(uuid, headers = {}) ⇒ Response
Get a zone.
34 35 36 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 34 def get_zone(uuid, headers = {}) get!("zones/#{uuid}", {}, headers) end |
#list_zones(headers = {}) ⇒ Response
Get list of existing zones
42 43 44 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 42 def list_zones(headers = {}) get!("zones", {}, headers) end |
#update_zone(uuid, attributes, headers = {}) ⇒ Response
Update a zone.
54 55 56 57 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 54 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.
64 65 66 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 64 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.
72 73 74 75 76 |
# File 'lib/idcf/dns/client_extensions/zone.rb', line 72 def zones(headers = {}) list_zones(headers).resources.map do |zone| Resources::Zone.new(self, zone) end end |