Class: OCI::Dns::DnsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/dns/dns_client.rb

Overview

API for managing DNS zones, records, and policies.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: 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.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is ‘nil`, which means that an operation will not perform any retries



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/dns/dns_client.rb', line 48

def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: 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 = OCI::Signer.new(
      config.user,
      config.fingerprint,
      config.tenancy,
      config.key_file,
      pass_phrase: config.pass_phrase,
      private_key_content: config.key_content
    )
  end

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  region ||= config.region
  region ||= signer.region if signer.respond_to?(:region)
  self.region = region
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



12
13
14
# File 'lib/oci/dns/dns_client.rb', line 12

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


16
17
18
# File 'lib/oci/dns/dns_client.rb', line 16

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


26
27
28
# File 'lib/oci/dns/dns_client.rb', line 26

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is ‘nil`, which means that an operation will not perform any retries



22
23
24
# File 'lib/oci/dns/dns_client.rb', line 22

def retry_config
  @retry_config
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`.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/dns/dns_client.rb', line 112

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'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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'
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(create_zone_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#create_zone') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::Zone'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_domain_records(zone_name_or_id, domain, opts = {}) ⇒ Response

Deletes all records at the specified zone and domain.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type nil



177
178
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
209
210
211
212
213
214
215
216
# File 'lib/oci/dns/dns_client.rb', line 177

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)

  path = '/zones/{zoneNameOrId}/records/{domain}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#delete_domain_records') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_rr_set(zone_name_or_id, domain, rtype, opts = {}) ⇒ Response

Deletes all records in the specified RRSet.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • rtype (String)

    The type of the target RRSet within the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type nil



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/oci/dns/dns_client.rb', line 248

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)
  raise "Parameter value for 'rtype' must not be blank" if OCI::Internal::Util.blank_string?(rtype)

  path = '/zones/{zoneNameOrId}/records/{domain}/{rtype}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#delete_rr_set') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_zone(zone_name_or_id, opts = {}) ⇒ Response

Deletes the specified zone. A ‘204` response indicates that zone has been successfully deleted.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type nil



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/oci/dns/dns_client.rb', line 320

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)

  path = '/zones/{zoneNameOrId}'.sub('{zoneNameOrId}', zone_name_or_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#delete_zone') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
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.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_none_match (String)

    The ‘If-None-Match` header field makes the request method conditional on the absence of any current representation of the target resource, when the field-value is `*`, or having a selected representation with an entity-tag that does not match any of those listed in the field-value.

  • :if_modified_since (String)

    The ‘If-Modified-Since` header field makes a GET or HEAD request method conditional on the selected representation’s modification date being more recent than the date provided in the field-value. Transfer of the selected representation’s data is avoided if that data has not changed.

  • :limit (Integer)

    The maximum number of items to return in a page of the collection. (default to 50)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :zone_version (String)

    The version of the zone for which data is requested.

  • :rtype (String)

    Search by record type. Will match any record whose [type](www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4) (case-insensitive) equals the provided value.

  • :sort_by (String)

    The field by which to sort records. (default to rtype) Allowed values are: rtype, ttl

  • :sort_order (String)

    The order to sort the resources.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



401
402
403
404
405
406
407
408
409
410
411
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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/oci/dns/dns_client.rb', line 401

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] && !%w[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
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)

  path = '/zones/{zoneNameOrId}/records/{domain}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#get_domain_records') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
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.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • rtype (String)

    The type of the target RRSet within the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_none_match (String)

    The ‘If-None-Match` header field makes the request method conditional on the absence of any current representation of the target resource, when the field-value is `*`, or having a selected representation with an entity-tag that does not match any of those listed in the field-value.

  • :if_modified_since (String)

    The ‘If-Modified-Since` header field makes a GET or HEAD request method conditional on the selected representation’s modification date being more recent than the date provided in the field-value. Transfer of the selected representation’s data is avoided if that data has not changed.

  • :limit (Integer)

    The maximum number of items to return in a page of the collection. (default to 50)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :zone_version (String)

    The version of the zone for which data is requested.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/oci/dns/dns_client.rb', line 492

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)
  raise "Parameter value for 'rtype' must not be blank" if OCI::Internal::Util.blank_string?(rtype)

  path = '/zones/{zoneNameOrId}/records/{domain}/{rtype}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#get_rr_set') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RRSet'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_zone(zone_name_or_id, opts = {}) ⇒ Response

Gets information about the specified zone, including its creation date, zone type, and serial.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_none_match (String)

    The ‘If-None-Match` header field makes the request method conditional on the absence of any current representation of the target resource, when the field-value is `*`, or having a selected representation with an entity-tag that does not match any of those listed in the field-value.

  • :if_modified_since (String)

    The ‘If-Modified-Since` header field makes a GET or HEAD request method conditional on the selected representation’s modification date being more recent than the date provided in the field-value. Transfer of the selected representation’s data is avoided if that data has not changed.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



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
# File 'lib/oci/dns/dns_client.rb', line 566

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)

  path = '/zones/{zoneNameOrId}'.sub('{zoneNameOrId}', zone_name_or_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#get_zone') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::Zone'
    )
  end
  # rubocop:enable Metrics/BlockLength
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).

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_none_match (String)

    The ‘If-None-Match` header field makes the request method conditional on the absence of any current representation of the target resource, when the field-value is `*`, or having a selected representation with an entity-tag that does not match any of those listed in the field-value.

  • :if_modified_since (String)

    The ‘If-Modified-Since` header field makes a GET or HEAD request method conditional on the selected representation’s modification date being more recent than the date provided in the field-value. Transfer of the selected representation’s data is avoided if that data has not changed.

  • :limit (Integer)

    The maximum number of items to return in a page of the collection. (default to 50)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :zone_version (String)

    The version of the zone for which data is requested.

  • :domain (String)

    Search by domain. Will match any record whose domain (case-insensitive) equals the provided value.

  • :domain_contains (String)

    Search by domain. Will match any record whose domain (case-insensitive) contains the provided value.

  • :rtype (String)

    Search by record type. Will match any record whose [type](www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4) (case-insensitive) equals the provided value.

  • :sort_by (String)

    The field by which to sort records. (default to domain) Allowed values are: domain, rtype, ttl

  • :sort_order (String)

    The order to sort the resources.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
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
# File 'lib/oci/dns/dns_client.rb', line 653

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] && !%w[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
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)

  path = '/zones/{zoneNameOrId}/records'.sub('{zoneNameOrId}', zone_name_or_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#get_zone_records') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
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.

Parameters:

  • compartment_id (String)

    The OCID of the compartment the resource belongs to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :limit (Integer)

    The maximum number of items to return in a page of the collection. (default to 50)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous "List" call.

  • :name (String)

    A case-sensitive filter for zone names. Will match any zone with a name that equals the provided value.

  • :name_contains (String)

    Search by zone name. Will match any zone whose name (case-insensitive) contains the provided value.

  • :zone_type (String)

    Search by zone type, ‘PRIMARY` or `SECONDARY`. Will match any zone whose type equals the provided value.

    Allowed values are: PRIMARY, SECONDARY

  • :time_created_greater_than_or_equal_to (DateTime)

    An [RFC 3339](www.ietf.org/rfc/rfc3339.txt) timestamp that states all returned resources were created on or after the indicated time.

  • :time_created_less_than (DateTime)

    An [RFC 3339](www.ietf.org/rfc/rfc3339.txt) timestamp that states all returned resources were created before the indicated time.

  • :sort_by (String)

    The field by which to sort zones. (default to timeCreated) Allowed values are: name, zoneType, timeCreated

  • :sort_order (String)

    The order to sort the resources.

  • :lifecycle_state (String)

    The state of a resource. Allowed values are: ACTIVE, CREATING, DELETED, DELETING, FAILED

Returns:



751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
# File 'lib/oci/dns/dns_client.rb', line 751

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] && !%w[PRIMARY SECONDARY].include?(opts[:zone_type])
    raise 'Invalid value for "zone_type", must be one of PRIMARY, SECONDARY.'
  end

  if opts[:sort_by] && !%w[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] && !%w[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'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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'
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#list_zones') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Dns::Models::ZoneSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



93
94
95
# File 'lib/oci/dns/dns_client.rb', line 93

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.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • patch_domain_records_details (OCI::Dns::Models::PatchDomainRecordsDetails)

    Operations describing how to modify the collection of records.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



843
844
845
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
878
879
880
881
882
883
884
# File 'lib/oci/dns/dns_client.rb', line 843

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)

  path = '/zones/{zoneNameOrId}/records/{domain}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(patch_domain_records_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#patch_domain_records') do
    @api_client.call_api(
      :PATCH,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#patch_rr_set(zone_name_or_id, domain, rtype, patch_rr_set_details, opts = {}) ⇒ Response

Updates records in the specified RRSet.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • rtype (String)

    The type of the target RRSet within the target zone.

  • patch_rr_set_details (OCI::Dns::Models::PatchRRSetDetails)

    Operations describing how to modify the collection of records.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
# File 'lib/oci/dns/dns_client.rb', line 916

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)
  raise "Parameter value for 'rtype' must not be blank" if OCI::Internal::Util.blank_string?(rtype)

  path = '/zones/{zoneNameOrId}/records/{domain}/{rtype}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(patch_rr_set_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#patch_rr_set') do
    @api_client.call_api(
      :PATCH,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
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.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • patch_zone_records_details (OCI::Dns::Models::PatchZoneRecordsDetails)

    The operations describing how to modify the collection of records.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
# File 'lib/oci/dns/dns_client.rb', line 994

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)

  path = '/zones/{zoneNameOrId}/records'.sub('{zoneNameOrId}', zone_name_or_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(patch_zone_records_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#patch_zone_records') do
    @api_client.call_api(
      :PATCH,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
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.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • update_domain_records_details (OCI::Dns::Models::UpdateDomainRecordsDetails)

    A full list of records for the domain.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
# File 'lib/oci/dns/dns_client.rb', line 1070

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)

  path = '/zones/{zoneNameOrId}/records/{domain}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_domain_records_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#update_domain_records') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_rr_set(zone_name_or_id, domain, rtype, update_rr_set_details, opts = {}) ⇒ Response

Replaces records in the specified RRSet.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

    The target fully-qualified domain name (FQDN) within the target zone.

  • rtype (String)

    The type of the target RRSet within the target zone.

  • update_rr_set_details (OCI::Dns::Models::UpdateRRSetDetails)

    A full list of records for the RRSet.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/oci/dns/dns_client.rb', line 1143

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)
  raise "Parameter value for 'domain' must not be blank" if OCI::Internal::Util.blank_string?(domain)
  raise "Parameter value for 'rtype' must not be blank" if OCI::Internal::Util.blank_string?(rtype)

  path = '/zones/{zoneNameOrId}/records/{domain}/{rtype}'.sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_rr_set_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#update_rr_set') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
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).

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • update_zone_details (OCI::Dns::Models::UpdateZoneDetails)

    New data for the zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
# File 'lib/oci/dns/dns_client.rb', line 1219

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)

  path = '/zones/{zoneNameOrId}'.sub('{zoneNameOrId}', zone_name_or_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_zone_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#update_zone') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::Zone'
    )
  end
  # rubocop:enable Metrics/BlockLength
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.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • update_zone_records_details (OCI::Dns::Models::UpdateZoneRecordsDetails)

    A full list of records for the zone.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    The ‘If-Match` header field makes the request method conditional on the existence of at least one current representation of the target resource, when the field-value is `*`, or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

  • :if_unmodified_since (String)

    The ‘If-Unmodified-Since` header field makes the request method conditional on the selected representation’s last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:



1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
# File 'lib/oci/dns/dns_client.rb', line 1293

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?
  raise "Parameter value for 'zone_name_or_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_name_or_id)

  path = '/zones/{zoneNameOrId}/records'.sub('{zoneNameOrId}', zone_name_or_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_zone_records_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#update_zone_records') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Dns::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end