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.
39 40 41 42 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 39 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.
60 61 62 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 60 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.
86 87 88 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 86 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.
146 147 148 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 146 def list_records(zone_uuid, headers = {}) get!("zones/#{zone_uuid}/records", {}, headers) end |
#record(zone_uuid, uuid, headers = {}) ⇒ Resources::Record
Get a record object.
191 192 193 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 191 def record(zone_uuid, uuid, headers = {}) Resources::Record.new(self, get_record(zone_uuid, uuid, headers).body) end |
#records(zone_uuid, headers = {}) ⇒ Array<Resource::Record>
Get an array of existing record objects.
200 201 202 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 200 def records(zone_uuid, headers = {}) zone(zone_uuid).records end |
#update_record(zone_uuid, uuid, attributes, headers = {}) ⇒ Response
Update a record.
180 181 182 183 |
# File 'lib/idcf/dns/client_extensions/record.rb', line 180 def update_record(zone_uuid, uuid, attributes, headers = {}) Validators::Record.validate_attributes!(attributes, :update) put!("zones/#{zone_uuid}/records/#{uuid}", attributes, headers) end |