Module: Idcf::Dns::ClientExtensions::Record
- Included in:
- Idcf::Dns::Client
- Defined in:
- lib/idcf/dns/client_extensions/record.rb
Overview
SDK APIs for record resource
Instance Method Summary collapse
-
#create_record(zone_uuid, attributes, headers = {}) ⇒ Response
Create a new record.
-
#delete_record(zone_uuid, uuid, headers = {}) ⇒ Response
Delete a record.
-
#get_record(zone_uuid, uuid, headers = {}) ⇒ Response
Get a record.
-
#list_records(zone_uuid, headers = {}) ⇒ Response
Get list of records.
-
#record(zone_uuid, uuid, headers = {}) ⇒ Resources::Record
Get a record object.
-
#records(zone_uuid, headers = {}) ⇒ Array<Resource::Record>
Get an array of existing record objects.
-
#update_record(zone_uuid, uuid, attributes, headers = {}) ⇒ Response
Update a record.
Instance Method Details
#create_record(zone_uuid, attributes, headers = {}) ⇒ Response
Create a new record.
18 19 20 21 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 18 def create_record(zone_uuid, attributes, headers = {}) Validators::Record.validate_attributes!(attributes, :create) post!("zones/#{zone_uuid}/records", attributes, headers) end |
#delete_record(zone_uuid, uuid, headers = {}) ⇒ Response
Delete a record.
29 30 31 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 29 def delete_record(zone_uuid, uuid, headers = {}) delete!("zones/#{zone_uuid}/records/#{uuid}", {}, headers) end |
#get_record(zone_uuid, uuid, headers = {}) ⇒ Response
Get a record.
39 40 41 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 39 def get_record(zone_uuid, uuid, headers = {}) get!("zones/#{zone_uuid}/records/#{uuid}", {}, headers) end |
#list_records(zone_uuid, headers = {}) ⇒ Response
Get list of records.
47 48 49 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 47 def list_records(zone_uuid, headers = {}) get!("zones/#{zone_uuid}/records", {}, headers) end |
#record(zone_uuid, uuid, headers = {}) ⇒ Resources::Record
Get a record object.
75 76 77 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 75 def record(zone_uuid, uuid, headers = {}) Resources::Record.new(self, get_record(uuid, zone_uuid, headers).body) end |
#records(zone_uuid, headers = {}) ⇒ Array<Resource::Record>
Get an array of existing record objects.
84 85 86 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 84 def records(zone_uuid, headers = {}) zone(zone_uuid).records end |
#update_record(zone_uuid, uuid, attributes, headers = {}) ⇒ Response
Update a record.
64 65 66 67 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 64 def update_record(zone_uuid, uuid, attributes, headers = {}) Validators::Record.validate_attributes!(attributes, :update) put!("zones/#{zone_uuid}/records/#{uuid}", attributes, headers) end |