azure_mgmt_privatedns 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-09-01/generated/azure_mgmt_privatedns.rb +51 -0
  4. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/aaaa_record.rb +46 -0
  5. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/arecord.rb +46 -0
  6. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/cname_record.rb +46 -0
  7. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/mx_record.rb +57 -0
  8. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/private_zone.rb +196 -0
  9. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/private_zone_list_result.rb +99 -0
  10. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/provisioning_state.rb +20 -0
  11. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/proxy_resource.rb +62 -0
  12. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/ptr_record.rb +46 -0
  13. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/record_set.rb +275 -0
  14. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/record_set_list_result.rb +100 -0
  15. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/record_type.rb +22 -0
  16. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/resource.rb +83 -0
  17. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/soa_record.rb +114 -0
  18. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/srv_record.rb +79 -0
  19. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/sub_resource.rb +46 -0
  20. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/tracked_resource.rb +92 -0
  21. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/txt_record.rb +54 -0
  22. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/virtual_network_link.rb +151 -0
  23. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/virtual_network_link_list_result.rb +101 -0
  24. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/virtual_network_link_state.rb +16 -0
  25. data/lib/2018-09-01/generated/azure_mgmt_privatedns/module_definition.rb +9 -0
  26. data/lib/2018-09-01/generated/azure_mgmt_privatedns/private_dns_management_client.rb +141 -0
  27. data/lib/2018-09-01/generated/azure_mgmt_privatedns/private_zones.rb +1051 -0
  28. data/lib/2018-09-01/generated/azure_mgmt_privatedns/record_sets.rb +1023 -0
  29. data/lib/2018-09-01/generated/azure_mgmt_privatedns/virtual_network_links.rb +908 -0
  30. data/lib/azure_mgmt_privatedns.rb +6 -0
  31. data/lib/module_definition.rb +8 -0
  32. data/lib/profiles/latest/modules/privatedns_profile_module.rb +149 -0
  33. data/lib/profiles/latest/privatedns_latest_profile_client.rb +40 -0
  34. data/lib/profiles/latest/privatedns_module_definition.rb +8 -0
  35. data/lib/version.rb +7 -0
  36. metadata +153 -0
@@ -0,0 +1,908 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::PrivateDns::Mgmt::V2018_09_01
7
+ #
8
+ # The Private DNS Management Client.
9
+ #
10
+ class VirtualNetworkLinks
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VirtualNetworkLinks class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [PrivateDnsManagementClient] reference to the PrivateDnsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates a virtual network link to the specified Private DNS zone.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
29
+ # terminating dot).
30
+ # @param virtual_network_link_name [String] The name of the virtual network
31
+ # link.
32
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the
33
+ # CreateOrUpdate operation.
34
+ # @param if_match [String] The ETag of the virtual network link to the Private
35
+ # DNS zone. Omit this value to always overwrite the current virtual network
36
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
37
+ # any concurrent changes.
38
+ # @param if_none_match [String] Set to '*' to allow a new virtual network link
39
+ # to the Private DNS zone to be created, but to prevent updating an existing
40
+ # link. Other values will be ignored.
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ # @return [VirtualNetworkLink] operation results.
45
+ #
46
+ def create_or_update(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
47
+ response = create_or_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
48
+ response.body unless response.nil?
49
+ end
50
+
51
+ #
52
+ # @param resource_group_name [String] The name of the resource group.
53
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
54
+ # terminating dot).
55
+ # @param virtual_network_link_name [String] The name of the virtual network
56
+ # link.
57
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the
58
+ # CreateOrUpdate operation.
59
+ # @param if_match [String] The ETag of the virtual network link to the Private
60
+ # DNS zone. Omit this value to always overwrite the current virtual network
61
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
62
+ # any concurrent changes.
63
+ # @param if_none_match [String] Set to '*' to allow a new virtual network link
64
+ # to the Private DNS zone to be created, but to prevent updating an existing
65
+ # link. Other values will be ignored.
66
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
67
+ # will be added to the HTTP request.
68
+ #
69
+ # @return [Concurrent::Promise] promise which provides async access to http
70
+ # response.
71
+ #
72
+ def create_or_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
73
+ # Send request
74
+ promise = begin_create_or_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers)
75
+
76
+ promise = promise.then do |response|
77
+ # Defining deserialization method.
78
+ deserialize_method = lambda do |parsed_response|
79
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
80
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
81
+ end
82
+
83
+ # Waiting for response.
84
+ @client.get_long_running_operation_result(response, deserialize_method)
85
+ end
86
+
87
+ promise
88
+ end
89
+
90
+ #
91
+ # Updates a virtual network link to the specified Private DNS zone.
92
+ #
93
+ # @param resource_group_name [String] The name of the resource group.
94
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
95
+ # terminating dot).
96
+ # @param virtual_network_link_name [String] The name of the virtual network
97
+ # link.
98
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the Update
99
+ # operation.
100
+ # @param if_match [String] The ETag of the virtual network link to the Private
101
+ # DNS zone. Omit this value to always overwrite the current virtual network
102
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
103
+ # any concurrent changes.
104
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
105
+ # will be added to the HTTP request.
106
+ #
107
+ # @return [VirtualNetworkLink] operation results.
108
+ #
109
+ def update(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, custom_headers:nil)
110
+ response = update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
111
+ response.body unless response.nil?
112
+ end
113
+
114
+ #
115
+ # @param resource_group_name [String] The name of the resource group.
116
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
117
+ # terminating dot).
118
+ # @param virtual_network_link_name [String] The name of the virtual network
119
+ # link.
120
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the Update
121
+ # operation.
122
+ # @param if_match [String] The ETag of the virtual network link to the Private
123
+ # DNS zone. Omit this value to always overwrite the current virtual network
124
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
125
+ # any concurrent changes.
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [Concurrent::Promise] promise which provides async access to http
130
+ # response.
131
+ #
132
+ def update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, custom_headers:nil)
133
+ # Send request
134
+ promise = begin_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, custom_headers:custom_headers)
135
+
136
+ promise = promise.then do |response|
137
+ # Defining deserialization method.
138
+ deserialize_method = lambda do |parsed_response|
139
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
140
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
141
+ end
142
+
143
+ # Waiting for response.
144
+ @client.get_long_running_operation_result(response, deserialize_method)
145
+ end
146
+
147
+ promise
148
+ end
149
+
150
+ #
151
+ # Deletes a virtual network link to the specified Private DNS zone. WARNING: In
152
+ # case of a registration virtual network, all auto-registered DNS records in
153
+ # the zone for the virtual network will also be deleted. This operation cannot
154
+ # be undone.
155
+ #
156
+ # @param resource_group_name [String] The name of the resource group.
157
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
158
+ # terminating dot).
159
+ # @param virtual_network_link_name [String] The name of the virtual network
160
+ # link.
161
+ # @param if_match [String] The ETag of the virtual network link to the Private
162
+ # DNS zone. Omit this value to always delete the current zone. Specify the
163
+ # last-seen ETag value to prevent accidentally deleting any concurrent changes.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ def delete(resource_group_name, private_zone_name, virtual_network_link_name, if_match:nil, custom_headers:nil)
168
+ response = delete_async(resource_group_name, private_zone_name, virtual_network_link_name, if_match:if_match, custom_headers:custom_headers).value!
169
+ nil
170
+ end
171
+
172
+ #
173
+ # @param resource_group_name [String] The name of the resource group.
174
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
175
+ # terminating dot).
176
+ # @param virtual_network_link_name [String] The name of the virtual network
177
+ # link.
178
+ # @param if_match [String] The ETag of the virtual network link to the Private
179
+ # DNS zone. Omit this value to always delete the current zone. Specify the
180
+ # last-seen ETag value to prevent accidentally deleting any concurrent changes.
181
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
182
+ # will be added to the HTTP request.
183
+ #
184
+ # @return [Concurrent::Promise] promise which provides async access to http
185
+ # response.
186
+ #
187
+ def delete_async(resource_group_name, private_zone_name, virtual_network_link_name, if_match:nil, custom_headers:nil)
188
+ # Send request
189
+ promise = begin_delete_async(resource_group_name, private_zone_name, virtual_network_link_name, if_match:if_match, custom_headers:custom_headers)
190
+
191
+ promise = promise.then do |response|
192
+ # Defining deserialization method.
193
+ deserialize_method = lambda do |parsed_response|
194
+ end
195
+
196
+ # Waiting for response.
197
+ @client.get_long_running_operation_result(response, deserialize_method)
198
+ end
199
+
200
+ promise
201
+ end
202
+
203
+ #
204
+ # Gets a virtual network link to the specified Private DNS zone.
205
+ #
206
+ # @param resource_group_name [String] The name of the resource group.
207
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
208
+ # terminating dot).
209
+ # @param virtual_network_link_name [String] The name of the virtual network
210
+ # link.
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
213
+ #
214
+ # @return [VirtualNetworkLink] operation results.
215
+ #
216
+ def get(resource_group_name, private_zone_name, virtual_network_link_name, custom_headers:nil)
217
+ response = get_async(resource_group_name, private_zone_name, virtual_network_link_name, custom_headers:custom_headers).value!
218
+ response.body unless response.nil?
219
+ end
220
+
221
+ #
222
+ # Gets a virtual network link to the specified Private DNS zone.
223
+ #
224
+ # @param resource_group_name [String] The name of the resource group.
225
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
226
+ # terminating dot).
227
+ # @param virtual_network_link_name [String] The name of the virtual network
228
+ # link.
229
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
230
+ # will be added to the HTTP request.
231
+ #
232
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
233
+ #
234
+ def get_with_http_info(resource_group_name, private_zone_name, virtual_network_link_name, custom_headers:nil)
235
+ get_async(resource_group_name, private_zone_name, virtual_network_link_name, custom_headers:custom_headers).value!
236
+ end
237
+
238
+ #
239
+ # Gets a virtual network link to the specified Private DNS zone.
240
+ #
241
+ # @param resource_group_name [String] The name of the resource group.
242
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
243
+ # terminating dot).
244
+ # @param virtual_network_link_name [String] The name of the virtual network
245
+ # link.
246
+ # @param [Hash{String => String}] A hash of custom headers that will be added
247
+ # to the HTTP request.
248
+ #
249
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
250
+ #
251
+ def get_async(resource_group_name, private_zone_name, virtual_network_link_name, custom_headers:nil)
252
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
253
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
254
+ fail ArgumentError, 'virtual_network_link_name is nil' if virtual_network_link_name.nil?
255
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
256
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
257
+
258
+
259
+ request_headers = {}
260
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
261
+
262
+ # Set Headers
263
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
264
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
265
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}'
266
+
267
+ request_url = @base_url || @client.base_url
268
+
269
+ options = {
270
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
271
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'virtualNetworkLinkName' => virtual_network_link_name,'subscriptionId' => @client.subscription_id},
272
+ query_params: {'api-version' => @client.api_version},
273
+ headers: request_headers.merge(custom_headers || {}),
274
+ base_url: request_url
275
+ }
276
+ promise = @client.make_request_async(:get, path_template, options)
277
+
278
+ promise = promise.then do |result|
279
+ http_response = result.response
280
+ status_code = http_response.status
281
+ response_content = http_response.body
282
+ unless status_code == 200
283
+ error_model = JSON.load(response_content)
284
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
285
+ end
286
+
287
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
288
+ # Deserialize Response
289
+ if status_code == 200
290
+ begin
291
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
292
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
293
+ result.body = @client.deserialize(result_mapper, parsed_response)
294
+ rescue Exception => e
295
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
296
+ end
297
+ end
298
+
299
+ result
300
+ end
301
+
302
+ promise.execute
303
+ end
304
+
305
+ #
306
+ # Lists the virtual network links to the specified Private DNS zone.
307
+ #
308
+ # @param resource_group_name [String] The name of the resource group.
309
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
310
+ # terminating dot).
311
+ # @param top [Integer] The maximum number of virtual network links to return.
312
+ # If not specified, returns up to 100 virtual network links.
313
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
314
+ # will be added to the HTTP request.
315
+ #
316
+ # @return [Array<VirtualNetworkLink>] operation results.
317
+ #
318
+ def list(resource_group_name, private_zone_name, top:nil, custom_headers:nil)
319
+ first_page = list_as_lazy(resource_group_name, private_zone_name, top:top, custom_headers:custom_headers)
320
+ first_page.get_all_items
321
+ end
322
+
323
+ #
324
+ # Lists the virtual network links to the specified Private DNS zone.
325
+ #
326
+ # @param resource_group_name [String] The name of the resource group.
327
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
328
+ # terminating dot).
329
+ # @param top [Integer] The maximum number of virtual network links to return.
330
+ # If not specified, returns up to 100 virtual network links.
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
335
+ #
336
+ def list_with_http_info(resource_group_name, private_zone_name, top:nil, custom_headers:nil)
337
+ list_async(resource_group_name, private_zone_name, top:top, custom_headers:custom_headers).value!
338
+ end
339
+
340
+ #
341
+ # Lists the virtual network links to the specified Private DNS zone.
342
+ #
343
+ # @param resource_group_name [String] The name of the resource group.
344
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
345
+ # terminating dot).
346
+ # @param top [Integer] The maximum number of virtual network links to return.
347
+ # If not specified, returns up to 100 virtual network links.
348
+ # @param [Hash{String => String}] A hash of custom headers that will be added
349
+ # to the HTTP request.
350
+ #
351
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
352
+ #
353
+ def list_async(resource_group_name, private_zone_name, top:nil, custom_headers:nil)
354
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
355
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
356
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
357
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
358
+
359
+
360
+ request_headers = {}
361
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
362
+
363
+ # Set Headers
364
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
365
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
366
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks'
367
+
368
+ request_url = @base_url || @client.base_url
369
+
370
+ options = {
371
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
372
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'subscriptionId' => @client.subscription_id},
373
+ query_params: {'$top' => top,'api-version' => @client.api_version},
374
+ headers: request_headers.merge(custom_headers || {}),
375
+ base_url: request_url
376
+ }
377
+ promise = @client.make_request_async(:get, path_template, options)
378
+
379
+ promise = promise.then do |result|
380
+ http_response = result.response
381
+ status_code = http_response.status
382
+ response_content = http_response.body
383
+ unless status_code == 200
384
+ error_model = JSON.load(response_content)
385
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
386
+ end
387
+
388
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
389
+ # Deserialize Response
390
+ if status_code == 200
391
+ begin
392
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
393
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLinkListResult.mapper()
394
+ result.body = @client.deserialize(result_mapper, parsed_response)
395
+ rescue Exception => e
396
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
397
+ end
398
+ end
399
+
400
+ result
401
+ end
402
+
403
+ promise.execute
404
+ end
405
+
406
+ #
407
+ # Creates or updates a virtual network link to the specified Private DNS zone.
408
+ #
409
+ # @param resource_group_name [String] The name of the resource group.
410
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
411
+ # terminating dot).
412
+ # @param virtual_network_link_name [String] The name of the virtual network
413
+ # link.
414
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the
415
+ # CreateOrUpdate operation.
416
+ # @param if_match [String] The ETag of the virtual network link to the Private
417
+ # DNS zone. Omit this value to always overwrite the current virtual network
418
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
419
+ # any concurrent changes.
420
+ # @param if_none_match [String] Set to '*' to allow a new virtual network link
421
+ # to the Private DNS zone to be created, but to prevent updating an existing
422
+ # link. Other values will be ignored.
423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
424
+ # will be added to the HTTP request.
425
+ #
426
+ # @return [VirtualNetworkLink] operation results.
427
+ #
428
+ def begin_create_or_update(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
429
+ response = begin_create_or_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
430
+ response.body unless response.nil?
431
+ end
432
+
433
+ #
434
+ # Creates or updates a virtual network link to the specified Private DNS zone.
435
+ #
436
+ # @param resource_group_name [String] The name of the resource group.
437
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
438
+ # terminating dot).
439
+ # @param virtual_network_link_name [String] The name of the virtual network
440
+ # link.
441
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the
442
+ # CreateOrUpdate operation.
443
+ # @param if_match [String] The ETag of the virtual network link to the Private
444
+ # DNS zone. Omit this value to always overwrite the current virtual network
445
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
446
+ # any concurrent changes.
447
+ # @param if_none_match [String] Set to '*' to allow a new virtual network link
448
+ # to the Private DNS zone to be created, but to prevent updating an existing
449
+ # link. Other values will be ignored.
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
454
+ #
455
+ def begin_create_or_update_with_http_info(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
456
+ begin_create_or_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
457
+ end
458
+
459
+ #
460
+ # Creates or updates a virtual network link to the specified Private DNS zone.
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group.
463
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
464
+ # terminating dot).
465
+ # @param virtual_network_link_name [String] The name of the virtual network
466
+ # link.
467
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the
468
+ # CreateOrUpdate operation.
469
+ # @param if_match [String] The ETag of the virtual network link to the Private
470
+ # DNS zone. Omit this value to always overwrite the current virtual network
471
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
472
+ # any concurrent changes.
473
+ # @param if_none_match [String] Set to '*' to allow a new virtual network link
474
+ # to the Private DNS zone to be created, but to prevent updating an existing
475
+ # link. Other values will be ignored.
476
+ # @param [Hash{String => String}] A hash of custom headers that will be added
477
+ # to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
480
+ #
481
+ def begin_create_or_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
482
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
483
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
484
+ fail ArgumentError, 'virtual_network_link_name is nil' if virtual_network_link_name.nil?
485
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
486
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
487
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
488
+
489
+
490
+ request_headers = {}
491
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
492
+
493
+ # Set Headers
494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
+ request_headers['If-Match'] = if_match unless if_match.nil?
496
+ request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
497
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
498
+
499
+ # Serialize Request
500
+ request_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
501
+ request_content = @client.serialize(request_mapper, parameters)
502
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
503
+
504
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}'
505
+
506
+ request_url = @base_url || @client.base_url
507
+
508
+ options = {
509
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
510
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'virtualNetworkLinkName' => virtual_network_link_name,'subscriptionId' => @client.subscription_id},
511
+ query_params: {'api-version' => @client.api_version},
512
+ body: request_content,
513
+ headers: request_headers.merge(custom_headers || {}),
514
+ base_url: request_url
515
+ }
516
+ promise = @client.make_request_async(:put, path_template, options)
517
+
518
+ promise = promise.then do |result|
519
+ http_response = result.response
520
+ status_code = http_response.status
521
+ response_content = http_response.body
522
+ unless status_code == 201 || status_code == 200 || status_code == 202
523
+ error_model = JSON.load(response_content)
524
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
525
+ end
526
+
527
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
528
+ # Deserialize Response
529
+ if status_code == 201
530
+ begin
531
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
532
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
533
+ result.body = @client.deserialize(result_mapper, parsed_response)
534
+ rescue Exception => e
535
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
536
+ end
537
+ end
538
+ # Deserialize Response
539
+ if status_code == 200
540
+ begin
541
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
542
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
543
+ result.body = @client.deserialize(result_mapper, parsed_response)
544
+ rescue Exception => e
545
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
546
+ end
547
+ end
548
+
549
+ result
550
+ end
551
+
552
+ promise.execute
553
+ end
554
+
555
+ #
556
+ # Updates a virtual network link to the specified Private DNS zone.
557
+ #
558
+ # @param resource_group_name [String] The name of the resource group.
559
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
560
+ # terminating dot).
561
+ # @param virtual_network_link_name [String] The name of the virtual network
562
+ # link.
563
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the Update
564
+ # operation.
565
+ # @param if_match [String] The ETag of the virtual network link to the Private
566
+ # DNS zone. Omit this value to always overwrite the current virtual network
567
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
568
+ # any concurrent changes.
569
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
570
+ # will be added to the HTTP request.
571
+ #
572
+ # @return [VirtualNetworkLink] operation results.
573
+ #
574
+ def begin_update(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, custom_headers:nil)
575
+ response = begin_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
576
+ response.body unless response.nil?
577
+ end
578
+
579
+ #
580
+ # Updates a virtual network link to the specified Private DNS zone.
581
+ #
582
+ # @param resource_group_name [String] The name of the resource group.
583
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
584
+ # terminating dot).
585
+ # @param virtual_network_link_name [String] The name of the virtual network
586
+ # link.
587
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the Update
588
+ # operation.
589
+ # @param if_match [String] The ETag of the virtual network link to the Private
590
+ # DNS zone. Omit this value to always overwrite the current virtual network
591
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
592
+ # any concurrent changes.
593
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
594
+ # will be added to the HTTP request.
595
+ #
596
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
597
+ #
598
+ def begin_update_with_http_info(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, custom_headers:nil)
599
+ begin_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
600
+ end
601
+
602
+ #
603
+ # Updates a virtual network link to the specified Private DNS zone.
604
+ #
605
+ # @param resource_group_name [String] The name of the resource group.
606
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
607
+ # terminating dot).
608
+ # @param virtual_network_link_name [String] The name of the virtual network
609
+ # link.
610
+ # @param parameters [VirtualNetworkLink] Parameters supplied to the Update
611
+ # operation.
612
+ # @param if_match [String] The ETag of the virtual network link to the Private
613
+ # DNS zone. Omit this value to always overwrite the current virtual network
614
+ # link. Specify the last-seen ETag value to prevent accidentally overwriting
615
+ # any concurrent changes.
616
+ # @param [Hash{String => String}] A hash of custom headers that will be added
617
+ # to the HTTP request.
618
+ #
619
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
620
+ #
621
+ def begin_update_async(resource_group_name, private_zone_name, virtual_network_link_name, parameters, if_match:nil, custom_headers:nil)
622
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
623
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
624
+ fail ArgumentError, 'virtual_network_link_name is nil' if virtual_network_link_name.nil?
625
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
626
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
627
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
628
+
629
+
630
+ request_headers = {}
631
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
632
+
633
+ # Set Headers
634
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
635
+ request_headers['If-Match'] = if_match unless if_match.nil?
636
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
637
+
638
+ # Serialize Request
639
+ request_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
640
+ request_content = @client.serialize(request_mapper, parameters)
641
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
642
+
643
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}'
644
+
645
+ request_url = @base_url || @client.base_url
646
+
647
+ options = {
648
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
649
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'virtualNetworkLinkName' => virtual_network_link_name,'subscriptionId' => @client.subscription_id},
650
+ query_params: {'api-version' => @client.api_version},
651
+ body: request_content,
652
+ headers: request_headers.merge(custom_headers || {}),
653
+ base_url: request_url
654
+ }
655
+ promise = @client.make_request_async(:patch, path_template, options)
656
+
657
+ promise = promise.then do |result|
658
+ http_response = result.response
659
+ status_code = http_response.status
660
+ response_content = http_response.body
661
+ unless status_code == 200 || status_code == 202
662
+ error_model = JSON.load(response_content)
663
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
664
+ end
665
+
666
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
667
+ # Deserialize Response
668
+ if status_code == 200
669
+ begin
670
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
671
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLink.mapper()
672
+ result.body = @client.deserialize(result_mapper, parsed_response)
673
+ rescue Exception => e
674
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
675
+ end
676
+ end
677
+
678
+ result
679
+ end
680
+
681
+ promise.execute
682
+ end
683
+
684
+ #
685
+ # Deletes a virtual network link to the specified Private DNS zone. WARNING: In
686
+ # case of a registration virtual network, all auto-registered DNS records in
687
+ # the zone for the virtual network will also be deleted. This operation cannot
688
+ # be undone.
689
+ #
690
+ # @param resource_group_name [String] The name of the resource group.
691
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
692
+ # terminating dot).
693
+ # @param virtual_network_link_name [String] The name of the virtual network
694
+ # link.
695
+ # @param if_match [String] The ETag of the virtual network link to the Private
696
+ # DNS zone. Omit this value to always delete the current zone. Specify the
697
+ # last-seen ETag value to prevent accidentally deleting any concurrent changes.
698
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
699
+ # will be added to the HTTP request.
700
+ #
701
+ #
702
+ def begin_delete(resource_group_name, private_zone_name, virtual_network_link_name, if_match:nil, custom_headers:nil)
703
+ response = begin_delete_async(resource_group_name, private_zone_name, virtual_network_link_name, if_match:if_match, custom_headers:custom_headers).value!
704
+ nil
705
+ end
706
+
707
+ #
708
+ # Deletes a virtual network link to the specified Private DNS zone. WARNING: In
709
+ # case of a registration virtual network, all auto-registered DNS records in
710
+ # the zone for the virtual network will also be deleted. This operation cannot
711
+ # be undone.
712
+ #
713
+ # @param resource_group_name [String] The name of the resource group.
714
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
715
+ # terminating dot).
716
+ # @param virtual_network_link_name [String] The name of the virtual network
717
+ # link.
718
+ # @param if_match [String] The ETag of the virtual network link to the Private
719
+ # DNS zone. Omit this value to always delete the current zone. Specify the
720
+ # last-seen ETag value to prevent accidentally deleting any concurrent changes.
721
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
722
+ # will be added to the HTTP request.
723
+ #
724
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
725
+ #
726
+ def begin_delete_with_http_info(resource_group_name, private_zone_name, virtual_network_link_name, if_match:nil, custom_headers:nil)
727
+ begin_delete_async(resource_group_name, private_zone_name, virtual_network_link_name, if_match:if_match, custom_headers:custom_headers).value!
728
+ end
729
+
730
+ #
731
+ # Deletes a virtual network link to the specified Private DNS zone. WARNING: In
732
+ # case of a registration virtual network, all auto-registered DNS records in
733
+ # the zone for the virtual network will also be deleted. This operation cannot
734
+ # be undone.
735
+ #
736
+ # @param resource_group_name [String] The name of the resource group.
737
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
738
+ # terminating dot).
739
+ # @param virtual_network_link_name [String] The name of the virtual network
740
+ # link.
741
+ # @param if_match [String] The ETag of the virtual network link to the Private
742
+ # DNS zone. Omit this value to always delete the current zone. Specify the
743
+ # last-seen ETag value to prevent accidentally deleting any concurrent changes.
744
+ # @param [Hash{String => String}] A hash of custom headers that will be added
745
+ # to the HTTP request.
746
+ #
747
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
748
+ #
749
+ def begin_delete_async(resource_group_name, private_zone_name, virtual_network_link_name, if_match:nil, custom_headers:nil)
750
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
751
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
752
+ fail ArgumentError, 'virtual_network_link_name is nil' if virtual_network_link_name.nil?
753
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
754
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
755
+
756
+
757
+ request_headers = {}
758
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
759
+
760
+ # Set Headers
761
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
762
+ request_headers['If-Match'] = if_match unless if_match.nil?
763
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
764
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/virtualNetworkLinks/{virtualNetworkLinkName}'
765
+
766
+ request_url = @base_url || @client.base_url
767
+
768
+ options = {
769
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
770
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'virtualNetworkLinkName' => virtual_network_link_name,'subscriptionId' => @client.subscription_id},
771
+ query_params: {'api-version' => @client.api_version},
772
+ headers: request_headers.merge(custom_headers || {}),
773
+ base_url: request_url
774
+ }
775
+ promise = @client.make_request_async(:delete, path_template, options)
776
+
777
+ promise = promise.then do |result|
778
+ http_response = result.response
779
+ status_code = http_response.status
780
+ response_content = http_response.body
781
+ unless status_code == 200 || status_code == 202 || status_code == 204
782
+ error_model = JSON.load(response_content)
783
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
784
+ end
785
+
786
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
787
+
788
+ result
789
+ end
790
+
791
+ promise.execute
792
+ end
793
+
794
+ #
795
+ # Lists the virtual network links to the specified Private DNS zone.
796
+ #
797
+ # @param next_page_link [String] The NextLink from the previous successful call
798
+ # to List operation.
799
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
800
+ # will be added to the HTTP request.
801
+ #
802
+ # @return [VirtualNetworkLinkListResult] operation results.
803
+ #
804
+ def list_next(next_page_link, custom_headers:nil)
805
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
806
+ response.body unless response.nil?
807
+ end
808
+
809
+ #
810
+ # Lists the virtual network links to the specified Private DNS zone.
811
+ #
812
+ # @param next_page_link [String] The NextLink from the previous successful call
813
+ # to List operation.
814
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
815
+ # will be added to the HTTP request.
816
+ #
817
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
818
+ #
819
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
820
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
821
+ end
822
+
823
+ #
824
+ # Lists the virtual network links to the specified Private DNS zone.
825
+ #
826
+ # @param next_page_link [String] The NextLink from the previous successful call
827
+ # to List operation.
828
+ # @param [Hash{String => String}] A hash of custom headers that will be added
829
+ # to the HTTP request.
830
+ #
831
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
832
+ #
833
+ def list_next_async(next_page_link, custom_headers:nil)
834
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
835
+
836
+
837
+ request_headers = {}
838
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
839
+
840
+ # Set Headers
841
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
842
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
843
+ path_template = '{nextLink}'
844
+
845
+ request_url = @base_url || @client.base_url
846
+
847
+ options = {
848
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
849
+ skip_encoding_path_params: {'nextLink' => next_page_link},
850
+ headers: request_headers.merge(custom_headers || {}),
851
+ base_url: request_url
852
+ }
853
+ promise = @client.make_request_async(:get, path_template, options)
854
+
855
+ promise = promise.then do |result|
856
+ http_response = result.response
857
+ status_code = http_response.status
858
+ response_content = http_response.body
859
+ unless status_code == 200
860
+ error_model = JSON.load(response_content)
861
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
862
+ end
863
+
864
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
865
+ # Deserialize Response
866
+ if status_code == 200
867
+ begin
868
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
869
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::VirtualNetworkLinkListResult.mapper()
870
+ result.body = @client.deserialize(result_mapper, parsed_response)
871
+ rescue Exception => e
872
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
873
+ end
874
+ end
875
+
876
+ result
877
+ end
878
+
879
+ promise.execute
880
+ end
881
+
882
+ #
883
+ # Lists the virtual network links to the specified Private DNS zone.
884
+ #
885
+ # @param resource_group_name [String] The name of the resource group.
886
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
887
+ # terminating dot).
888
+ # @param top [Integer] The maximum number of virtual network links to return.
889
+ # If not specified, returns up to 100 virtual network links.
890
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
891
+ # will be added to the HTTP request.
892
+ #
893
+ # @return [VirtualNetworkLinkListResult] which provide lazy access to pages of
894
+ # the response.
895
+ #
896
+ def list_as_lazy(resource_group_name, private_zone_name, top:nil, custom_headers:nil)
897
+ response = list_async(resource_group_name, private_zone_name, top:top, custom_headers:custom_headers).value!
898
+ unless response.nil?
899
+ page = response.body
900
+ page.next_method = Proc.new do |next_page_link|
901
+ list_next_async(next_page_link, custom_headers:custom_headers)
902
+ end
903
+ page
904
+ end
905
+ end
906
+
907
+ end
908
+ end