Module: NSOne::API::Records
- Defined in:
- lib/nsone/api/records.rb
Instance Method Summary collapse
-
#create_record(zone, domain, type, params = {}) ⇒ NSOne::Response
<Description>.
-
#delete_record(zone, domain, type) ⇒ NSOne::Response
Removes an existing record and all associated answers and configuration details.
-
#modify_record(zone, domain, type, params) ⇒ NSOne::Response
Modify an existing record.
-
#record(zone, domain, type) ⇒ NSOne::Response
Returns full configuration for a DNS record including basic config, answers, regions, filter chain configuration, and all metadata tables and data feeds attached to entities in the record.
Instance Method Details
#create_record(zone, domain, type, params = {}) ⇒ NSOne::Response
<Description>
95 96 97 98 99 100 101 102 103 |
# File 'lib/nsone/api/records.rb', line 95 def create_record(zone, domain, type, params = {}) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) raise NSOne::MissingParameter, "domain cannot be blank" if blank?(domain) raise NSOne::MissingParameter, "type cannot be blank" if blank?(type) validate_required!(params, :answers) normalize_names!(zone, domain) params = params.merge(zone: zone, domain: domain, type: type) perform_request(HTTP_PUT, "/v1/zones/#{zone}/#{domain}/#{type}", params) end |
#delete_record(zone, domain, type) ⇒ NSOne::Response
Removes an existing record and all associated answers and configuration details
127 128 129 130 131 132 133 |
# File 'lib/nsone/api/records.rb', line 127 def delete_record(zone, domain, type) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) raise NSOne::MissingParameter, "domain cannot be blank" if blank?(domain) raise NSOne::MissingParameter, "type cannot be blank" if blank?(type) normalize_names!(zone, domain) perform_request(HTTP_DELETE, "/v1/zones/#{zone}/#{domain}/#{type}") end |
#modify_record(zone, domain, type, params) ⇒ NSOne::Response
Modify an existing record. See #create_record for available options.
110 111 112 113 114 115 116 |
# File 'lib/nsone/api/records.rb', line 110 def modify_record(zone, domain, type, params) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) raise NSOne::MissingParameter, "domain cannot be blank" if blank?(domain) raise NSOne::MissingParameter, "type cannot be blank" if blank?(type) normalize_names!(zone, domain) perform_request(HTTP_POST, "/v1/zones/#{zone}/#{domain}/#{type}", params) end |
#record(zone, domain, type) ⇒ NSOne::Response
Returns full configuration for a DNS record including basic config, answers, regions, filter chain configuration, and all metadata tables and data feeds attached to entities in the record
17 18 19 20 21 22 23 |
# File 'lib/nsone/api/records.rb', line 17 def record(zone, domain, type) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) raise NSOne::MissingParameter, "domain cannot be blank" if blank?(domain) raise NSOne::MissingParameter, "type cannot be blank" if blank?(type) normalize_names!(zone, domain) perform_request(HTTP_GET, "/v1/zones/#{zone}/#{domain}/#{type}") end |