oci 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -1
  3. data/lib/oci.rb +4 -7
  4. data/lib/oci/api_client.rb +51 -6
  5. data/lib/oci/auth/auth.rb +5 -2
  6. data/lib/oci/auth/federation_client.rb +2 -2
  7. data/lib/oci/auth/internal/auth_token_request_signer.rb +2 -2
  8. data/lib/oci/auth/security_token_container.rb +2 -2
  9. data/lib/oci/auth/session_key_supplier.rb +3 -4
  10. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +30 -17
  11. data/lib/oci/auth/signers/security_token_signer.rb +13 -6
  12. data/lib/oci/auth/signers/x509_federation_client_based_security_token_signer.rb +8 -4
  13. data/lib/oci/auth/url_based_certificate_retriever.rb +3 -4
  14. data/lib/oci/auth/util.rb +6 -4
  15. data/lib/oci/base_signer.rb +54 -50
  16. data/lib/oci/config_file_loader.rb +3 -11
  17. data/lib/oci/core/blockstorage_client.rb +211 -0
  18. data/lib/oci/core/compute_client.rb +4 -2
  19. data/lib/oci/core/core.rb +9 -0
  20. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +5 -1
  21. data/lib/oci/core/models/attach_volume_details.rb +13 -1
  22. data/lib/oci/core/models/create_public_ip_details.rb +186 -0
  23. data/lib/oci/core/models/create_vnic_details.rb +8 -2
  24. data/lib/oci/core/models/create_volume_backup_details.rb +27 -1
  25. data/lib/oci/core/models/create_volume_backup_policy_assignment_details.rb +133 -0
  26. data/lib/oci/core/models/create_volume_details.rb +15 -1
  27. data/lib/oci/core/models/get_public_ip_by_ip_address_details.rb +125 -0
  28. data/lib/oci/core/models/get_public_ip_by_private_ip_id_details.rb +124 -0
  29. data/lib/oci/core/models/i_scsi_volume_attachment.rb +5 -1
  30. data/lib/oci/core/models/public_ip.rb +328 -0
  31. data/lib/oci/core/models/update_public_ip_details.rb +140 -0
  32. data/lib/oci/core/models/volume_attachment.rb +13 -1
  33. data/lib/oci/core/models/volume_backup.rb +72 -1
  34. data/lib/oci/core/models/volume_backup_policy.rb +161 -0
  35. data/lib/oci/core/models/volume_backup_policy_assignment.rb +159 -0
  36. data/lib/oci/core/models/volume_backup_schedule.rb +191 -0
  37. data/lib/oci/core/virtual_network_client.rb +374 -4
  38. data/lib/oci/database/database_client.rb +3 -1
  39. data/lib/oci/dns/dns.rb +34 -0
  40. data/lib/oci/dns/dns_client.rb +985 -0
  41. data/lib/oci/dns/models/create_zone_details.rb +174 -0
  42. data/lib/oci/dns/models/external_master.rb +145 -0
  43. data/lib/oci/dns/models/patch_domain_records_details.rb +120 -0
  44. data/lib/oci/dns/models/patch_rr_set_details.rb +120 -0
  45. data/lib/oci/dns/models/patch_zone_records_details.rb +120 -0
  46. data/lib/oci/dns/models/record.rb +204 -0
  47. data/lib/oci/dns/models/record_collection.rb +121 -0
  48. data/lib/oci/dns/models/record_details.rb +204 -0
  49. data/lib/oci/dns/models/record_operation.rb +253 -0
  50. data/lib/oci/dns/models/rr_set.rb +123 -0
  51. data/lib/oci/dns/models/sort_order.rb +12 -0
  52. data/lib/oci/dns/models/tsig.rb +149 -0
  53. data/lib/oci/dns/models/update_domain_records_details.rb +120 -0
  54. data/lib/oci/dns/models/update_rr_set_details.rb +120 -0
  55. data/lib/oci/dns/models/update_zone_details.rb +122 -0
  56. data/lib/oci/dns/models/update_zone_records_details.rb +120 -0
  57. data/lib/oci/dns/models/zone.rb +272 -0
  58. data/lib/oci/dns/models/zone_summary.rb +230 -0
  59. data/lib/oci/dns/util.rb +2 -0
  60. data/lib/oci/errors.rb +20 -0
  61. data/lib/oci/identity/identity_client.rb +1 -0
  62. data/lib/oci/identity/models/create_dynamic_group_details.rb +4 -2
  63. data/lib/oci/identity/models/dynamic_group.rb +9 -6
  64. data/lib/oci/identity/models/update_dynamic_group_details.rb +4 -2
  65. data/lib/oci/load_balancer/load_balancer.rb +6 -0
  66. data/lib/oci/load_balancer/load_balancer_client.rb +219 -0
  67. data/lib/oci/load_balancer/models/create_listener_details.rb +17 -1
  68. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +12 -1
  69. data/lib/oci/load_balancer/models/create_path_route_set_details.rb +138 -0
  70. data/lib/oci/load_balancer/models/listener.rb +17 -1
  71. data/lib/oci/load_balancer/models/listener_details.rb +17 -1
  72. data/lib/oci/load_balancer/models/load_balancer.rb +12 -1
  73. data/lib/oci/load_balancer/models/path_match_type.rb +153 -0
  74. data/lib/oci/load_balancer/models/path_route.rb +161 -0
  75. data/lib/oci/load_balancer/models/path_route_set.rb +139 -0
  76. data/lib/oci/load_balancer/models/path_route_set_details.rb +122 -0
  77. data/lib/oci/load_balancer/models/update_listener_details.rb +17 -1
  78. data/lib/oci/load_balancer/models/update_path_route_set_details.rb +122 -0
  79. data/lib/oci/load_balancer/util.rb +1 -3
  80. data/lib/oci/object_storage/transfer/multipart/internal/file_part_io_wrapper.rb +111 -0
  81. data/lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb +41 -0
  82. data/lib/oci/object_storage/transfer/multipart/internal/seekable_non_file_part_io_wrapper.rb +48 -0
  83. data/lib/oci/object_storage/transfer/multipart/internal/stdin_part_io_wrapper.rb +54 -0
  84. data/lib/oci/object_storage/transfer/multipart/multipart_object_assembler.rb +545 -0
  85. data/lib/oci/object_storage/transfer/transfer.rb +31 -0
  86. data/lib/oci/object_storage/transfer/upload_manager.rb +212 -0
  87. data/lib/oci/object_storage/transfer/upload_manager_config.rb +60 -0
  88. data/lib/oci/regions.rb +3 -1
  89. data/lib/oci/response.rb +1 -3
  90. data/lib/oci/version.rb +1 -1
  91. data/lib/oci/waiter.rb +16 -11
  92. data/lib/oraclebmc.rb +1 -1
  93. metadata +46 -2
@@ -1131,13 +1131,14 @@ module OCI
1131
1131
  :return_type => 'Array<OCI::Database::Models::DbSystemShapeSummary>')
1132
1132
  end
1133
1133
 
1134
- # Gets a list of the DB Systems in the specified compartment.
1134
+ # Gets a list of the DB Systems in the specified compartment. You can specify a backupId to list only the DB Systems that support creating a database using this backup in this compartment.
1135
1135
  #
1136
1136
  #
1137
1137
  # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1138
1138
  # @param [Hash] opts the optional parameters
1139
1139
  # @option opts [Integer] :limit The maximum number of items to return.
1140
1140
  # @option opts [String] :page The pagination token to continue listing from.
1141
+ # @option opts [String] :backup_id The OCID of the backup. Specify a backupId to list only the DB Systems that support creating a database using this backup in this compartment.
1141
1142
  # @return [Response] A Response object with data of type Array<OCI::Database::Models::DbSystemSummary>
1142
1143
  def list_db_systems(compartment_id, opts = {})
1143
1144
  logger.debug "Calling operation DatabaseClient#list_db_systems." if logger
@@ -1151,6 +1152,7 @@ module OCI
1151
1152
  query_params[:'compartmentId'] = compartment_id
1152
1153
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1153
1154
  query_params[:'page'] = opts[:'page'] if opts[:'page']
1155
+ query_params[:'backupId'] = opts[:'backup_id'] if opts[:'backup_id']
1154
1156
 
1155
1157
  # Header Params
1156
1158
  header_params = {}
@@ -0,0 +1,34 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ module OCI
4
+ module Dns
5
+ module Models
6
+ end
7
+ end
8
+ end
9
+
10
+ # Require models
11
+ require 'oci/dns/models/create_zone_details'
12
+ require 'oci/dns/models/external_master'
13
+ require 'oci/dns/models/patch_domain_records_details'
14
+ require 'oci/dns/models/patch_rr_set_details'
15
+ require 'oci/dns/models/patch_zone_records_details'
16
+ require 'oci/dns/models/rr_set'
17
+ require 'oci/dns/models/record'
18
+ require 'oci/dns/models/record_collection'
19
+ require 'oci/dns/models/record_details'
20
+ require 'oci/dns/models/record_operation'
21
+ require 'oci/dns/models/sort_order'
22
+ require 'oci/dns/models/tsig'
23
+ require 'oci/dns/models/update_domain_records_details'
24
+ require 'oci/dns/models/update_rr_set_details'
25
+ require 'oci/dns/models/update_zone_details'
26
+ require 'oci/dns/models/update_zone_records_details'
27
+ require 'oci/dns/models/zone'
28
+ require 'oci/dns/models/zone_summary'
29
+
30
+ # Require generated clients
31
+ require 'oci/dns/dns_client'
32
+
33
+ # Require service utilities
34
+ require 'oci/dns/util'
@@ -0,0 +1,985 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require "uri"
4
+ require "logger"
5
+
6
+ module OCI
7
+
8
+ class Dns::DnsClient
9
+
10
+ # Client used to make HTTP requests.
11
+ # @return [OCI::ApiClient]
12
+ attr_reader :api_client
13
+
14
+ # Fully qualified endpoint URL
15
+ # @return [String]
16
+ attr_reader :endpoint
17
+
18
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
19
+ # @return [String]
20
+ attr_accessor :region
21
+
22
+ # Creates a new DnsClient.
23
+ # If a config is not specified, then the global OCI.config will be used.
24
+ #
25
+ # A region must be specified in either the config or the region parameter. If specified
26
+ # in both, then the region parameter will be used.
27
+ #
28
+ # @param [Config] config A Config object.
29
+ # @param [String] region A region used to determine the service endpoint. This will usually
30
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
31
+ # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
32
+ # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
33
+ # so that the instance principals signer can be provided to the client
34
+ def initialize(config:nil, region:nil, signer:nil)
35
+ # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
36
+ # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
37
+ # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
38
+ # pass it to this constructor.
39
+ #
40
+ # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
41
+ # so try and load the config from the default file.
42
+ config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
43
+ config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
44
+ config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
45
+
46
+ if signer.nil?
47
+ 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)
48
+ end
49
+
50
+ @api_client = ApiClient.new(config, signer)
51
+
52
+ region ||= config.region
53
+ region ||= signer.region if signer.respond_to?(:region)
54
+ self.region = region
55
+ end
56
+
57
+ # Set the region that will be used to determine the service endpoint.
58
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
59
+ # but may be an arbitrary string.
60
+ def region=(r)
61
+ @region = r
62
+
63
+ fail 'A region must be specified.' unless @region
64
+
65
+ @endpoint = OCI::Regions.get_service_endpoint(@region, :DnsClient) + '/20180115'
66
+ logger.info "DnsClient endpoint set to '#{endpoint}'." if logger
67
+ end
68
+
69
+ # @return [Logger] The logger for this client. May be nil.
70
+ def logger
71
+ @api_client.config.logger
72
+ end
73
+
74
+
75
+ # Creates a new zone in the specified compartment. The `compartmentId`
76
+ # query parameter is required if the `Content-Type` header for the
77
+ # request is `text/dns`.
78
+ #
79
+ # @param [CreateZoneDetails] create_zone_details Details for creating a new zone.
80
+ # @param [Hash] opts the optional parameters
81
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
82
+ # @return [Response] A Response object with data of type OCI::Dns::Models::Zone
83
+ def create_zone(create_zone_details, opts = {})
84
+ logger.debug "Calling operation DnsClient#create_zone." if logger
85
+
86
+ fail "Missing the required parameter 'create_zone_details' when calling create_zone." if create_zone_details.nil?
87
+
88
+ path = "/zones"
89
+
90
+ # Query Params
91
+ query_params = {}
92
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
93
+
94
+ # Header Params
95
+ header_params = {}
96
+ header_params['accept'] = 'application/json'
97
+ header_params['content-type'] = 'application/json'
98
+
99
+ post_body = @api_client.object_to_http_body(create_zone_details)
100
+
101
+ return @api_client.call_api(
102
+ :POST,
103
+ path,
104
+ endpoint,
105
+ :header_params => header_params,
106
+ :query_params => query_params,
107
+ :body => post_body,
108
+ :return_type => 'OCI::Dns::Models::Zone')
109
+ end
110
+
111
+ # Deletes all records at the specified zone and domain.
112
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
113
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
116
+ # existence of at least one current representation of the target resource,
117
+ # when the field-value is `*`, or having a current representation of the
118
+ # target resource that has an entity-tag matching a member of the list of
119
+ # entity-tags provided in the field-value.
120
+ #
121
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
122
+ # conditional on the selected representation's last modification date being
123
+ # earlier than or equal to the date provided in the field-value. This
124
+ # field accomplishes the same purpose as If-Match for cases where the user
125
+ # agent does not have an entity-tag for the representation.
126
+ #
127
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
128
+ # @return [Response] A Response object with data of type nil
129
+ def delete_domain_records(zone_name_or_id, domain, opts = {})
130
+ logger.debug "Calling operation DnsClient#delete_domain_records." if logger
131
+
132
+ fail "Missing the required parameter 'zone_name_or_id' when calling delete_domain_records." if zone_name_or_id.nil?
133
+ fail "Missing the required parameter 'domain' when calling delete_domain_records." if domain.nil?
134
+
135
+ path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
136
+
137
+ # Query Params
138
+ query_params = {}
139
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
140
+
141
+ # Header Params
142
+ header_params = {}
143
+ header_params['accept'] = 'application/json'
144
+ header_params['content-type'] = 'application/json'
145
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
146
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
147
+
148
+ post_body = nil
149
+
150
+ return @api_client.call_api(
151
+ :DELETE,
152
+ path,
153
+ endpoint,
154
+ :header_params => header_params,
155
+ :query_params => query_params,
156
+ :body => post_body)
157
+ end
158
+
159
+ # Deletes all records in the specified RRSet.
160
+ #
161
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
162
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
163
+ # @param [String] rtype The type of the target RRSet within the target zone.
164
+ # @param [Hash] opts the optional parameters
165
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
166
+ # existence of at least one current representation of the target resource,
167
+ # when the field-value is `*`, or having a current representation of the
168
+ # target resource that has an entity-tag matching a member of the list of
169
+ # entity-tags provided in the field-value.
170
+ #
171
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
172
+ # conditional on the selected representation's last modification date being
173
+ # earlier than or equal to the date provided in the field-value. This
174
+ # field accomplishes the same purpose as If-Match for cases where the user
175
+ # agent does not have an entity-tag for the representation.
176
+ #
177
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
178
+ # @return [Response] A Response object with data of type nil
179
+ def delete_rr_set(zone_name_or_id, domain, rtype, opts = {})
180
+ logger.debug "Calling operation DnsClient#delete_rr_set." if logger
181
+
182
+ fail "Missing the required parameter 'zone_name_or_id' when calling delete_rr_set." if zone_name_or_id.nil?
183
+ fail "Missing the required parameter 'domain' when calling delete_rr_set." if domain.nil?
184
+ fail "Missing the required parameter 'rtype' when calling delete_rr_set." if rtype.nil?
185
+
186
+ path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
187
+
188
+ # Query Params
189
+ query_params = {}
190
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
191
+
192
+ # Header Params
193
+ header_params = {}
194
+ header_params['accept'] = 'application/json'
195
+ header_params['content-type'] = 'application/json'
196
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
197
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
198
+
199
+ post_body = nil
200
+
201
+ return @api_client.call_api(
202
+ :DELETE,
203
+ path,
204
+ endpoint,
205
+ :header_params => header_params,
206
+ :query_params => query_params,
207
+ :body => post_body)
208
+ end
209
+
210
+ # Deletes the specified zone. A `204` response indicates that zone has been
211
+ # successfully deleted.
212
+ #
213
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
214
+ # @param [Hash] opts the optional parameters
215
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
216
+ # existence of at least one current representation of the target resource,
217
+ # when the field-value is `*`, or having a current representation of the
218
+ # target resource that has an entity-tag matching a member of the list of
219
+ # entity-tags provided in the field-value.
220
+ #
221
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
222
+ # conditional on the selected representation's last modification date being
223
+ # earlier than or equal to the date provided in the field-value. This
224
+ # field accomplishes the same purpose as If-Match for cases where the user
225
+ # agent does not have an entity-tag for the representation.
226
+ #
227
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
228
+ # @return [Response] A Response object with data of type nil
229
+ def delete_zone(zone_name_or_id, opts = {})
230
+ logger.debug "Calling operation DnsClient#delete_zone." if logger
231
+
232
+ fail "Missing the required parameter 'zone_name_or_id' when calling delete_zone." if zone_name_or_id.nil?
233
+
234
+ path = "/zones/{zoneNameOrId}".sub('{zoneNameOrId}', zone_name_or_id.to_s)
235
+
236
+ # Query Params
237
+ query_params = {}
238
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
239
+
240
+ # Header Params
241
+ header_params = {}
242
+ header_params['accept'] = 'application/json'
243
+ header_params['content-type'] = 'application/json'
244
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
245
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
246
+
247
+ post_body = nil
248
+
249
+ return @api_client.call_api(
250
+ :DELETE,
251
+ path,
252
+ endpoint,
253
+ :header_params => header_params,
254
+ :query_params => query_params,
255
+ :body => post_body)
256
+ end
257
+
258
+ # Gets a list of all records at the specified zone and domain.
259
+ # The results are sorted by `rtype` in alphabetical order by default. You
260
+ # can optionally filter and/or sort the results using the listed parameters.
261
+ #
262
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
263
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
264
+ # @param [Hash] opts the optional parameters
265
+ # @option opts [String] :if_none_match The `If-None-Match` header field makes the request method conditional on
266
+ # the absence of any current representation of the target resource, when
267
+ # the field-value is `*`, or having a selected representation with an
268
+ # entity-tag that does not match any of those listed in the field-value.
269
+ #
270
+ # @option opts [String] :if_modified_since The `If-Modified-Since` header field makes a GET or HEAD request method
271
+ # conditional on the selected representation's modification date being more
272
+ # recent than the date provided in the field-value. Transfer of the
273
+ # selected representation's data is avoided if that data has not changed.
274
+ #
275
+ # @option opts [Integer] :limit The maximum number of items to return in a page of the collection.
276
+ # (default to 50)
277
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
278
+ #
279
+ # @option opts [String] :zone_version The version of the zone for which data is requested.
280
+ #
281
+ # @option opts [String] :rtype Search by record type.
282
+ # Will match any record whose [type](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4) (case-insensitive) equals the provided value.
283
+ #
284
+ # @option opts [String] :sort_by The field by which to sort records. (default to rtype)
285
+ # Allowed values are: rtype, ttl
286
+ # @option opts [String] :sort_order The order to sort the resources.
287
+ #
288
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
289
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
290
+ def get_domain_records(zone_name_or_id, domain, opts = {})
291
+ logger.debug "Calling operation DnsClient#get_domain_records." if logger
292
+
293
+ fail "Missing the required parameter 'zone_name_or_id' when calling get_domain_records." if zone_name_or_id.nil?
294
+ fail "Missing the required parameter 'domain' when calling get_domain_records." if domain.nil?
295
+
296
+ if opts[:'sort_by'] && !['rtype', 'ttl'].include?(opts[:'sort_by'])
297
+ fail 'Invalid value for "sort_by", must be one of rtype, ttl.'
298
+ end
299
+
300
+ if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order'])
301
+ fail 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.'
302
+ end
303
+
304
+ path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
305
+
306
+ # Query Params
307
+ query_params = {}
308
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
309
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
310
+ query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version']
311
+ query_params[:'rtype'] = opts[:'rtype'] if opts[:'rtype']
312
+ query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
313
+ query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
314
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
315
+
316
+ # Header Params
317
+ header_params = {}
318
+ header_params['accept'] = 'application/json'
319
+ header_params['content-type'] = 'application/json'
320
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
321
+ header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']
322
+
323
+ post_body = nil
324
+
325
+ return @api_client.call_api(
326
+ :GET,
327
+ path,
328
+ endpoint,
329
+ :header_params => header_params,
330
+ :query_params => query_params,
331
+ :body => post_body,
332
+ :return_type => 'OCI::Dns::Models::RecordCollection')
333
+ end
334
+
335
+ # Gets a list of all records in the specified RRSet. The results are
336
+ # sorted by `recordHash` by default.
337
+ #
338
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
339
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
340
+ # @param [String] rtype The type of the target RRSet within the target zone.
341
+ # @param [Hash] opts the optional parameters
342
+ # @option opts [String] :if_none_match The `If-None-Match` header field makes the request method conditional on
343
+ # the absence of any current representation of the target resource, when
344
+ # the field-value is `*`, or having a selected representation with an
345
+ # entity-tag that does not match any of those listed in the field-value.
346
+ #
347
+ # @option opts [String] :if_modified_since The `If-Modified-Since` header field makes a GET or HEAD request method
348
+ # conditional on the selected representation's modification date being more
349
+ # recent than the date provided in the field-value. Transfer of the
350
+ # selected representation's data is avoided if that data has not changed.
351
+ #
352
+ # @option opts [Integer] :limit The maximum number of items to return in a page of the collection.
353
+ # (default to 50)
354
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
355
+ #
356
+ # @option opts [String] :zone_version The version of the zone for which data is requested.
357
+ #
358
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
359
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RRSet
360
+ def get_rr_set(zone_name_or_id, domain, rtype, opts = {})
361
+ logger.debug "Calling operation DnsClient#get_rr_set." if logger
362
+
363
+ fail "Missing the required parameter 'zone_name_or_id' when calling get_rr_set." if zone_name_or_id.nil?
364
+ fail "Missing the required parameter 'domain' when calling get_rr_set." if domain.nil?
365
+ fail "Missing the required parameter 'rtype' when calling get_rr_set." if rtype.nil?
366
+
367
+ path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
368
+
369
+ # Query Params
370
+ query_params = {}
371
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
372
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
373
+ query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version']
374
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
375
+
376
+ # Header Params
377
+ header_params = {}
378
+ header_params['accept'] = 'application/json'
379
+ header_params['content-type'] = 'application/json'
380
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
381
+ header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']
382
+
383
+ post_body = nil
384
+
385
+ return @api_client.call_api(
386
+ :GET,
387
+ path,
388
+ endpoint,
389
+ :header_params => header_params,
390
+ :query_params => query_params,
391
+ :body => post_body,
392
+ :return_type => 'OCI::Dns::Models::RRSet')
393
+ end
394
+
395
+ # Gets information about the specified zone, including its creation date,
396
+ # zone type, and serial.
397
+ #
398
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
399
+ # @param [Hash] opts the optional parameters
400
+ # @option opts [String] :if_none_match The `If-None-Match` header field makes the request method conditional on
401
+ # the absence of any current representation of the target resource, when
402
+ # the field-value is `*`, or having a selected representation with an
403
+ # entity-tag that does not match any of those listed in the field-value.
404
+ #
405
+ # @option opts [String] :if_modified_since The `If-Modified-Since` header field makes a GET or HEAD request method
406
+ # conditional on the selected representation's modification date being more
407
+ # recent than the date provided in the field-value. Transfer of the
408
+ # selected representation's data is avoided if that data has not changed.
409
+ #
410
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
411
+ # @return [Response] A Response object with data of type OCI::Dns::Models::Zone
412
+ def get_zone(zone_name_or_id, opts = {})
413
+ logger.debug "Calling operation DnsClient#get_zone." if logger
414
+
415
+ fail "Missing the required parameter 'zone_name_or_id' when calling get_zone." if zone_name_or_id.nil?
416
+
417
+ path = "/zones/{zoneNameOrId}".sub('{zoneNameOrId}', zone_name_or_id.to_s)
418
+
419
+ # Query Params
420
+ query_params = {}
421
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
422
+
423
+ # Header Params
424
+ header_params = {}
425
+ header_params['accept'] = 'application/json'
426
+ header_params['content-type'] = 'application/json'
427
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
428
+ header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']
429
+
430
+ post_body = nil
431
+
432
+ return @api_client.call_api(
433
+ :GET,
434
+ path,
435
+ endpoint,
436
+ :header_params => header_params,
437
+ :query_params => query_params,
438
+ :body => post_body,
439
+ :return_type => 'OCI::Dns::Models::Zone')
440
+ end
441
+
442
+ # Gets all records in the specified zone. The results are
443
+ # sorted by `domain` in alphabetical order by default. For more
444
+ # information about records, please see [Resource Record (RR) TYPEs](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
445
+ #
446
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
447
+ # @param [Hash] opts the optional parameters
448
+ # @option opts [String] :if_none_match The `If-None-Match` header field makes the request method conditional on
449
+ # the absence of any current representation of the target resource, when
450
+ # the field-value is `*`, or having a selected representation with an
451
+ # entity-tag that does not match any of those listed in the field-value.
452
+ #
453
+ # @option opts [String] :if_modified_since The `If-Modified-Since` header field makes a GET or HEAD request method
454
+ # conditional on the selected representation's modification date being more
455
+ # recent than the date provided in the field-value. Transfer of the
456
+ # selected representation's data is avoided if that data has not changed.
457
+ #
458
+ # @option opts [Integer] :limit The maximum number of items to return in a page of the collection.
459
+ # (default to 50)
460
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
461
+ #
462
+ # @option opts [String] :zone_version The version of the zone for which data is requested.
463
+ #
464
+ # @option opts [String] :domain Search by domain.
465
+ # Will match any record whose domain (case-insensitive) equals the provided value.
466
+ #
467
+ # @option opts [String] :domain_contains Search by domain.
468
+ # Will match any record whose domain (case-insensitive) contains the provided value.
469
+ #
470
+ # @option opts [String] :rtype Search by record type.
471
+ # Will match any record whose [type](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4) (case-insensitive) equals the provided value.
472
+ #
473
+ # @option opts [String] :sort_by The field by which to sort records. (default to domain)
474
+ # Allowed values are: domain, rtype, ttl
475
+ # @option opts [String] :sort_order The order to sort the resources.
476
+ #
477
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
478
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
479
+ def get_zone_records(zone_name_or_id, opts = {})
480
+ logger.debug "Calling operation DnsClient#get_zone_records." if logger
481
+
482
+ fail "Missing the required parameter 'zone_name_or_id' when calling get_zone_records." if zone_name_or_id.nil?
483
+
484
+ if opts[:'sort_by'] && !['domain', 'rtype', 'ttl'].include?(opts[:'sort_by'])
485
+ fail 'Invalid value for "sort_by", must be one of domain, rtype, ttl.'
486
+ end
487
+
488
+ if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order'])
489
+ fail 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.'
490
+ end
491
+
492
+ path = "/zones/{zoneNameOrId}/records".sub('{zoneNameOrId}', zone_name_or_id.to_s)
493
+
494
+ # Query Params
495
+ query_params = {}
496
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
497
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
498
+ query_params[:'zoneVersion'] = opts[:'zone_version'] if opts[:'zone_version']
499
+ query_params[:'domain'] = opts[:'domain'] if opts[:'domain']
500
+ query_params[:'domainContains'] = opts[:'domain_contains'] if opts[:'domain_contains']
501
+ query_params[:'rtype'] = opts[:'rtype'] if opts[:'rtype']
502
+ query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
503
+ query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
504
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
505
+
506
+ # Header Params
507
+ header_params = {}
508
+ header_params['accept'] = 'application/json'
509
+ header_params['content-type'] = 'application/json'
510
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if opts[:'if_none_match']
511
+ header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if opts[:'if_modified_since']
512
+
513
+ post_body = nil
514
+
515
+ return @api_client.call_api(
516
+ :GET,
517
+ path,
518
+ endpoint,
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :body => post_body,
522
+ :return_type => 'OCI::Dns::Models::RecordCollection')
523
+ end
524
+
525
+ # Gets a list of all zones in the specified compartment. The collection
526
+ # can be filtered by name, time created, and zone type.
527
+ #
528
+ # @param [String] compartment_id The OCID of the compartment the resource belongs to.
529
+ # @param [Hash] opts the optional parameters
530
+ # @option opts [Integer] :limit The maximum number of items to return in a page of the collection.
531
+ # (default to 50)
532
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
533
+ #
534
+ # @option opts [String] :name A case-sensitive filter for zone names.
535
+ # Will match any zone with a name that equals the provided value.
536
+ #
537
+ # @option opts [String] :name_contains Search by zone name.
538
+ # Will match any zone whose name (case-insensitive) contains the provided value.
539
+ #
540
+ # @option opts [String] :zone_type Search by zone type, `PRIMARY` or `SECONDARY`.
541
+ # Will match any zone whose type equals the provided value.
542
+ #
543
+ # Allowed values are: PRIMARY, SECONDARY
544
+ # @option opts [DateTime] :time_created_greater_than_or_equal_to An [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp that states
545
+ # all returned resources were created on or after the indicated time.
546
+ #
547
+ # @option opts [DateTime] :time_created_less_than An [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp that states
548
+ # all returned resources were created before the indicated time.
549
+ #
550
+ # @option opts [String] :sort_by The field by which to sort zones. (default to timeCreated)
551
+ # Allowed values are: name, zoneType, timeCreated
552
+ # @option opts [String] :sort_order The order to sort the resources.
553
+ #
554
+ # @option opts [String] :lifecycle_state The state of a resource.
555
+ # Allowed values are: ACTIVE, CREATING, DELETED, DELETING, FAILED
556
+ # @return [Response] A Response object with data of type Array<OCI::Dns::Models::ZoneSummary>
557
+ def list_zones(compartment_id, opts = {})
558
+ logger.debug "Calling operation DnsClient#list_zones." if logger
559
+
560
+ fail "Missing the required parameter 'compartment_id' when calling list_zones." if compartment_id.nil?
561
+
562
+ if opts[:'zone_type'] && !['PRIMARY', 'SECONDARY'].include?(opts[:'zone_type'])
563
+ fail 'Invalid value for "zone_type", must be one of PRIMARY, SECONDARY.'
564
+ end
565
+
566
+ if opts[:'sort_by'] && !['name', 'zoneType', 'timeCreated'].include?(opts[:'sort_by'])
567
+ fail 'Invalid value for "sort_by", must be one of name, zoneType, timeCreated.'
568
+ end
569
+
570
+ if opts[:'sort_order'] && !OCI::Dns::Models::SORT_ORDER_ENUM.include?(opts[:'sort_order'])
571
+ fail 'Invalid value for "sort_order", must be one of the values in OCI::Dns::Models::SORT_ORDER_ENUM.'
572
+ end
573
+
574
+ if opts[:'lifecycle_state'] && !['ACTIVE', 'CREATING', 'DELETED', 'DELETING', 'FAILED'].include?(opts[:'lifecycle_state'])
575
+ fail 'Invalid value for "lifecycle_state", must be one of ACTIVE, CREATING, DELETED, DELETING, FAILED.'
576
+ end
577
+
578
+ path = "/zones"
579
+
580
+ # Query Params
581
+ query_params = {}
582
+ query_params[:'compartmentId'] = compartment_id
583
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
584
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
585
+ query_params[:'name'] = opts[:'name'] if opts[:'name']
586
+ query_params[:'nameContains'] = opts[:'name_contains'] if opts[:'name_contains']
587
+ query_params[:'zoneType'] = opts[:'zone_type'] if opts[:'zone_type']
588
+ query_params[:'timeCreatedGreaterThanOrEqualTo'] = opts[:'time_created_greater_than_or_equal_to'] if opts[:'time_created_greater_than_or_equal_to']
589
+ query_params[:'timeCreatedLessThan'] = opts[:'time_created_less_than'] if opts[:'time_created_less_than']
590
+ query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
591
+ query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
592
+ query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
593
+
594
+ # Header Params
595
+ header_params = {}
596
+ header_params['accept'] = 'application/json'
597
+ header_params['content-type'] = 'application/json'
598
+
599
+ post_body = nil
600
+
601
+ return @api_client.call_api(
602
+ :GET,
603
+ path,
604
+ endpoint,
605
+ :header_params => header_params,
606
+ :query_params => query_params,
607
+ :body => post_body,
608
+ :return_type => 'Array<OCI::Dns::Models::ZoneSummary>')
609
+ end
610
+
611
+ # 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.
612
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
613
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
614
+ # @param [PatchDomainRecordsDetails] patch_domain_records_details Operations describing how to modify the collection of records.
615
+ # @param [Hash] opts the optional parameters
616
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
617
+ # existence of at least one current representation of the target resource,
618
+ # when the field-value is `*`, or having a current representation of the
619
+ # target resource that has an entity-tag matching a member of the list of
620
+ # entity-tags provided in the field-value.
621
+ #
622
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
623
+ # conditional on the selected representation's last modification date being
624
+ # earlier than or equal to the date provided in the field-value. This
625
+ # field accomplishes the same purpose as If-Match for cases where the user
626
+ # agent does not have an entity-tag for the representation.
627
+ #
628
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
629
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
630
+ def patch_domain_records(zone_name_or_id, domain, patch_domain_records_details, opts = {})
631
+ logger.debug "Calling operation DnsClient#patch_domain_records." if logger
632
+
633
+ fail "Missing the required parameter 'zone_name_or_id' when calling patch_domain_records." if zone_name_or_id.nil?
634
+ fail "Missing the required parameter 'domain' when calling patch_domain_records." if domain.nil?
635
+ fail "Missing the required parameter 'patch_domain_records_details' when calling patch_domain_records." if patch_domain_records_details.nil?
636
+
637
+ path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
638
+
639
+ # Query Params
640
+ query_params = {}
641
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
642
+
643
+ # Header Params
644
+ header_params = {}
645
+ header_params['accept'] = 'application/json'
646
+ header_params['content-type'] = 'application/json'
647
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
648
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
649
+
650
+ post_body = @api_client.object_to_http_body(patch_domain_records_details)
651
+
652
+ return @api_client.call_api(
653
+ :PATCH,
654
+ path,
655
+ endpoint,
656
+ :header_params => header_params,
657
+ :query_params => query_params,
658
+ :body => post_body,
659
+ :return_type => 'OCI::Dns::Models::RecordCollection')
660
+ end
661
+
662
+ # Updates records in the specified RRSet.
663
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
664
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
665
+ # @param [String] rtype The type of the target RRSet within the target zone.
666
+ # @param [PatchRRSetDetails] patch_rr_set_details Operations describing how to modify the collection of records.
667
+ # @param [Hash] opts the optional parameters
668
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
669
+ # existence of at least one current representation of the target resource,
670
+ # when the field-value is `*`, or having a current representation of the
671
+ # target resource that has an entity-tag matching a member of the list of
672
+ # entity-tags provided in the field-value.
673
+ #
674
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
675
+ # conditional on the selected representation's last modification date being
676
+ # earlier than or equal to the date provided in the field-value. This
677
+ # field accomplishes the same purpose as If-Match for cases where the user
678
+ # agent does not have an entity-tag for the representation.
679
+ #
680
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
681
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
682
+ def patch_rr_set(zone_name_or_id, domain, rtype, patch_rr_set_details, opts = {})
683
+ logger.debug "Calling operation DnsClient#patch_rr_set." if logger
684
+
685
+ fail "Missing the required parameter 'zone_name_or_id' when calling patch_rr_set." if zone_name_or_id.nil?
686
+ fail "Missing the required parameter 'domain' when calling patch_rr_set." if domain.nil?
687
+ fail "Missing the required parameter 'rtype' when calling patch_rr_set." if rtype.nil?
688
+ fail "Missing the required parameter 'patch_rr_set_details' when calling patch_rr_set." if patch_rr_set_details.nil?
689
+
690
+ path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
691
+
692
+ # Query Params
693
+ query_params = {}
694
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
695
+
696
+ # Header Params
697
+ header_params = {}
698
+ header_params['accept'] = 'application/json'
699
+ header_params['content-type'] = 'application/json'
700
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
701
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
702
+
703
+ post_body = @api_client.object_to_http_body(patch_rr_set_details)
704
+
705
+ return @api_client.call_api(
706
+ :PATCH,
707
+ path,
708
+ endpoint,
709
+ :header_params => header_params,
710
+ :query_params => query_params,
711
+ :body => post_body,
712
+ :return_type => 'OCI::Dns::Models::RecordCollection')
713
+ end
714
+
715
+ # Updates a collection of records in the specified zone. You can update
716
+ # one record or all records for the specified zone depending on the
717
+ # changes provided in the request body. You can also add or remove records
718
+ # using this function.
719
+ #
720
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
721
+ # @param [PatchZoneRecordsDetails] patch_zone_records_details The operations describing how to modify the collection of records.
722
+ #
723
+ # @param [Hash] opts the optional parameters
724
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
725
+ # existence of at least one current representation of the target resource,
726
+ # when the field-value is `*`, or having a current representation of the
727
+ # target resource that has an entity-tag matching a member of the list of
728
+ # entity-tags provided in the field-value.
729
+ #
730
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
731
+ # conditional on the selected representation's last modification date being
732
+ # earlier than or equal to the date provided in the field-value. This
733
+ # field accomplishes the same purpose as If-Match for cases where the user
734
+ # agent does not have an entity-tag for the representation.
735
+ #
736
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
737
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
738
+ def patch_zone_records(zone_name_or_id, patch_zone_records_details, opts = {})
739
+ logger.debug "Calling operation DnsClient#patch_zone_records." if logger
740
+
741
+ fail "Missing the required parameter 'zone_name_or_id' when calling patch_zone_records." if zone_name_or_id.nil?
742
+ fail "Missing the required parameter 'patch_zone_records_details' when calling patch_zone_records." if patch_zone_records_details.nil?
743
+
744
+ path = "/zones/{zoneNameOrId}/records".sub('{zoneNameOrId}', zone_name_or_id.to_s)
745
+
746
+ # Query Params
747
+ query_params = {}
748
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
749
+
750
+ # Header Params
751
+ header_params = {}
752
+ header_params['accept'] = 'application/json'
753
+ header_params['content-type'] = 'application/json'
754
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
755
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
756
+
757
+ post_body = @api_client.object_to_http_body(patch_zone_records_details)
758
+
759
+ return @api_client.call_api(
760
+ :PATCH,
761
+ path,
762
+ endpoint,
763
+ :header_params => header_params,
764
+ :query_params => query_params,
765
+ :body => post_body,
766
+ :return_type => 'OCI::Dns::Models::RecordCollection')
767
+ end
768
+
769
+ # Replaces records in the specified zone at a domain with the records
770
+ # specified in the request body. If a specified record does not exist,
771
+ # it will be created. If the record exists, then it will be updated to
772
+ # represent the record in the body of the request. If a record in the zone
773
+ # does not exist in the request body, the record will be removed from the
774
+ # zone.
775
+ #
776
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
777
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
778
+ # @param [UpdateDomainRecordsDetails] update_domain_records_details A full list of records for the domain.
779
+ # @param [Hash] opts the optional parameters
780
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
781
+ # existence of at least one current representation of the target resource,
782
+ # when the field-value is `*`, or having a current representation of the
783
+ # target resource that has an entity-tag matching a member of the list of
784
+ # entity-tags provided in the field-value.
785
+ #
786
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
787
+ # conditional on the selected representation's last modification date being
788
+ # earlier than or equal to the date provided in the field-value. This
789
+ # field accomplishes the same purpose as If-Match for cases where the user
790
+ # agent does not have an entity-tag for the representation.
791
+ #
792
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
793
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
794
+ def update_domain_records(zone_name_or_id, domain, update_domain_records_details, opts = {})
795
+ logger.debug "Calling operation DnsClient#update_domain_records." if logger
796
+
797
+ fail "Missing the required parameter 'zone_name_or_id' when calling update_domain_records." if zone_name_or_id.nil?
798
+ fail "Missing the required parameter 'domain' when calling update_domain_records." if domain.nil?
799
+ fail "Missing the required parameter 'update_domain_records_details' when calling update_domain_records." if update_domain_records_details.nil?
800
+
801
+ path = "/zones/{zoneNameOrId}/records/{domain}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s)
802
+
803
+ # Query Params
804
+ query_params = {}
805
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
806
+
807
+ # Header Params
808
+ header_params = {}
809
+ header_params['accept'] = 'application/json'
810
+ header_params['content-type'] = 'application/json'
811
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
812
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
813
+
814
+ post_body = @api_client.object_to_http_body(update_domain_records_details)
815
+
816
+ return @api_client.call_api(
817
+ :PUT,
818
+ path,
819
+ endpoint,
820
+ :header_params => header_params,
821
+ :query_params => query_params,
822
+ :body => post_body,
823
+ :return_type => 'OCI::Dns::Models::RecordCollection')
824
+ end
825
+
826
+ # Replaces records in the specified RRSet.
827
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
828
+ # @param [String] domain The target fully-qualified domain name (FQDN) within the target zone.
829
+ # @param [String] rtype The type of the target RRSet within the target zone.
830
+ # @param [UpdateRRSetDetails] update_rr_set_details A full list of records for the RRSet.
831
+ # @param [Hash] opts the optional parameters
832
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
833
+ # existence of at least one current representation of the target resource,
834
+ # when the field-value is `*`, or having a current representation of the
835
+ # target resource that has an entity-tag matching a member of the list of
836
+ # entity-tags provided in the field-value.
837
+ #
838
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
839
+ # conditional on the selected representation's last modification date being
840
+ # earlier than or equal to the date provided in the field-value. This
841
+ # field accomplishes the same purpose as If-Match for cases where the user
842
+ # agent does not have an entity-tag for the representation.
843
+ #
844
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
845
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
846
+ def update_rr_set(zone_name_or_id, domain, rtype, update_rr_set_details, opts = {})
847
+ logger.debug "Calling operation DnsClient#update_rr_set." if logger
848
+
849
+ fail "Missing the required parameter 'zone_name_or_id' when calling update_rr_set." if zone_name_or_id.nil?
850
+ fail "Missing the required parameter 'domain' when calling update_rr_set." if domain.nil?
851
+ fail "Missing the required parameter 'rtype' when calling update_rr_set." if rtype.nil?
852
+ fail "Missing the required parameter 'update_rr_set_details' when calling update_rr_set." if update_rr_set_details.nil?
853
+
854
+ path = "/zones/{zoneNameOrId}/records/{domain}/{rtype}".sub('{zoneNameOrId}', zone_name_or_id.to_s).sub('{domain}', domain.to_s).sub('{rtype}', rtype.to_s)
855
+
856
+ # Query Params
857
+ query_params = {}
858
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
859
+
860
+ # Header Params
861
+ header_params = {}
862
+ header_params['accept'] = 'application/json'
863
+ header_params['content-type'] = 'application/json'
864
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
865
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
866
+
867
+ post_body = @api_client.object_to_http_body(update_rr_set_details)
868
+
869
+ return @api_client.call_api(
870
+ :PUT,
871
+ path,
872
+ endpoint,
873
+ :header_params => header_params,
874
+ :query_params => query_params,
875
+ :body => post_body,
876
+ :return_type => 'OCI::Dns::Models::RecordCollection')
877
+ end
878
+
879
+ # Updates the specified secondary zone with your new external master
880
+ # server information. For more information about secondary zone, see
881
+ # [Manage DNS Service Zone](https://docs.us-phoenix-1.oraclecloud.com/Content/DNS/Tasks/managingdnszones.htm).
882
+ #
883
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
884
+ # @param [UpdateZoneDetails] update_zone_details New data for the zone.
885
+ # @param [Hash] opts the optional parameters
886
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
887
+ # existence of at least one current representation of the target resource,
888
+ # when the field-value is `*`, or having a current representation of the
889
+ # target resource that has an entity-tag matching a member of the list of
890
+ # entity-tags provided in the field-value.
891
+ #
892
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
893
+ # conditional on the selected representation's last modification date being
894
+ # earlier than or equal to the date provided in the field-value. This
895
+ # field accomplishes the same purpose as If-Match for cases where the user
896
+ # agent does not have an entity-tag for the representation.
897
+ #
898
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
899
+ # @return [Response] A Response object with data of type OCI::Dns::Models::Zone
900
+ def update_zone(zone_name_or_id, update_zone_details, opts = {})
901
+ logger.debug "Calling operation DnsClient#update_zone." if logger
902
+
903
+ fail "Missing the required parameter 'zone_name_or_id' when calling update_zone." if zone_name_or_id.nil?
904
+ fail "Missing the required parameter 'update_zone_details' when calling update_zone." if update_zone_details.nil?
905
+
906
+ path = "/zones/{zoneNameOrId}".sub('{zoneNameOrId}', zone_name_or_id.to_s)
907
+
908
+ # Query Params
909
+ query_params = {}
910
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
911
+
912
+ # Header Params
913
+ header_params = {}
914
+ header_params['accept'] = 'application/json'
915
+ header_params['content-type'] = 'application/json'
916
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
917
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
918
+
919
+ post_body = @api_client.object_to_http_body(update_zone_details)
920
+
921
+ return @api_client.call_api(
922
+ :PUT,
923
+ path,
924
+ endpoint,
925
+ :header_params => header_params,
926
+ :query_params => query_params,
927
+ :body => post_body,
928
+ :return_type => 'OCI::Dns::Models::Zone')
929
+ end
930
+
931
+ # Replaces records in the specified zone with the records specified in the
932
+ # request body. If a specified record does not exist, it will be created.
933
+ # If the record exists, then it will be updated to represent the record in
934
+ # the body of the request. If a record in the zone does not exist in the
935
+ # request body, the record will be removed from the zone.
936
+ #
937
+ # @param [String] zone_name_or_id The name or OCID of the target zone.
938
+ # @param [UpdateZoneRecordsDetails] update_zone_records_details A full list of records for the zone.
939
+ # @param [Hash] opts the optional parameters
940
+ # @option opts [String] :if_match The `If-Match` header field makes the request method conditional on the
941
+ # existence of at least one current representation of the target resource,
942
+ # when the field-value is `*`, or having a current representation of the
943
+ # target resource that has an entity-tag matching a member of the list of
944
+ # entity-tags provided in the field-value.
945
+ #
946
+ # @option opts [String] :if_unmodified_since The `If-Unmodified-Since` header field makes the request method
947
+ # conditional on the selected representation's last modification date being
948
+ # earlier than or equal to the date provided in the field-value. This
949
+ # field accomplishes the same purpose as If-Match for cases where the user
950
+ # agent does not have an entity-tag for the representation.
951
+ #
952
+ # @option opts [String] :compartment_id The OCID of the compartment the resource belongs to.
953
+ # @return [Response] A Response object with data of type OCI::Dns::Models::RecordCollection
954
+ def update_zone_records(zone_name_or_id, update_zone_records_details, opts = {})
955
+ logger.debug "Calling operation DnsClient#update_zone_records." if logger
956
+
957
+ fail "Missing the required parameter 'zone_name_or_id' when calling update_zone_records." if zone_name_or_id.nil?
958
+ fail "Missing the required parameter 'update_zone_records_details' when calling update_zone_records." if update_zone_records_details.nil?
959
+
960
+ path = "/zones/{zoneNameOrId}/records".sub('{zoneNameOrId}', zone_name_or_id.to_s)
961
+
962
+ # Query Params
963
+ query_params = {}
964
+ query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
965
+
966
+ # Header Params
967
+ header_params = {}
968
+ header_params['accept'] = 'application/json'
969
+ header_params['content-type'] = 'application/json'
970
+ header_params[:'If-Match'] = opts[:'if_match'] if opts[:'if_match']
971
+ header_params[:'If-Unmodified-Since'] = opts[:'if_unmodified_since'] if opts[:'if_unmodified_since']
972
+
973
+ post_body = @api_client.object_to_http_body(update_zone_records_details)
974
+
975
+ return @api_client.call_api(
976
+ :PUT,
977
+ path,
978
+ endpoint,
979
+ :header_params => header_params,
980
+ :query_params => query_params,
981
+ :body => post_body,
982
+ :return_type => 'OCI::Dns::Models::RecordCollection')
983
+ end
984
+ end
985
+ end