Class: OCI::Dns::DnsClient

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

Overview

API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. For more information, see [Overview of the DNS Service](/iaas/Content/DNS/Concepts/dnszonemanagement.htm).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DnsClient

Creates a new DnsClient. Notes:

If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified.  If an endpoint is specified, it will be used instead of the
  region. A region may be specified in the config or via 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.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • 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



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
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/dns/dns_client.rb', line 53

def initialize(config: nil, region: nil, endpoint: 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

  if endpoint
    @endpoint = endpoint + '/20180115'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "DnsClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



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

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


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

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


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

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



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

def retry_config
  @retry_config
end

Instance Method Details

#change_steering_policy_compartment(steering_policy_id, change_steering_policy_compartment_details, opts = {}) ⇒ Response

Moves a steering policy into a different compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:

  • steering_policy_id (String)

    The OCID of the target steering policy.

  • change_steering_policy_compartment_details (OCI::Dns::Models::ChangeSteeringPolicyCompartmentDetails)

    Details for moving a steering policy into a different compartment.

  • 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.

    (default to nil)
    
  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

    (default to nil)
    

Returns:

  • (Response)

    A Response object with data of type nil



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
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/dns/dns_client.rb', line 132

def change_steering_policy_compartment(steering_policy_id, change_steering_policy_compartment_details, opts = {})
  logger.debug 'Calling operation DnsClient#change_steering_policy_compartment.' if logger

  raise "Missing the required parameter 'steering_policy_id' when calling change_steering_policy_compartment." if steering_policy_id.nil?
  raise "Missing the required parameter 'change_steering_policy_compartment_details' when calling change_steering_policy_compartment." if change_steering_policy_compartment_details.nil?
  raise "Parameter value for 'steering_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_id)

  path = '/steeringPolicies/{steeringPolicyId}/actions/changeCompartment'.sub('{steeringPolicyId}', steering_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_steering_policy_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#change_steering_policy_compartment') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_zone_compartment(zone_id, change_zone_compartment_details, opts = {}) ⇒ Response

Moves a zone into a different compartment. When provided, If-Match is checked against ETag values of the resource. Note: All SteeringPolicyAttachment objects associated with this zone will also be moved into the provided compartment.

Parameters:

  • zone_id (String)

    The OCID of the target zone.

  • change_zone_compartment_details (OCI::Dns::Models::ChangeZoneCompartmentDetails)

    Details for moving a zone into a different compartment.

  • 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.

    (default to nil)
    
  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

    (default to nil)
    

Returns:

  • (Response)

    A Response object with data of type nil



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/dns/dns_client.rb', line 201

def change_zone_compartment(zone_id, change_zone_compartment_details, opts = {})
  logger.debug 'Calling operation DnsClient#change_zone_compartment.' if logger

  raise "Missing the required parameter 'zone_id' when calling change_zone_compartment." if zone_id.nil?
  raise "Missing the required parameter 'change_zone_compartment_details' when calling change_zone_compartment." if change_zone_compartment_details.nil?
  raise "Parameter value for 'zone_id' must not be blank" if OCI::Internal::Util.blank_string?(zone_id)

  path = '/zones/{zoneId}/actions/changeCompartment'.sub('{zoneId}', zone_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_zone_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#change_zone_compartment') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_steering_policy(create_steering_policy_details, opts = {}) ⇒ Response

Creates a new steering policy in the specified compartment. For more information on creating policies with templates, see [Traffic Management API Guide](docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).

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

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

    (default to nil)
    

Returns:



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
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/dns/dns_client.rb', line 264

def create_steering_policy(create_steering_policy_details, opts = {})
  logger.debug 'Calling operation DnsClient#create_steering_policy.' if logger

  raise "Missing the required parameter 'create_steering_policy_details' when calling create_steering_policy." if create_steering_policy_details.nil?

  path = '/steeringPolicies'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_steering_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#create_steering_policy') 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::SteeringPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_steering_policy_attachment(create_steering_policy_attachment_details, opts = {}) ⇒ Response

Creates a new attachment between a steering policy and a domain, giving the policy permission to answer queries for the specified domain. A steering policy must be attached to a domain for the policy to answer DNS queries for that domain.

For the purposes of access control, the attachment is automatically placed into the same compartment as the domain’s zone.

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

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

    (default to nil)
    

Returns:



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
358
359
360
361
362
363
364
365
# File 'lib/oci/dns/dns_client.rb', line 329

def create_steering_policy_attachment(create_steering_policy_attachment_details, opts = {})
  logger.debug 'Calling operation DnsClient#create_steering_policy_attachment.' if logger

  raise "Missing the required parameter 'create_steering_policy_attachment_details' when calling create_steering_policy_attachment." if create_steering_policy_attachment_details.nil?

  path = '/steeringPolicyAttachments'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_steering_policy_attachment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#create_steering_policy_attachment') 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::SteeringPolicyAttachment'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#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. (default to nil)

Returns:



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/oci/dns/dns_client.rb', line 385

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:

  • (Response)

    A Response object with data of type nil



450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/oci/dns/dns_client.rb', line 450

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:

  • (Response)

    A Response object with data of type nil



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# File 'lib/oci/dns/dns_client.rb', line 521

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_steering_policy(steering_policy_id, opts = {}) ⇒ Response

Deletes the specified steering policy. A ‘204` response indicates that the delete has been successful. Deletion will fail if the policy is attached to any zones. To detach a policy from a zone, see `DeleteSteeringPolicyAttachment`.

Parameters:

  • steering_policy_id (String)

    The OCID of the target steering policy.

  • 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.

    (default to nil)
    
  • :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.

    (default to nil)
    

Returns:

  • (Response)

    A Response object with data of type nil



594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/oci/dns/dns_client.rb', line 594

def delete_steering_policy(steering_policy_id, opts = {})
  logger.debug 'Calling operation DnsClient#delete_steering_policy.' if logger

  raise "Missing the required parameter 'steering_policy_id' when calling delete_steering_policy." if steering_policy_id.nil?
  raise "Parameter value for 'steering_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_id)

  path = '/steeringPolicies/{steeringPolicyId}'.sub('{steeringPolicyId}', steering_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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_steering_policy') 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_steering_policy_attachment(steering_policy_attachment_id, opts = {}) ⇒ Response

Deletes the specified steering policy attachment. A ‘204` response indicates that the delete has been successful.

Parameters:

  • steering_policy_attachment_id (String)

    The OCID of the target steering policy attachment.

  • 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.

    (default to nil)
    
  • :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.

    (default to nil)
    

Returns:

  • (Response)

    A Response object with data of type nil



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

def delete_steering_policy_attachment(steering_policy_attachment_id, opts = {})
  logger.debug 'Calling operation DnsClient#delete_steering_policy_attachment.' if logger

  raise "Missing the required parameter 'steering_policy_attachment_id' when calling delete_steering_policy_attachment." if steering_policy_attachment_id.nil?
  raise "Parameter value for 'steering_policy_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_attachment_id)

  path = '/steeringPolicyAttachments/{steeringPolicyAttachmentId}'.sub('{steeringPolicyAttachmentId}', steering_policy_attachment_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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_steering_policy_attachment') 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 and all its steering policy attachments. 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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:

  • (Response)

    A Response object with data of type nil



727
728
729
730
731
732
733
734
735
736
737
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
# File 'lib/oci/dns/dns_client.rb', line 727

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :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. (default to nil)

  • :zone_version (String)

    The version of the zone for which data is requested. (default to nil)

  • :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.

    (default to nil)
    
  • :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. (default to DESC)

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File 'lib/oci/dns/dns_client.rb', line 808

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :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. (default to nil)

  • :zone_version (String)

    The version of the zone for which data is requested. (default to nil)

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



899
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
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/oci/dns/dns_client.rb', line 899

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_steering_policy(steering_policy_id, opts = {}) ⇒ Response

Gets information about the specified steering policy.

Parameters:

  • steering_policy_id (String)

    The OCID of the target steering policy.

  • 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.

    (default to nil)
    
  • :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.

    (default to nil)
    

Returns:



971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
# File 'lib/oci/dns/dns_client.rb', line 971

def get_steering_policy(steering_policy_id, opts = {})
  logger.debug 'Calling operation DnsClient#get_steering_policy.' if logger

  raise "Missing the required parameter 'steering_policy_id' when calling get_steering_policy." if steering_policy_id.nil?
  raise "Parameter value for 'steering_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_id)

  path = '/steeringPolicies/{steeringPolicyId}'.sub('{steeringPolicyId}', steering_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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_steering_policy') 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::SteeringPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_steering_policy_attachment(steering_policy_attachment_id, opts = {}) ⇒ Response

Gets information about the specified steering policy attachment.

Parameters:

  • steering_policy_attachment_id (String)

    The OCID of the target steering policy attachment.

  • 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.

    (default to nil)
    
  • :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.

    (default to nil)
    

Returns:



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
# File 'lib/oci/dns/dns_client.rb', line 1035

def get_steering_policy_attachment(steering_policy_attachment_id, opts = {})
  logger.debug 'Calling operation DnsClient#get_steering_policy_attachment.' if logger

  raise "Missing the required parameter 'steering_policy_attachment_id' when calling get_steering_policy_attachment." if steering_policy_attachment_id.nil?
  raise "Parameter value for 'steering_policy_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_attachment_id)

  path = '/steeringPolicyAttachments/{steeringPolicyAttachmentId}'.sub('{steeringPolicyAttachmentId}', steering_policy_attachment_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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_steering_policy_attachment') 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::SteeringPolicyAttachment'
    )
  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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
# File 'lib/oci/dns/dns_client.rb', line 1101

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, 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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :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. (default to nil)

  • :zone_version (String)

    The version of the zone for which data is requested. (default to nil)

  • :domain (String)

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

    (default to nil)
    
  • :domain_contains (String)

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

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :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. (default to DESC)

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
# File 'lib/oci/dns/dns_client.rb', line 1188

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_steering_policies(compartment_id, opts = {}) ⇒ Response

Gets a list of all steering policies in the specified compartment.

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. (default to nil)

  • :id (String)

    The OCID of a resource. (default to nil)

  • :display_name (String)

    The displayName of a resource. (default to nil)

  • :display_name_contains (String)

    The partial displayName of a resource. Will match any resource whose name (case-insensitive) contains the provided value.

    (default to nil)
    
  • :health_check_monitor_id (String)

    Search by health check monitor OCID. Will match any resource whose health check monitor ID matches the provided value.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :template (String)

    Search by steering template type. Will match any resource whose template type matches the provided value.

    (default to nil)
    
  • :lifecycle_state (String)

    The state of a resource. (default to ACTIVE)

  • :sort_by (String)

    The field by which to sort steering policies. If unspecified, defaults to ‘timeCreated`. (default to timeCreated) Allowed values are: displayName, timeCreated, template

  • :sort_order (String)

    The order to sort the resources. (default to DESC)

Returns:



1285
1286
1287
1288
1289
1290
1291
1292
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
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
# File 'lib/oci/dns/dns_client.rb', line 1285

def list_steering_policies(compartment_id, opts = {})
  logger.debug 'Calling operation DnsClient#list_steering_policies.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_steering_policies." if compartment_id.nil?

  if opts[:lifecycle_state] && !OCI::Dns::Models::SteeringPolicySummary::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Dns::Models::SteeringPolicySummary::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_by] && !%w[displayName timeCreated template].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of displayName, timeCreated, template.'
  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 = '/steeringPolicies'
  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[:id] = opts[:id] if opts[:id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:displayNameContains] = opts[:display_name_contains] if opts[:display_name_contains]
  query_params[:healthCheckMonitorId] = opts[:health_check_monitor_id] if opts[:health_check_monitor_id]
  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[:template] = opts[:template] if opts[:template]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # 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_steering_policies') 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::SteeringPolicySummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_steering_policy_attachments(compartment_id, opts = {}) ⇒ Response

Lists the steering policy attachments in the specified compartment.

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. (default to nil)

  • :id (String)

    The OCID of a resource. (default to nil)

  • :display_name (String)

    The displayName of a resource. (default to nil)

  • :steering_policy_id (String)

    Search by steering policy OCID. Will match any resource whose steering policy ID matches the provided value.

    (default to nil)
    
  • :zone_id (String)

    Search by zone OCID. Will match any resource whose zone ID matches the provided value.

    (default to nil)
    
  • :domain (String)

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

    (default to nil)
    
  • :domain_contains (String)

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

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :lifecycle_state (String)

    The state of a resource. (default to ACTIVE)

  • :sort_by (String)

    The field by which to sort steering policy attachments. If unspecified, defaults to ‘timeCreated`. (default to timeCreated) Allowed values are: displayName, timeCreated, domainName

  • :sort_order (String)

    The order to sort the resources. (default to DESC)

Returns:



1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
# File 'lib/oci/dns/dns_client.rb', line 1390

def list_steering_policy_attachments(compartment_id, opts = {})
  logger.debug 'Calling operation DnsClient#list_steering_policy_attachments.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_steering_policy_attachments." if compartment_id.nil?

  if opts[:lifecycle_state] && !OCI::Dns::Models::SteeringPolicyAttachmentSummary::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Dns::Models::SteeringPolicyAttachmentSummary::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_by] && !%w[displayName timeCreated domainName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of displayName, timeCreated, domainName.'
  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 = '/steeringPolicyAttachments'
  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[:id] = opts[:id] if opts[:id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:steeringPolicyId] = opts[:steering_policy_id] if opts[:steering_policy_id]
  query_params[:zoneId] = opts[:zone_id] if opts[:zone_id]
  query_params[:domain] = opts[:domain] if opts[:domain]
  query_params[:domainContains] = opts[:domain_contains] if opts[:domain_contains]
  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[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # 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_steering_policy_attachments') 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::SteeringPolicyAttachmentSummary>'
    )
  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. (default to nil)

  • :name (String)

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

    (default to nil)
    
  • :name_contains (String)

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

    (default to nil)
    
  • :zone_type (String)

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

    (default to nil)
    

    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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :lifecycle_state (String)

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

  • :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. (default to DESC)

Returns:



1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
# File 'lib/oci/dns/dns_client.rb', line 1494

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[: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

  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

  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[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # 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.



103
104
105
# File 'lib/oci/dns/dns_client.rb', line 103

def logger
  @api_client.config.logger
end

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

Updates 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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'lib/oci/dns/dns_client.rb', line 1590

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
# File 'lib/oci/dns/dns_client.rb', line 1663

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
# File 'lib/oci/dns/dns_client.rb', line 1741

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
# File 'lib/oci/dns/dns_client.rb', line 1817

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
# File 'lib/oci/dns/dns_client.rb', line 1890

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_steering_policy(steering_policy_id, update_steering_policy_details, opts = {}) ⇒ Response

Updates the configuration of the specified steering policy.

Parameters:

  • steering_policy_id (String)

    The OCID of the target steering policy.

  • update_steering_policy_details (OCI::Dns::Models::UpdateSteeringPolicyDetails)

    New data for the steering policy.

  • 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.

    (default to nil)
    
  • :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.

    (default to nil)
    

Returns:



1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
# File 'lib/oci/dns/dns_client.rb', line 1963

def update_steering_policy(steering_policy_id, update_steering_policy_details, opts = {})
  logger.debug 'Calling operation DnsClient#update_steering_policy.' if logger

  raise "Missing the required parameter 'steering_policy_id' when calling update_steering_policy." if steering_policy_id.nil?
  raise "Missing the required parameter 'update_steering_policy_details' when calling update_steering_policy." if update_steering_policy_details.nil?
  raise "Parameter value for 'steering_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_id)

  path = '/steeringPolicies/{steeringPolicyId}'.sub('{steeringPolicyId}', steering_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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_steering_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#update_steering_policy') 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::SteeringPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_steering_policy_attachment(steering_policy_attachment_id, update_steering_policy_attachment_details, opts = {}) ⇒ Response

Updates the specified steering policy attachment with your new information.

Parameters:

  • steering_policy_attachment_id (String)

    The OCID of the target steering policy attachment.

  • update_steering_policy_attachment_details (OCI::Dns::Models::UpdateSteeringPolicyAttachmentDetails)

    New data for the steering policy attachment.

  • 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.

    (default to nil)
    
  • :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.

    (default to nil)
    

Returns:



2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
# File 'lib/oci/dns/dns_client.rb', line 2031

def update_steering_policy_attachment(steering_policy_attachment_id, update_steering_policy_attachment_details, opts = {})
  logger.debug 'Calling operation DnsClient#update_steering_policy_attachment.' if logger

  raise "Missing the required parameter 'steering_policy_attachment_id' when calling update_steering_policy_attachment." if steering_policy_attachment_id.nil?
  raise "Missing the required parameter 'update_steering_policy_attachment_details' when calling update_steering_policy_attachment." if update_steering_policy_attachment_details.nil?
  raise "Parameter value for 'steering_policy_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?(steering_policy_attachment_id)

  path = '/steeringPolicyAttachments/{steeringPolicyAttachmentId}'.sub('{steeringPolicyAttachmentId}', steering_policy_attachment_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # 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_steering_policy_attachment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DnsClient#update_steering_policy_attachment') 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::SteeringPolicyAttachment'
    )
  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.cloud.oracle.com/iaas/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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
# File 'lib/oci/dns/dns_client.rb', line 2102

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.

    (default to nil)
    
  • :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.

    (default to nil)
    
  • :compartment_id (String)

    The OCID of the compartment the resource belongs to. (default to nil)

Returns:



2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
# File 'lib/oci/dns/dns_client.rb', line 2176

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