azure_mgmt_recovery_services 0.17.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-06-01/generated/azure_mgmt_recovery_services.rb +28 -13
  3. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/check_name_availability_parameters.rb +60 -0
  4. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/check_name_availability_result.rb +69 -0
  5. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/client_discovery_response.rb +2 -2
  6. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/identity_data.rb +71 -0
  7. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint.rb +48 -0
  8. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint_connection.rb +73 -0
  9. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint_connection_status.rb +18 -0
  10. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint_connection_vault_properties.rb +61 -0
  11. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_link_resource.rb +127 -0
  12. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_link_resources.rb +99 -0
  13. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_link_service_connection_state.rb +73 -0
  14. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/provisioning_state.rb +18 -0
  15. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/resource.rb +9 -0
  16. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/resource_certificate_details.rb +1 -1
  17. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/resource_identity_type.rb +16 -0
  18. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/upgrade_details.rb +2 -2
  19. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault.rb +12 -0
  20. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_list.rb +1 -1
  21. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_private_endpoint_state.rb +16 -0
  22. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_properties.rb +48 -0
  23. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/operations.rb +4 -0
  24. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/private_link_resources_operations.rb +346 -0
  25. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/recovery_services.rb +148 -0
  26. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/recovery_services_client.rb +10 -1
  27. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/registered_identities.rb +2 -0
  28. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/replication_usages.rb +2 -0
  29. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/usages.rb +2 -0
  30. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vault_certificates.rb +2 -0
  31. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb +6 -0
  32. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vaults.rb +16 -0
  33. data/lib/profiles/latest/modules/recoveryservices_profile_module.rb +98 -42
  34. data/lib/version.rb +1 -1
  35. metadata +20 -5
@@ -30,7 +30,7 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
30
30
  def get_all_items
31
31
  items = @value
32
32
  page = self
33
- while page.next_link != nil do
33
+ while page.next_link != nil && !page.next_link.strip.empty? do
34
34
  page = page.get_next_page
35
35
  items.concat(page.value)
36
36
  end
@@ -0,0 +1,16 @@
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::RecoveryServices::Mgmt::V2016_06_01
7
+ module Models
8
+ #
9
+ # Defines values for VaultPrivateEndpointState
10
+ #
11
+ module VaultPrivateEndpointState
12
+ None = "None"
13
+ Enabled = "Enabled"
14
+ end
15
+ end
16
+ end
@@ -18,6 +18,18 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
18
18
  # @return [UpgradeDetails]
19
19
  attr_accessor :upgrade_details
20
20
 
21
+ # @return [Array<PrivateEndpointConnectionVaultProperties>] List of
22
+ # private endpoint connection.
23
+ attr_accessor :private_endpoint_connections
24
+
25
+ # @return [VaultPrivateEndpointState] Private endpoint state for backup.
26
+ # Possible values include: 'None', 'Enabled'
27
+ attr_accessor :private_endpoint_state_for_backup
28
+
29
+ # @return [VaultPrivateEndpointState] Private endpoint state for site
30
+ # recovery. Possible values include: 'None', 'Enabled'
31
+ attr_accessor :private_endpoint_state_for_site_recovery
32
+
21
33
 
22
34
  #
23
35
  # Mapper for VaultProperties class as Ruby Hash.
@@ -49,6 +61,42 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
49
61
  name: 'Composite',
50
62
  class_name: 'UpgradeDetails'
51
63
  }
64
+ },
65
+ private_endpoint_connections: {
66
+ client_side_validation: true,
67
+ required: false,
68
+ read_only: true,
69
+ serialized_name: 'privateEndpointConnections',
70
+ type: {
71
+ name: 'Sequence',
72
+ element: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'PrivateEndpointConnectionVaultPropertiesElementType',
76
+ type: {
77
+ name: 'Composite',
78
+ class_name: 'PrivateEndpointConnectionVaultProperties'
79
+ }
80
+ }
81
+ }
82
+ },
83
+ private_endpoint_state_for_backup: {
84
+ client_side_validation: true,
85
+ required: false,
86
+ read_only: true,
87
+ serialized_name: 'privateEndpointStateForBackup',
88
+ type: {
89
+ name: 'String'
90
+ }
91
+ },
92
+ private_endpoint_state_for_site_recovery: {
93
+ client_side_validation: true,
94
+ required: false,
95
+ read_only: true,
96
+ serialized_name: 'privateEndpointStateForSiteRecovery',
97
+ type: {
98
+ name: 'String'
99
+ }
52
100
  }
53
101
  }
54
102
  }
@@ -86,6 +86,8 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
86
86
  end
87
87
 
88
88
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
89
91
  # Deserialize Response
90
92
  if status_code == 200
91
93
  begin
@@ -174,6 +176,8 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
174
176
  end
175
177
 
176
178
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
179
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
180
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
177
181
  # Deserialize Response
178
182
  if status_code == 200
179
183
  begin
@@ -0,0 +1,346 @@
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::RecoveryServices::Mgmt::V2016_06_01
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class PrivateLinkResourcesOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkResourcesOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Returns the list of private link resources that need to be created for Backup
26
+ # and SiteRecovery
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group where the
29
+ # recovery services vault is present.
30
+ # @param vault_name [String] The name of the recovery services vault.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<PrivateLinkResource>] operation results.
35
+ #
36
+ def list(resource_group_name, vault_name, custom_headers:nil)
37
+ first_page = list_as_lazy(resource_group_name, vault_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Returns the list of private link resources that need to be created for Backup
43
+ # and SiteRecovery
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group where the
46
+ # recovery services vault is present.
47
+ # @param vault_name [String] The name of the recovery services vault.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_with_http_info(resource_group_name, vault_name, custom_headers:nil)
54
+ list_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Returns the list of private link resources that need to be created for Backup
59
+ # and SiteRecovery
60
+ #
61
+ # @param resource_group_name [String] The name of the resource group where the
62
+ # recovery services vault is present.
63
+ # @param vault_name [String] The name of the recovery services vault.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_async(resource_group_name, vault_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::RecoveryServices::Mgmt::V2016_06_01::Models::PrivateLinkResources.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Returns a specified private link resource that need to be created for Backup
126
+ # and SiteRecovery
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group where the
129
+ # recovery services vault is present.
130
+ # @param vault_name [String] The name of the recovery services vault.
131
+ # @param private_link_resource_name [String]
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [PrivateLinkResource] operation results.
136
+ #
137
+ def get(resource_group_name, vault_name, private_link_resource_name, custom_headers:nil)
138
+ response = get_async(resource_group_name, vault_name, private_link_resource_name, custom_headers:custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # Returns a specified private link resource that need to be created for Backup
144
+ # and SiteRecovery
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group where the
147
+ # recovery services vault is present.
148
+ # @param vault_name [String] The name of the recovery services vault.
149
+ # @param private_link_resource_name [String]
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def get_with_http_info(resource_group_name, vault_name, private_link_resource_name, custom_headers:nil)
156
+ get_async(resource_group_name, vault_name, private_link_resource_name, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Returns a specified private link resource that need to be created for Backup
161
+ # and SiteRecovery
162
+ #
163
+ # @param resource_group_name [String] The name of the resource group where the
164
+ # recovery services vault is present.
165
+ # @param vault_name [String] The name of the recovery services vault.
166
+ # @param private_link_resource_name [String]
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def get_async(resource_group_name, vault_name, private_link_resource_name, custom_headers:nil)
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
175
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
176
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
177
+ fail ArgumentError, 'private_link_resource_name is nil' if private_link_resource_name.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'privateLinkResourceName' => private_link_resource_name},
193
+ query_params: {'api-version' => @client.api_version},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
210
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
211
+ # Deserialize Response
212
+ if status_code == 200
213
+ begin
214
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
215
+ result_mapper = Azure::RecoveryServices::Mgmt::V2016_06_01::Models::PrivateLinkResource.mapper()
216
+ result.body = @client.deserialize(result_mapper, parsed_response)
217
+ rescue Exception => e
218
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
219
+ end
220
+ end
221
+
222
+ result
223
+ end
224
+
225
+ promise.execute
226
+ end
227
+
228
+ #
229
+ # Returns the list of private link resources that need to be created for Backup
230
+ # and SiteRecovery
231
+ #
232
+ # @param next_page_link [String] The NextLink from the previous successful call
233
+ # to List operation.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [PrivateLinkResources] operation results.
238
+ #
239
+ def list_next(next_page_link, custom_headers:nil)
240
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
241
+ response.body unless response.nil?
242
+ end
243
+
244
+ #
245
+ # Returns the list of private link resources that need to be created for Backup
246
+ # and SiteRecovery
247
+ #
248
+ # @param next_page_link [String] The NextLink from the previous successful call
249
+ # to List operation.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
254
+ #
255
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
256
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
257
+ end
258
+
259
+ #
260
+ # Returns the list of private link resources that need to be created for Backup
261
+ # and SiteRecovery
262
+ #
263
+ # @param next_page_link [String] The NextLink from the previous successful call
264
+ # to List operation.
265
+ # @param [Hash{String => String}] A hash of custom headers that will be added
266
+ # to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
269
+ #
270
+ def list_next_async(next_page_link, custom_headers:nil)
271
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
272
+
273
+
274
+ request_headers = {}
275
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
276
+
277
+ # Set Headers
278
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
279
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
280
+ path_template = '{nextLink}'
281
+
282
+ request_url = @base_url || @client.base_url
283
+
284
+ options = {
285
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
286
+ skip_encoding_path_params: {'nextLink' => next_page_link},
287
+ headers: request_headers.merge(custom_headers || {}),
288
+ base_url: request_url
289
+ }
290
+ promise = @client.make_request_async(:get, path_template, options)
291
+
292
+ promise = promise.then do |result|
293
+ http_response = result.response
294
+ status_code = http_response.status
295
+ response_content = http_response.body
296
+ unless status_code == 200
297
+ error_model = JSON.load(response_content)
298
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
299
+ end
300
+
301
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
302
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
303
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
304
+ # Deserialize Response
305
+ if status_code == 200
306
+ begin
307
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
308
+ result_mapper = Azure::RecoveryServices::Mgmt::V2016_06_01::Models::PrivateLinkResources.mapper()
309
+ result.body = @client.deserialize(result_mapper, parsed_response)
310
+ rescue Exception => e
311
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
312
+ end
313
+ end
314
+
315
+ result
316
+ end
317
+
318
+ promise.execute
319
+ end
320
+
321
+ #
322
+ # Returns the list of private link resources that need to be created for Backup
323
+ # and SiteRecovery
324
+ #
325
+ # @param resource_group_name [String] The name of the resource group where the
326
+ # recovery services vault is present.
327
+ # @param vault_name [String] The name of the recovery services vault.
328
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
329
+ # will be added to the HTTP request.
330
+ #
331
+ # @return [PrivateLinkResources] which provide lazy access to pages of the
332
+ # response.
333
+ #
334
+ def list_as_lazy(resource_group_name, vault_name, custom_headers:nil)
335
+ response = list_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
336
+ unless response.nil?
337
+ page = response.body
338
+ page.next_method = Proc.new do |next_page_link|
339
+ list_next_async(next_page_link, custom_headers:custom_headers)
340
+ end
341
+ page
342
+ end
343
+ end
344
+
345
+ end
346
+ end