Module: NS1::API::Zones
- Defined in:
- lib/ns1/api/zones.rb
Instance Method Summary collapse
- #create_zone(zone, params = {}) ⇒ Object
- #delete_zone(zone) ⇒ Object
- #modify_zone(zone, params) ⇒ Object
- #zone(zone) ⇒ Object
- #zones ⇒ Object
Instance Method Details
#create_zone(zone, params = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/ns1/api/zones.rb', line 15 def create_zone(zone, params = {}) raise NS1::MissingParameter, "zone cannot be blank" if blank?(zone) params = params.merge(zone: zone) perform_request(HTTP_PUT, "/v1/zones/#{zone}", params) end |
#delete_zone(zone) ⇒ Object
26 27 28 29 |
# File 'lib/ns1/api/zones.rb', line 26 def delete_zone(zone) raise NS1::MissingParameter, "zone cannot be blank" if blank?(zone) perform_request(HTTP_DELETE, "/v1/zones/#{zone}") end |
#modify_zone(zone, params) ⇒ Object
21 22 23 24 |
# File 'lib/ns1/api/zones.rb', line 21 def modify_zone(zone, params) raise NS1::MissingParameter, "zone cannot be blank" if blank?(zone) perform_request(HTTP_POST, "/v1/zones/#{zone}", params) end |
#zone(zone) ⇒ Object
10 11 12 13 |
# File 'lib/ns1/api/zones.rb', line 10 def zone(zone) raise NS1::MissingParameter, "zone cannot be blank" if blank?(zone) perform_request(HTTP_GET, "/v1/zones/#{zone}") end |
#zones ⇒ Object
6 7 8 |
# File 'lib/ns1/api/zones.rb', line 6 def zones perform_request(HTTP_GET, "/v1/zones") end |