Class: OCI::Dns::DnsClient
- Inherits:
-
Object
- Object
- OCI::Dns::DnsClient
- Defined in:
- lib/oci/dns/dns_client.rb
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
Instance Method Summary collapse
-
#create_zone(create_zone_details, opts = {}) ⇒ Response
Creates a new zone in the specified compartment.
-
#delete_domain_records(zone_name_or_id, domain, opts = {}) ⇒ Response
Deletes all records at the specified zone and domain.
-
#delete_rr_set(zone_name_or_id, domain, rtype, opts = {}) ⇒ Response
Deletes all records in the specified RRSet.
-
#delete_zone(zone_name_or_id, opts = {}) ⇒ Response
Deletes the specified zone.
-
#get_domain_records(zone_name_or_id, domain, opts = {}) ⇒ Response
Gets a list of all records at the specified zone and domain.
-
#get_rr_set(zone_name_or_id, domain, rtype, opts = {}) ⇒ Response
Gets a list of all records in the specified RRSet.
-
#get_zone(zone_name_or_id, opts = {}) ⇒ Response
Gets information about the specified zone, including its creation date, zone type, and serial.
-
#get_zone_records(zone_name_or_id, opts = {}) ⇒ Response
Gets all records in the specified zone.
-
#initialize(config: nil, region: nil, signer: nil) ⇒ DnsClient
constructor
Creates a new DnsClient.
-
#list_zones(compartment_id, opts = {}) ⇒ Response
Gets a list of all zones in the specified compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#patch_domain_records(zone_name_or_id, domain, patch_domain_records_details, opts = {}) ⇒ Response
Replaces records in the specified zone at a domain.
-
#patch_rr_set(zone_name_or_id, domain, rtype, patch_rr_set_details, opts = {}) ⇒ Response
Updates records in the specified RRSet.
-
#patch_zone_records(zone_name_or_id, patch_zone_records_details, opts = {}) ⇒ Response
Updates a collection of records in the specified zone.
-
#update_domain_records(zone_name_or_id, domain, update_domain_records_details, opts = {}) ⇒ Response
Replaces records in the specified zone at a domain with the records specified in the request body.
-
#update_rr_set(zone_name_or_id, domain, rtype, update_rr_set_details, opts = {}) ⇒ Response
Replaces records in the specified RRSet.
-
#update_zone(zone_name_or_id, update_zone_details, opts = {}) ⇒ Response
Updates the specified secondary zone with your new external master server information.
-
#update_zone_records(zone_name_or_id, update_zone_records_details, opts = {}) ⇒ Response
Replaces records in the specified zone with the records specified in the request body.
Constructor Details
#initialize(config: nil, region: nil, signer: nil) ⇒ DnsClient
Creates a new DnsClient. If a config is not specified, then the global OCI.config will be used.
A region must be specified in either the config or the region parameter. If specified in both, then the region parameter will be used.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/oci/dns/dns_client.rb', line 34 def initialize(config:nil, region:nil, signer:nil) # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals) # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then # pass it to this constructor. # # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid # so try and load the config from the default file. config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) if signer.nil? signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content, signing_strategy: Signer::STANDARD) end @api_client = ApiClient.new(config, signer) region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
12 13 14 |
# File 'lib/oci/dns/dns_client.rb', line 12 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
16 17 18 |
# File 'lib/oci/dns/dns_client.rb', line 16 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
20 21 22 |
# File 'lib/oci/dns/dns_client.rb', line 20 def region @region end |
Instance Method Details
#create_zone(create_zone_details, opts = {}) ⇒ Response
Creates a new zone in the specified compartment. The ‘compartmentId` query parameter is required if the `Content-Type` header for the request is `text/dns`.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/oci/dns/dns_client.rb', line 83 def create_zone(create_zone_details, opts = {}) logger.debug "Calling operation DnsClient#create_zone." if logger raise "Missing the required parameter 'create_zone_details' when calling create_zone." if create_zone_details.nil? path = "/zones" # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' post_body = @api_client.object_to_http_body(create_zone_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::Zone') end |
#delete_domain_records(zone_name_or_id, domain, opts = {}) ⇒ Response
Deletes all records at the specified zone and domain.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/oci/dns/dns_client.rb', line 129 def delete_domain_records(zone_name_or_id, domain, opts = {}) logger.debug "Calling operation DnsClient#delete_domain_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling delete_domain_records." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling delete_domain_records." if domain.nil? path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_rr_set(zone_name_or_id, domain, rtype, opts = {}) ⇒ Response
Deletes all records in the specified RRSet.
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/oci/dns/dns_client.rb', line 179 def delete_rr_set(zone_name_or_id, domain, rtype, opts = {}) logger.debug "Calling operation DnsClient#delete_rr_set." if logger raise "Missing the required parameter 'zone_name_or_id' when calling delete_rr_set." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling delete_rr_set." if domain.nil? raise "Missing the required parameter 'rtype' when calling delete_rr_set." if rtype.nil? path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_zone(zone_name_or_id, opts = {}) ⇒ Response
Deletes the specified zone. A ‘204` response indicates that zone has been successfully deleted.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/oci/dns/dns_client.rb', line 229 def delete_zone(zone_name_or_id, opts = {}) logger.debug "Calling operation DnsClient#delete_zone." if logger raise "Missing the required parameter 'zone_name_or_id' when calling delete_zone." if zone_name_or_id.nil? path = "/zones/{zoneNameOrId}".sub('{zoneNameOrId}', zone_name_or_id.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#get_domain_records(zone_name_or_id, domain, opts = {}) ⇒ Response
Gets a list of all records at the specified zone and domain. The results are sorted by ‘rtype` in alphabetical order by default. You can optionally filter and/or sort the results using the listed parameters.
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/oci/dns/dns_client.rb', line 290 def get_domain_records(zone_name_or_id, domain, opts = {}) logger.debug "Calling operation DnsClient#get_domain_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling get_domain_records." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling get_domain_records." if domain.nil? if opts[:'sort_by'] && !['rtype', 'ttl'].include?(opts[:'sort_by']) raise 'Invalid value for "sort_by", must be one of rtype, ttl.' end if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order']) raise 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.' end path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s) # Query Params query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version'] query_params[:'rtype'] = opts[:'rtype'] if opts[:'rtype'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#get_rr_set(zone_name_or_id, domain, rtype, opts = {}) ⇒ Response
Gets a list of all records in the specified RRSet. The results are sorted by ‘recordHash` by default.
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/oci/dns/dns_client.rb', line 360 def get_rr_set(zone_name_or_id, domain, rtype, opts = {}) logger.debug "Calling operation DnsClient#get_rr_set." if logger raise "Missing the required parameter 'zone_name_or_id' when calling get_rr_set." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling get_rr_set." if domain.nil? raise "Missing the required parameter 'rtype' when calling get_rr_set." if rtype.nil? path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s) # Query Params query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version'] query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RRSet') end |
#get_zone(zone_name_or_id, opts = {}) ⇒ Response
Gets information about the specified zone, including its creation date, zone type, and serial.
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/oci/dns/dns_client.rb', line 412 def get_zone(zone_name_or_id, opts = {}) logger.debug "Calling operation DnsClient#get_zone." if logger raise "Missing the required parameter 'zone_name_or_id' when calling get_zone." if zone_name_or_id.nil? path = "/zones/{zoneNameOrId}".sub('{zoneNameOrId}', zone_name_or_id.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::Zone') end |
#get_zone_records(zone_name_or_id, opts = {}) ⇒ Response
Gets all records in the specified zone. The results are sorted by ‘domain` in alphabetical order by default. For more information about records, please see [Resource Record (RR) TYPEs](www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 |
# File 'lib/oci/dns/dns_client.rb', line 479 def get_zone_records(zone_name_or_id, opts = {}) logger.debug "Calling operation DnsClient#get_zone_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling get_zone_records." if zone_name_or_id.nil? if opts[:'sort_by'] && !['domain', 'rtype', 'ttl'].include?(opts[:'sort_by']) raise 'Invalid value for "sort_by", must be one of domain, rtype, ttl.' end if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order']) raise 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.' end path = "/zones/{zoneNameOrId}/records".sub('{zoneNameOrId}', zone_name_or_id.to_s) # Query Params query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version'] query_params[:'domain'] = opts[:'domain'] if opts[:'domain'] query_params[:'domainContains'] = opts[:'domain_contains'] if opts[:'domain_contains'] query_params[:'rtype'] = opts[:'rtype'] if opts[:'rtype'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#list_zones(compartment_id, opts = {}) ⇒ Response
Gets a list of all zones in the specified compartment. The collection can be filtered by name, time created, and zone type.
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 |
# File 'lib/oci/dns/dns_client.rb', line 557 def list_zones(compartment_id, opts = {}) logger.debug "Calling operation DnsClient#list_zones." if logger raise "Missing the required parameter 'compartment_id' when calling list_zones." if compartment_id.nil? if opts[:'zone_type'] && !['PRIMARY', 'SECONDARY'].include?(opts[:'zone_type']) raise 'Invalid value for "zone_type", must be one of PRIMARY, SECONDARY.' end if opts[:'sort_by'] && !['name', 'zoneType', 'timeCreated'].include?(opts[:'sort_by']) raise 'Invalid value for "sort_by", must be one of name, zoneType, timeCreated.' end if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order']) raise 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.' end if opts[:'lifecycle_state'] && !['ACTIVE', 'CREATING', 'DELETED', 'DELETING', 'FAILED'].include?(opts[:'lifecycle_state']) raise 'Invalid value for "lifecycle_state", must be one of ACTIVE, CREATING, DELETED, DELETING, FAILED.' end path = "/zones" # Query Params query_params = {} query_params[:'compartmentId'] = compartment_id query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'name'] = opts[:'name'] if opts[:'name'] query_params[:'nameContains'] = opts[:'name_contains'] if opts[:'name_contains'] query_params[:'zoneType'] = opts[:'zone_type'] if opts[:'zone_type'] query_params[:'timeCreatedGreaterThanOrEqualTo'] = opts[:'time_created_greater_than_or_equal_to'] if opts[:'time_created_greater_than_or_equal_to'] query_params[:'timeCreatedLessThan'] = opts[:'time_created_less_than'] if opts[:'time_created_less_than'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'Array<OCI::Dns::Models::ZoneSummary>') end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
70 71 72 |
# File 'lib/oci/dns/dns_client.rb', line 70 def logger @api_client.config.logger end |
#patch_domain_records(zone_name_or_id, domain, patch_domain_records_details, opts = {}) ⇒ Response
Replaces records in the specified zone at a domain. You can update one record or all records for the specified zone depending on the changes provided in the request body. You can also add or remove records using this function.
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
# File 'lib/oci/dns/dns_client.rb', line 630 def patch_domain_records(zone_name_or_id, domain, patch_domain_records_details, opts = {}) logger.debug "Calling operation DnsClient#patch_domain_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling patch_domain_records." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling patch_domain_records." if domain.nil? raise "Missing the required parameter 'patch_domain_records_details' when calling patch_domain_records." if patch_domain_records_details.nil? path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(patch_domain_records_details) return @api_client.call_api( :PATCH, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#patch_rr_set(zone_name_or_id, domain, rtype, patch_rr_set_details, opts = {}) ⇒ Response
Updates records in the specified RRSet.
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
# File 'lib/oci/dns/dns_client.rb', line 682 def patch_rr_set(zone_name_or_id, domain, rtype, patch_rr_set_details, opts = {}) logger.debug "Calling operation DnsClient#patch_rr_set." if logger raise "Missing the required parameter 'zone_name_or_id' when calling patch_rr_set." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling patch_rr_set." if domain.nil? raise "Missing the required parameter 'rtype' when calling patch_rr_set." if rtype.nil? raise "Missing the required parameter 'patch_rr_set_details' when calling patch_rr_set." if patch_rr_set_details.nil? path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(patch_rr_set_details) return @api_client.call_api( :PATCH, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#patch_zone_records(zone_name_or_id, patch_zone_records_details, opts = {}) ⇒ Response
Updates a collection of records in the specified zone. You can update one record or all records for the specified zone depending on the changes provided in the request body. You can also add or remove records using this function.
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 |
# File 'lib/oci/dns/dns_client.rb', line 738 def patch_zone_records(zone_name_or_id, patch_zone_records_details, opts = {}) logger.debug "Calling operation DnsClient#patch_zone_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling patch_zone_records." if zone_name_or_id.nil? raise "Missing the required parameter 'patch_zone_records_details' when calling patch_zone_records." if patch_zone_records_details.nil? path = "/zones/{zoneNameOrId}/records".sub('{zoneNameOrId}', zone_name_or_id.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(patch_zone_records_details) return @api_client.call_api( :PATCH, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#update_domain_records(zone_name_or_id, domain, update_domain_records_details, opts = {}) ⇒ Response
Replaces records in the specified zone at a domain with the records specified in the request body. If a specified record does not exist, it will be created. If the record exists, then it will be updated to represent the record in the body of the request. If a record in the zone does not exist in the request body, the record will be removed from the zone.
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 |
# File 'lib/oci/dns/dns_client.rb', line 794 def update_domain_records(zone_name_or_id, domain, update_domain_records_details, opts = {}) logger.debug "Calling operation DnsClient#update_domain_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling update_domain_records." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling update_domain_records." if domain.nil? raise "Missing the required parameter 'update_domain_records_details' when calling update_domain_records." if update_domain_records_details.nil? path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(update_domain_records_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#update_rr_set(zone_name_or_id, domain, rtype, update_rr_set_details, opts = {}) ⇒ Response
Replaces records in the specified RRSet.
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 |
# File 'lib/oci/dns/dns_client.rb', line 846 def update_rr_set(zone_name_or_id, domain, rtype, update_rr_set_details, opts = {}) logger.debug "Calling operation DnsClient#update_rr_set." if logger raise "Missing the required parameter 'zone_name_or_id' when calling update_rr_set." if zone_name_or_id.nil? raise "Missing the required parameter 'domain' when calling update_rr_set." if domain.nil? raise "Missing the required parameter 'rtype' when calling update_rr_set." if rtype.nil? raise "Missing the required parameter 'update_rr_set_details' when calling update_rr_set." if update_rr_set_details.nil? path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(update_rr_set_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |
#update_zone(zone_name_or_id, update_zone_details, opts = {}) ⇒ Response
Updates the specified secondary zone with your new external master server information. For more information about secondary zone, see [Manage DNS Service Zone](docs.us-phoenix-1.oraclecloud.com/Content/DNS/Tasks/managingdnszones.htm).
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 |
# File 'lib/oci/dns/dns_client.rb', line 900 def update_zone(zone_name_or_id, update_zone_details, opts = {}) logger.debug "Calling operation DnsClient#update_zone." if logger raise "Missing the required parameter 'zone_name_or_id' when calling update_zone." if zone_name_or_id.nil? raise "Missing the required parameter 'update_zone_details' when calling update_zone." if update_zone_details.nil? path = "/zones/{zoneNameOrId}".sub('{zoneNameOrId}', zone_name_or_id.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(update_zone_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::Zone') end |
#update_zone_records(zone_name_or_id, update_zone_records_details, opts = {}) ⇒ Response
Replaces records in the specified zone with the records specified in the request body. If a specified record does not exist, it will be created. If the record exists, then it will be updated to represent the record in the body of the request. If a record in the zone does not exist in the request body, the record will be removed from the zone.
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 |
# File 'lib/oci/dns/dns_client.rb', line 954 def update_zone_records(zone_name_or_id, update_zone_records_details, opts = {}) logger.debug "Calling operation DnsClient#update_zone_records." if logger raise "Missing the required parameter 'zone_name_or_id' when calling update_zone_records." if zone_name_or_id.nil? raise "Missing the required parameter 'update_zone_records_details' when calling update_zone_records." if update_zone_records_details.nil? path = "/zones/{zoneNameOrId}/records".sub('{zoneNameOrId}', zone_name_or_id.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since'] post_body = @api_client.object_to_http_body(update_zone_records_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Dns::Models::RecordCollection') end |