Class: OCI::Dns::DnsClient

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

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

A region must be specified in either the config or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

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

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

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

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

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



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/dns/dns_client.rb', line 36

def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)

  if signer.nil?
    signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content, signing_strategy: Signer::STANDARD)
  end

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

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

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



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

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


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

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


20
21
22
# File 'lib/oci/dns/dns_client.rb', line 20

def region
  @region
end

Instance Method Details

#create_zone(create_zone_details, opts = {}) ⇒ Response

Creates a new zone in the specified compartment. The ‘compartmentId` query parameter is required if the `Content-Type` header for the request is `text/dns`.

Parameters:

  • create_zone_details (CreateZoneDetails)

    Details for creating a new zone.

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

    the optional parameters

Options Hash (opts):

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::Zone



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/oci/dns/dns_client.rb', line 85

def create_zone(create_zone_details, opts = {})
  logger.debug "Calling operation DnsClient#create_zone." if logger

  raise "Missing the required parameter 'create_zone_details' when calling create_zone." if create_zone_details.nil?

  path = "/zones"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = @api_client.object_to_http_body(create_zone_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::Zone')
end

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

Deletes all records at the specified zone and domain.

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

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type nil



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/dns/dns_client.rb', line 131

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

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

Deletes all records in the specified RRSet.

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

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type nil



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/dns/dns_client.rb', line 183

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

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

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

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type nil



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/oci/dns/dns_client.rb', line 236

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

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

Gets a list of all records at the specified zone and domain. The results are sorted by ‘rtype` in alphabetical order by default. You can optionally filter and/or sort the results using the listed parameters.

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

  • :if_none_match (String)

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

  • :if_modified_since (String)

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

  • :limit (Integer)

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

  • :page (String)

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

  • :zone_version (String)

    The version of the zone for which data is requested.

  • :rtype (String)

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

  • :sort_by (String)

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

  • :sort_order (String)

    The order to sort the resources.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/oci/dns/dns_client.rb', line 298

def get_domain_records(zone_name_or_id, domain, opts = {})
  logger.debug "Calling operation DnsClient#get_domain_records." if logger

  raise "Missing the required parameter 'zone_name_or_id' when calling get_domain_records." if zone_name_or_id.nil?
  raise "Missing the required parameter 'domain' when calling get_domain_records." if domain.nil?

  if opts[:'sort_by'] && !['rtype', 'ttl'].include?(opts[:'sort_by'])
    raise 'Invalid value for "sort_by", must be one of rtype, ttl.'
  end

  if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order'])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.'
  end
  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)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version']
  query_params[:'rtype'] = opts[:'rtype'] if opts[:'rtype']
  query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
  header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

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

Gets a list of all records in the specified RRSet. The results are sorted by ‘recordHash` by default.

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

  • :if_none_match (String)

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

  • :if_modified_since (String)

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

  • :limit (Integer)

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

  • :page (String)

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

  • :zone_version (String)

    The version of the zone for which data is requested.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RRSet



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/dns/dns_client.rb', line 370

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)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version']
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
  header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RRSet')
end

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

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

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

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

    the optional parameters

Options Hash (opts):

  • :if_none_match (String)

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

  • :if_modified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::Zone



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/oci/dns/dns_client.rb', line 425

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
  header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::Zone')
end

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

Gets all records in the specified zone. The results are sorted by ‘domain` in alphabetical order by default. For more information about records, please see [Resource Record (RR) TYPEs](www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

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

    the optional parameters

Options Hash (opts):

  • :if_none_match (String)

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

  • :if_modified_since (String)

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

  • :limit (Integer)

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

  • :page (String)

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

  • :zone_version (String)

    The version of the zone for which data is requested.

  • :domain (String)

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

  • :domain_contains (String)

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

  • :rtype (String)

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

  • :sort_by (String)

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

  • :sort_order (String)

    The order to sort the resources.

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/oci/dns/dns_client.rb', line 493

def get_zone_records(zone_name_or_id, opts = {})
  logger.debug "Calling operation DnsClient#get_zone_records." if logger

  raise "Missing the required parameter 'zone_name_or_id' when calling get_zone_records." if zone_name_or_id.nil?

  if opts[:'sort_by'] && !['domain', 'rtype', 'ttl'].include?(opts[:'sort_by'])
    raise 'Invalid value for "sort_by", must be one of domain, rtype, ttl.'
  end

  if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order'])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.'
  end
  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)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version']
  query_params[:'domain'] = opts[:'domain'] if opts[:'domain']
  query_params[:'domainContains'] = opts[:'domain_contains'] if opts[:'domain_contains']
  query_params[:'rtype'] = opts[:'rtype'] if opts[:'rtype']
  query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
  header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

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

Gets a list of all zones in the specified compartment. The collection can be filtered by name, time created, and zone type.

Parameters:

  • compartment_id (String)

    The OCID of the compartment the resource belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

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

  • :page (String)

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

  • :name (String)

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

  • :name_contains (String)

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

  • :zone_type (String)

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

    Allowed values are: PRIMARY, SECONDARY

  • :time_created_greater_than_or_equal_to (DateTime)

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

  • :time_created_less_than (DateTime)

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

  • :sort_by (String)

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

  • :sort_order (String)

    The order to sort the resources.

  • :lifecycle_state (String)

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

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Dns::Models::ZoneSummary>



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/oci/dns/dns_client.rb', line 572

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

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

  if opts[:'zone_type'] && !['PRIMARY', 'SECONDARY'].include?(opts[:'zone_type'])
    raise 'Invalid value for "zone_type", must be one of PRIMARY, SECONDARY.'
  end

  if opts[:'sort_by'] && !['name', 'zoneType', 'timeCreated'].include?(opts[:'sort_by'])
    raise 'Invalid value for "sort_by", must be one of name, zoneType, timeCreated.'
  end

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

  if opts[:'lifecycle_state'] && !['ACTIVE', 'CREATING', 'DELETED', 'DELETING', 'FAILED'].include?(opts[:'lifecycle_state'])
    raise 'Invalid value for "lifecycle_state", must be one of ACTIVE, CREATING, DELETED, DELETING, FAILED.'
  end

  path = "/zones"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'name'] = opts[:'name'] if opts[:'name']
  query_params[:'nameContains'] = opts[:'name_contains'] if opts[:'name_contains']
  query_params[:'zoneType'] = opts[:'zone_type'] if opts[:'zone_type']
  query_params[:'timeCreatedGreaterThanOrEqualTo'] = opts[:'time_created_greater_than_or_equal_to'] if opts[:'time_created_greater_than_or_equal_to']
  query_params[:'timeCreatedLessThan'] = opts[:'time_created_less_than'] if opts[:'time_created_less_than']
  query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
  query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Dns::Models::ZoneSummary>')
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



72
73
74
# File 'lib/oci/dns/dns_client.rb', line 72

def logger
  @api_client.config.logger
end

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

Replaces records in the specified zone at a domain. You can update one record or all records for the specified zone depending on the changes provided in the request body. You can also add or remove records using this function.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • domain (String)

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

  • patch_domain_records_details (PatchDomainRecordsDetails)

    Operations describing how to modify the collection of records.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
# File 'lib/oci/dns/dns_client.rb', line 645

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(patch_domain_records_details)

  return @api_client.call_api(
    :PATCH,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

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

Updates records in the specified RRSet.

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 (PatchRRSetDetails)

    Operations describing how to modify the collection of records.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
# File 'lib/oci/dns/dns_client.rb', line 699

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(patch_rr_set_details)

  return @api_client.call_api(
    :PATCH,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

#patch_zone_records(zone_name_or_id, patch_zone_records_details, opts = {}) ⇒ Response

Updates a collection of records in the specified zone. You can update one record or all records for the specified zone depending on the changes provided in the request body. You can also add or remove records using this function.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • patch_zone_records_details (PatchZoneRecordsDetails)

    The operations describing how to modify the collection of records.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File 'lib/oci/dns/dns_client.rb', line 758

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(patch_zone_records_details)

  return @api_client.call_api(
    :PATCH,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

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

Replaces records in the specified zone at a domain with the records specified in the request body. If a specified record does not exist, it will be created. If the record exists, then it will be updated to represent the record in the body of the request. If a record in the zone does not exist in the request body, the record will be removed from the zone.

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 (UpdateDomainRecordsDetails)

    A full list of records for the domain.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



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

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(update_domain_records_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

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

Replaces records in the specified RRSet.

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 (UpdateRRSetDetails)

    A full list of records for the RRSet.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/oci/dns/dns_client.rb', line 869

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(update_rr_set_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end

#update_zone(zone_name_or_id, update_zone_details, opts = {}) ⇒ Response

Updates the specified secondary zone with your new external master server information. For more information about secondary zone, see [Manage DNS Service Zone](docs.us-phoenix-1.oraclecloud.com/Content/DNS/Tasks/managingdnszones.htm).

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • update_zone_details (UpdateZoneDetails)

    New data for the zone.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::Zone



926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/oci/dns/dns_client.rb', line 926

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(update_zone_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::Zone')
end

#update_zone_records(zone_name_or_id, update_zone_records_details, opts = {}) ⇒ Response

Replaces records in the specified zone with the records specified in the request body. If a specified record does not exist, it will be created. If the record exists, then it will be updated to represent the record in the body of the request. If a record in the zone does not exist in the request body, the record will be removed from the zone.

Parameters:

  • zone_name_or_id (String)

    The name or OCID of the target zone.

  • update_zone_records_details (UpdateZoneRecordsDetails)

    A full list of records for the zone.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

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

  • :if_unmodified_since (String)

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

  • :compartment_id (String)

    The OCID of the compartment the resource belongs to.

Returns:

  • (Response)

    A Response object with data of type OCI::Dns::Models::RecordCollection



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

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)

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
  header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']

  post_body = @api_client.object_to_http_body(update_zone_records_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Dns::Models::RecordCollection')
end