azure_mgmt_hanaonazure 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 (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure.rb +47 -0
  4. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/hana_instances.rb +942 -0
  5. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/hana_management_client.rb +137 -0
  6. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/disk.rb +72 -0
  7. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/display.rb +108 -0
  8. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/error_response.rb +57 -0
  9. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_hardware_type_names_enum.rb +16 -0
  10. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instance.rb +190 -0
  11. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instance_power_state_enum.rb +20 -0
  12. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instance_size_names_enum.rb +32 -0
  13. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instances_list_result.rb +98 -0
  14. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hardware_profile.rb +63 -0
  15. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/ip_address.rb +47 -0
  16. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/monitoring_details.rb +104 -0
  17. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/network_profile.rb +69 -0
  18. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/operation.rb +61 -0
  19. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/operation_list.rb +55 -0
  20. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/osprofile.rb +72 -0
  21. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/resource.rb +112 -0
  22. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/storage_profile.rb +68 -0
  23. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/tags.rb +54 -0
  24. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/module_definition.rb +9 -0
  25. data/lib/2017-11-03-preview/generated/azure_mgmt_hanaonazure/operations.rb +107 -0
  26. data/lib/azure_mgmt_hanaonazure.rb +6 -0
  27. data/lib/module_definition.rb +7 -0
  28. data/lib/profiles/latest/hanaonazure_latest_profile_client.rb +40 -0
  29. data/lib/profiles/latest/hanaonazure_module_definition.rb +8 -0
  30. data/lib/profiles/latest/modules/hanaonazure_profile_module.rb +135 -0
  31. data/lib/version.rb +7 -0
  32. metadata +147 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c5b995174522172f7ac055b241c88f3d1193e44c
4
+ data.tar.gz: 04d10cd4fb64d87d1c7d916c0c342eac489b74c3
5
+ SHA512:
6
+ metadata.gz: ed5d49c8e68ad0e322a85eec1be9102bf7665057082c19b0da324a7880cf85dfd8b587c99182bb535cb81caf480580de607f2801f28ef57ccb4bc5d8d7ff3108
7
+ data.tar.gz: 6dc2a0cc9541e545b26e21dd0f19adbd64051bbb265f7465b711165193d5f4510602e3da82c908187414b32a39dc537d49b2324f8a4e488b645d8966a5ef3e07
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,47 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-11-03-preview/generated/azure_mgmt_hanaonazure/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Hanaonazure::Mgmt::V2017_11_03_preview
23
+ autoload :Operations, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/operations.rb'
24
+ autoload :HanaInstances, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/hana_instances.rb'
25
+ autoload :HanaManagementClient, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/hana_management_client.rb'
26
+
27
+ module Models
28
+ autoload :Resource, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/resource.rb'
29
+ autoload :HanaInstancesListResult, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instances_list_result.rb'
30
+ autoload :Disk, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/disk.rb'
31
+ autoload :Display, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/display.rb'
32
+ autoload :OSProfile, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/osprofile.rb'
33
+ autoload :Operation, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/operation.rb'
34
+ autoload :NetworkProfile, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/network_profile.rb'
35
+ autoload :OperationList, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/operation_list.rb'
36
+ autoload :StorageProfile, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/storage_profile.rb'
37
+ autoload :ErrorResponse, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/error_response.rb'
38
+ autoload :HardwareProfile, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hardware_profile.rb'
39
+ autoload :Tags, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/tags.rb'
40
+ autoload :IpAddress, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/ip_address.rb'
41
+ autoload :MonitoringDetails, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/monitoring_details.rb'
42
+ autoload :HanaInstance, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instance.rb'
43
+ autoload :HanaHardwareTypeNamesEnum, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_hardware_type_names_enum.rb'
44
+ autoload :HanaInstanceSizeNamesEnum, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instance_size_names_enum.rb'
45
+ autoload :HanaInstancePowerStateEnum, '2017-11-03-preview/generated/azure_mgmt_hanaonazure/models/hana_instance_power_state_enum.rb'
46
+ end
47
+ end
@@ -0,0 +1,942 @@
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::Hanaonazure::Mgmt::V2017_11_03_preview
7
+ #
8
+ # HANA on Azure Client
9
+ #
10
+ class HanaInstances
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the HanaInstances class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HanaManagementClient] reference to the HanaManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a list of SAP HANA instances in the specified subscription.
26
+ #
27
+ # Gets a list of SAP HANA instances in the specified subscription. The
28
+ # operations returns various properties of each SAP HANA on Azure instance.
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<HanaInstance>] operation results.
34
+ #
35
+ def list(custom_headers:nil)
36
+ first_page = list_as_lazy(custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets a list of SAP HANA instances in the specified subscription.
42
+ #
43
+ # Gets a list of SAP HANA instances in the specified subscription. The
44
+ # operations returns various properties of each SAP HANA on Azure instance.
45
+ #
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(custom_headers:nil)
52
+ list_async(custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets a list of SAP HANA instances in the specified subscription.
57
+ #
58
+ # Gets a list of SAP HANA instances in the specified subscription. The
59
+ # operations returns various properties of each SAP HANA on Azure instance.
60
+ #
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(custom_headers:nil)
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+
70
+
71
+ request_headers = {}
72
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
73
+
74
+ # Set Headers
75
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/hanaInstances'
78
+
79
+ request_url = @base_url || @client.base_url
80
+
81
+ options = {
82
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
83
+ path_params: {'subscriptionId' => @client.subscription_id},
84
+ query_params: {'api-version' => @client.api_version},
85
+ headers: request_headers.merge(custom_headers || {}),
86
+ base_url: request_url
87
+ }
88
+ promise = @client.make_request_async(:get, path_template, options)
89
+
90
+ promise = promise.then do |result|
91
+ http_response = result.response
92
+ status_code = http_response.status
93
+ response_content = http_response.body
94
+ unless status_code == 200
95
+ error_model = JSON.load(response_content)
96
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
97
+ end
98
+
99
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::HanaInstancesListResult.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Gets a list of SAP HANA instances in the specified subscription and the
119
+ # resource group.
120
+ #
121
+ # Gets a list of SAP HANA instances in the specified subscription and the
122
+ # resource group. The operations returns various properties of each SAP HANA on
123
+ # Azure instance.
124
+ #
125
+ # @param resource_group_name [String] Name of the resource group.
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [Array<HanaInstance>] operation results.
130
+ #
131
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
132
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
133
+ first_page.get_all_items
134
+ end
135
+
136
+ #
137
+ # Gets a list of SAP HANA instances in the specified subscription and the
138
+ # resource group.
139
+ #
140
+ # Gets a list of SAP HANA instances in the specified subscription and the
141
+ # resource group. The operations returns various properties of each SAP HANA on
142
+ # Azure instance.
143
+ #
144
+ # @param resource_group_name [String] Name of the resource group.
145
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
146
+ # will be added to the HTTP request.
147
+ #
148
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
149
+ #
150
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
151
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
152
+ end
153
+
154
+ #
155
+ # Gets a list of SAP HANA instances in the specified subscription and the
156
+ # resource group.
157
+ #
158
+ # Gets a list of SAP HANA instances in the specified subscription and the
159
+ # resource group. The operations returns various properties of each SAP HANA on
160
+ # Azure instance.
161
+ #
162
+ # @param resource_group_name [String] Name of the resource group.
163
+ # @param [Hash{String => String}] A hash of custom headers that will be added
164
+ # to the HTTP request.
165
+ #
166
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
167
+ #
168
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
169
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
170
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
171
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
172
+
173
+
174
+ request_headers = {}
175
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
176
+
177
+ # Set Headers
178
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
179
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
180
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances'
181
+
182
+ request_url = @base_url || @client.base_url
183
+
184
+ options = {
185
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
186
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
187
+ query_params: {'api-version' => @client.api_version},
188
+ headers: request_headers.merge(custom_headers || {}),
189
+ base_url: request_url
190
+ }
191
+ promise = @client.make_request_async(:get, path_template, options)
192
+
193
+ promise = promise.then do |result|
194
+ http_response = result.response
195
+ status_code = http_response.status
196
+ response_content = http_response.body
197
+ unless status_code == 200
198
+ error_model = JSON.load(response_content)
199
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
200
+ end
201
+
202
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
203
+ # Deserialize Response
204
+ if status_code == 200
205
+ begin
206
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
207
+ result_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::HanaInstancesListResult.mapper()
208
+ result.body = @client.deserialize(result_mapper, parsed_response)
209
+ rescue Exception => e
210
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
211
+ end
212
+ end
213
+
214
+ result
215
+ end
216
+
217
+ promise.execute
218
+ end
219
+
220
+ #
221
+ # Gets properties of a SAP HANA instance.
222
+ #
223
+ # Gets properties of a SAP HANA instance for the specified subscription,
224
+ # resource group, and instance name.
225
+ #
226
+ # @param resource_group_name [String] Name of the resource group.
227
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [HanaInstance] operation results.
232
+ #
233
+ def get(resource_group_name, hana_instance_name, custom_headers:nil)
234
+ response = get_async(resource_group_name, hana_instance_name, custom_headers:custom_headers).value!
235
+ response.body unless response.nil?
236
+ end
237
+
238
+ #
239
+ # Gets properties of a SAP HANA instance.
240
+ #
241
+ # Gets properties of a SAP HANA instance for the specified subscription,
242
+ # resource group, and instance name.
243
+ #
244
+ # @param resource_group_name [String] Name of the resource group.
245
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
246
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
247
+ # will be added to the HTTP request.
248
+ #
249
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
250
+ #
251
+ def get_with_http_info(resource_group_name, hana_instance_name, custom_headers:nil)
252
+ get_async(resource_group_name, hana_instance_name, custom_headers:custom_headers).value!
253
+ end
254
+
255
+ #
256
+ # Gets properties of a SAP HANA instance.
257
+ #
258
+ # Gets properties of a SAP HANA instance for the specified subscription,
259
+ # resource group, and instance name.
260
+ #
261
+ # @param resource_group_name [String] Name of the resource group.
262
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
263
+ # @param [Hash{String => String}] A hash of custom headers that will be added
264
+ # to the HTTP request.
265
+ #
266
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
267
+ #
268
+ def get_async(resource_group_name, hana_instance_name, custom_headers:nil)
269
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
270
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
271
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
272
+ fail ArgumentError, 'hana_instance_name is nil' if hana_instance_name.nil?
273
+
274
+
275
+ request_headers = {}
276
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
277
+
278
+ # Set Headers
279
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
280
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
281
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'
282
+
283
+ request_url = @base_url || @client.base_url
284
+
285
+ options = {
286
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
287
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'hanaInstanceName' => hana_instance_name},
288
+ query_params: {'api-version' => @client.api_version},
289
+ headers: request_headers.merge(custom_headers || {}),
290
+ base_url: request_url
291
+ }
292
+ promise = @client.make_request_async(:get, path_template, options)
293
+
294
+ promise = promise.then do |result|
295
+ http_response = result.response
296
+ status_code = http_response.status
297
+ response_content = http_response.body
298
+ unless status_code == 200
299
+ error_model = JSON.load(response_content)
300
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
301
+ end
302
+
303
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-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::Hanaonazure::Mgmt::V2017_11_03_preview::Models::HanaInstance.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
+ # Patches the Tags field of a SAP HANA instance.
323
+ #
324
+ # Patches the Tags field of a SAP HANA instance for the specified subscription,
325
+ # resource group, and instance name.
326
+ #
327
+ # @param resource_group_name [String] Name of the resource group.
328
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
329
+ # @param tags_parameter [Tags] Request body that only contains the new Tags
330
+ # field
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [HanaInstance] operation results.
335
+ #
336
+ def update(resource_group_name, hana_instance_name, tags_parameter, custom_headers:nil)
337
+ response = update_async(resource_group_name, hana_instance_name, tags_parameter, custom_headers:custom_headers).value!
338
+ response.body unless response.nil?
339
+ end
340
+
341
+ #
342
+ # Patches the Tags field of a SAP HANA instance.
343
+ #
344
+ # Patches the Tags field of a SAP HANA instance for the specified subscription,
345
+ # resource group, and instance name.
346
+ #
347
+ # @param resource_group_name [String] Name of the resource group.
348
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
349
+ # @param tags_parameter [Tags] Request body that only contains the new Tags
350
+ # field
351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
+ # will be added to the HTTP request.
353
+ #
354
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
355
+ #
356
+ def update_with_http_info(resource_group_name, hana_instance_name, tags_parameter, custom_headers:nil)
357
+ update_async(resource_group_name, hana_instance_name, tags_parameter, custom_headers:custom_headers).value!
358
+ end
359
+
360
+ #
361
+ # Patches the Tags field of a SAP HANA instance.
362
+ #
363
+ # Patches the Tags field of a SAP HANA instance for the specified subscription,
364
+ # resource group, and instance name.
365
+ #
366
+ # @param resource_group_name [String] Name of the resource group.
367
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
368
+ # @param tags_parameter [Tags] Request body that only contains the new Tags
369
+ # field
370
+ # @param [Hash{String => String}] A hash of custom headers that will be added
371
+ # to the HTTP request.
372
+ #
373
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
374
+ #
375
+ def update_async(resource_group_name, hana_instance_name, tags_parameter, custom_headers:nil)
376
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
377
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
378
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
379
+ fail ArgumentError, 'hana_instance_name is nil' if hana_instance_name.nil?
380
+ fail ArgumentError, 'tags_parameter is nil' if tags_parameter.nil?
381
+
382
+
383
+ request_headers = {}
384
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
385
+
386
+ # Set Headers
387
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
388
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
389
+
390
+ # Serialize Request
391
+ request_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::Tags.mapper()
392
+ request_content = @client.serialize(request_mapper, tags_parameter)
393
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
394
+
395
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'
396
+
397
+ request_url = @base_url || @client.base_url
398
+
399
+ options = {
400
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
401
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'hanaInstanceName' => hana_instance_name},
402
+ query_params: {'api-version' => @client.api_version},
403
+ body: request_content,
404
+ headers: request_headers.merge(custom_headers || {}),
405
+ base_url: request_url
406
+ }
407
+ promise = @client.make_request_async(:patch, path_template, options)
408
+
409
+ promise = promise.then do |result|
410
+ http_response = result.response
411
+ status_code = http_response.status
412
+ response_content = http_response.body
413
+ unless status_code == 200
414
+ error_model = JSON.load(response_content)
415
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
416
+ end
417
+
418
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+ # Deserialize Response
420
+ if status_code == 200
421
+ begin
422
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
423
+ result_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::HanaInstance.mapper()
424
+ result.body = @client.deserialize(result_mapper, parsed_response)
425
+ rescue Exception => e
426
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
427
+ end
428
+ end
429
+
430
+ result
431
+ end
432
+
433
+ promise.execute
434
+ end
435
+
436
+ #
437
+ # The operation to restart a SAP HANA instance.
438
+ #
439
+ # @param resource_group_name [String] Name of the resource group.
440
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ def restart(resource_group_name, hana_instance_name, custom_headers:nil)
445
+ response = restart_async(resource_group_name, hana_instance_name, custom_headers:custom_headers).value!
446
+ nil
447
+ end
448
+
449
+ #
450
+ # @param resource_group_name [String] Name of the resource group.
451
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ # @return [Concurrent::Promise] promise which provides async access to http
456
+ # response.
457
+ #
458
+ def restart_async(resource_group_name, hana_instance_name, custom_headers:nil)
459
+ # Send request
460
+ promise = begin_restart_async(resource_group_name, hana_instance_name, custom_headers:custom_headers)
461
+
462
+ promise = promise.then do |response|
463
+ # Defining deserialization method.
464
+ deserialize_method = lambda do |parsed_response|
465
+ end
466
+
467
+ # Waiting for response.
468
+ @client.get_long_running_operation_result(response, deserialize_method)
469
+ end
470
+
471
+ promise
472
+ end
473
+
474
+ #
475
+ # The operation to add a monitor to an SAP HANA instance.
476
+ #
477
+ # @param resource_group_name [String] Name of the resource group.
478
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
479
+ # @param monitoring_parameter [MonitoringDetails] Request body that only
480
+ # contains monitoring attributes
481
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
482
+ # will be added to the HTTP request.
483
+ #
484
+ def enable_monitoring(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:nil)
485
+ response = enable_monitoring_async(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:custom_headers).value!
486
+ nil
487
+ end
488
+
489
+ #
490
+ # @param resource_group_name [String] Name of the resource group.
491
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
492
+ # @param monitoring_parameter [MonitoringDetails] Request body that only
493
+ # contains monitoring attributes
494
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
495
+ # will be added to the HTTP request.
496
+ #
497
+ # @return [Concurrent::Promise] promise which provides async access to http
498
+ # response.
499
+ #
500
+ def enable_monitoring_async(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:nil)
501
+ # Send request
502
+ promise = begin_enable_monitoring_async(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:custom_headers)
503
+
504
+ promise = promise.then do |response|
505
+ # Defining deserialization method.
506
+ deserialize_method = lambda do |parsed_response|
507
+ end
508
+
509
+ # Waiting for response.
510
+ @client.get_long_running_operation_result(response, deserialize_method)
511
+ end
512
+
513
+ promise
514
+ end
515
+
516
+ #
517
+ # The operation to restart a SAP HANA instance.
518
+ #
519
+ # @param resource_group_name [String] Name of the resource group.
520
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
521
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
522
+ # will be added to the HTTP request.
523
+ #
524
+ #
525
+ def begin_restart(resource_group_name, hana_instance_name, custom_headers:nil)
526
+ response = begin_restart_async(resource_group_name, hana_instance_name, custom_headers:custom_headers).value!
527
+ nil
528
+ end
529
+
530
+ #
531
+ # The operation to restart a SAP HANA instance.
532
+ #
533
+ # @param resource_group_name [String] Name of the resource group.
534
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
535
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
536
+ # will be added to the HTTP request.
537
+ #
538
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
539
+ #
540
+ def begin_restart_with_http_info(resource_group_name, hana_instance_name, custom_headers:nil)
541
+ begin_restart_async(resource_group_name, hana_instance_name, custom_headers:custom_headers).value!
542
+ end
543
+
544
+ #
545
+ # The operation to restart a SAP HANA instance.
546
+ #
547
+ # @param resource_group_name [String] Name of the resource group.
548
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
549
+ # @param [Hash{String => String}] A hash of custom headers that will be added
550
+ # to the HTTP request.
551
+ #
552
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
553
+ #
554
+ def begin_restart_async(resource_group_name, hana_instance_name, custom_headers:nil)
555
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
556
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
557
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
558
+ fail ArgumentError, 'hana_instance_name is nil' if hana_instance_name.nil?
559
+
560
+
561
+ request_headers = {}
562
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
563
+
564
+ # Set Headers
565
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
566
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
567
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart'
568
+
569
+ request_url = @base_url || @client.base_url
570
+
571
+ options = {
572
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
573
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'hanaInstanceName' => hana_instance_name},
574
+ query_params: {'api-version' => @client.api_version},
575
+ headers: request_headers.merge(custom_headers || {}),
576
+ base_url: request_url
577
+ }
578
+ promise = @client.make_request_async(:post, path_template, options)
579
+
580
+ promise = promise.then do |result|
581
+ http_response = result.response
582
+ status_code = http_response.status
583
+ response_content = http_response.body
584
+ unless status_code == 200 || status_code == 202
585
+ error_model = JSON.load(response_content)
586
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
587
+ end
588
+
589
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
590
+
591
+ result
592
+ end
593
+
594
+ promise.execute
595
+ end
596
+
597
+ #
598
+ # The operation to add a monitor to an SAP HANA instance.
599
+ #
600
+ # @param resource_group_name [String] Name of the resource group.
601
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
602
+ # @param monitoring_parameter [MonitoringDetails] Request body that only
603
+ # contains monitoring attributes
604
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
605
+ # will be added to the HTTP request.
606
+ #
607
+ #
608
+ def begin_enable_monitoring(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:nil)
609
+ response = begin_enable_monitoring_async(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:custom_headers).value!
610
+ nil
611
+ end
612
+
613
+ #
614
+ # The operation to add a monitor to an SAP HANA instance.
615
+ #
616
+ # @param resource_group_name [String] Name of the resource group.
617
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
618
+ # @param monitoring_parameter [MonitoringDetails] Request body that only
619
+ # contains monitoring attributes
620
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
621
+ # will be added to the HTTP request.
622
+ #
623
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
624
+ #
625
+ def begin_enable_monitoring_with_http_info(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:nil)
626
+ begin_enable_monitoring_async(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:custom_headers).value!
627
+ end
628
+
629
+ #
630
+ # The operation to add a monitor to an SAP HANA instance.
631
+ #
632
+ # @param resource_group_name [String] Name of the resource group.
633
+ # @param hana_instance_name [String] Name of the SAP HANA on Azure instance.
634
+ # @param monitoring_parameter [MonitoringDetails] Request body that only
635
+ # contains monitoring attributes
636
+ # @param [Hash{String => String}] A hash of custom headers that will be added
637
+ # to the HTTP request.
638
+ #
639
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
640
+ #
641
+ def begin_enable_monitoring_async(resource_group_name, hana_instance_name, monitoring_parameter, custom_headers:nil)
642
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
643
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
644
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
645
+ fail ArgumentError, 'hana_instance_name is nil' if hana_instance_name.nil?
646
+ fail ArgumentError, 'monitoring_parameter is nil' if monitoring_parameter.nil?
647
+
648
+
649
+ request_headers = {}
650
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
651
+
652
+ # Set Headers
653
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
654
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
655
+
656
+ # Serialize Request
657
+ request_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::MonitoringDetails.mapper()
658
+ request_content = @client.serialize(request_mapper, monitoring_parameter)
659
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
660
+
661
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/monitoring'
662
+
663
+ request_url = @base_url || @client.base_url
664
+
665
+ options = {
666
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
667
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'hanaInstanceName' => hana_instance_name},
668
+ query_params: {'api-version' => @client.api_version},
669
+ body: request_content,
670
+ headers: request_headers.merge(custom_headers || {}),
671
+ base_url: request_url
672
+ }
673
+ promise = @client.make_request_async(:post, path_template, options)
674
+
675
+ promise = promise.then do |result|
676
+ http_response = result.response
677
+ status_code = http_response.status
678
+ response_content = http_response.body
679
+ unless status_code == 200 || status_code == 202
680
+ error_model = JSON.load(response_content)
681
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
682
+ end
683
+
684
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
685
+
686
+ result
687
+ end
688
+
689
+ promise.execute
690
+ end
691
+
692
+ #
693
+ # Gets a list of SAP HANA instances in the specified subscription.
694
+ #
695
+ # Gets a list of SAP HANA instances in the specified subscription. The
696
+ # operations returns various properties of each SAP HANA on Azure instance.
697
+ #
698
+ # @param next_page_link [String] The NextLink from the previous successful call
699
+ # to List operation.
700
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
701
+ # will be added to the HTTP request.
702
+ #
703
+ # @return [HanaInstancesListResult] operation results.
704
+ #
705
+ def list_next(next_page_link, custom_headers:nil)
706
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
707
+ response.body unless response.nil?
708
+ end
709
+
710
+ #
711
+ # Gets a list of SAP HANA instances in the specified subscription.
712
+ #
713
+ # Gets a list of SAP HANA instances in the specified subscription. The
714
+ # operations returns various properties of each SAP HANA on Azure instance.
715
+ #
716
+ # @param next_page_link [String] The NextLink from the previous successful call
717
+ # to List operation.
718
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
719
+ # will be added to the HTTP request.
720
+ #
721
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
722
+ #
723
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
724
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
725
+ end
726
+
727
+ #
728
+ # Gets a list of SAP HANA instances in the specified subscription.
729
+ #
730
+ # Gets a list of SAP HANA instances in the specified subscription. The
731
+ # operations returns various properties of each SAP HANA on Azure instance.
732
+ #
733
+ # @param next_page_link [String] The NextLink from the previous successful call
734
+ # to List operation.
735
+ # @param [Hash{String => String}] A hash of custom headers that will be added
736
+ # to the HTTP request.
737
+ #
738
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
739
+ #
740
+ def list_next_async(next_page_link, custom_headers:nil)
741
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
742
+
743
+
744
+ request_headers = {}
745
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
746
+
747
+ # Set Headers
748
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
749
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
750
+ path_template = '{nextLink}'
751
+
752
+ request_url = @base_url || @client.base_url
753
+
754
+ options = {
755
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
756
+ skip_encoding_path_params: {'nextLink' => next_page_link},
757
+ headers: request_headers.merge(custom_headers || {}),
758
+ base_url: request_url
759
+ }
760
+ promise = @client.make_request_async(:get, path_template, options)
761
+
762
+ promise = promise.then do |result|
763
+ http_response = result.response
764
+ status_code = http_response.status
765
+ response_content = http_response.body
766
+ unless status_code == 200
767
+ error_model = JSON.load(response_content)
768
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
769
+ end
770
+
771
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
772
+ # Deserialize Response
773
+ if status_code == 200
774
+ begin
775
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
776
+ result_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::HanaInstancesListResult.mapper()
777
+ result.body = @client.deserialize(result_mapper, parsed_response)
778
+ rescue Exception => e
779
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
780
+ end
781
+ end
782
+
783
+ result
784
+ end
785
+
786
+ promise.execute
787
+ end
788
+
789
+ #
790
+ # Gets a list of SAP HANA instances in the specified subscription and the
791
+ # resource group.
792
+ #
793
+ # Gets a list of SAP HANA instances in the specified subscription and the
794
+ # resource group. The operations returns various properties of each SAP HANA on
795
+ # Azure instance.
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 [HanaInstancesListResult] operation results.
803
+ #
804
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
805
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
806
+ response.body unless response.nil?
807
+ end
808
+
809
+ #
810
+ # Gets a list of SAP HANA instances in the specified subscription and the
811
+ # resource group.
812
+ #
813
+ # Gets a list of SAP HANA instances in the specified subscription and the
814
+ # resource group. The operations returns various properties of each SAP HANA on
815
+ # Azure instance.
816
+ #
817
+ # @param next_page_link [String] The NextLink from the previous successful call
818
+ # to List operation.
819
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
820
+ # will be added to the HTTP request.
821
+ #
822
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
823
+ #
824
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
825
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
826
+ end
827
+
828
+ #
829
+ # Gets a list of SAP HANA instances in the specified subscription and the
830
+ # resource group.
831
+ #
832
+ # Gets a list of SAP HANA instances in the specified subscription and the
833
+ # resource group. The operations returns various properties of each SAP HANA on
834
+ # Azure instance.
835
+ #
836
+ # @param next_page_link [String] The NextLink from the previous successful call
837
+ # to List operation.
838
+ # @param [Hash{String => String}] A hash of custom headers that will be added
839
+ # to the HTTP request.
840
+ #
841
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
842
+ #
843
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
844
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
845
+
846
+
847
+ request_headers = {}
848
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
849
+
850
+ # Set Headers
851
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
852
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
853
+ path_template = '{nextLink}'
854
+
855
+ request_url = @base_url || @client.base_url
856
+
857
+ options = {
858
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
859
+ skip_encoding_path_params: {'nextLink' => next_page_link},
860
+ headers: request_headers.merge(custom_headers || {}),
861
+ base_url: request_url
862
+ }
863
+ promise = @client.make_request_async(:get, path_template, options)
864
+
865
+ promise = promise.then do |result|
866
+ http_response = result.response
867
+ status_code = http_response.status
868
+ response_content = http_response.body
869
+ unless status_code == 200
870
+ error_model = JSON.load(response_content)
871
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
872
+ end
873
+
874
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
875
+ # Deserialize Response
876
+ if status_code == 200
877
+ begin
878
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
879
+ result_mapper = Azure::Hanaonazure::Mgmt::V2017_11_03_preview::Models::HanaInstancesListResult.mapper()
880
+ result.body = @client.deserialize(result_mapper, parsed_response)
881
+ rescue Exception => e
882
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
883
+ end
884
+ end
885
+
886
+ result
887
+ end
888
+
889
+ promise.execute
890
+ end
891
+
892
+ #
893
+ # Gets a list of SAP HANA instances in the specified subscription.
894
+ #
895
+ # Gets a list of SAP HANA instances in the specified subscription. The
896
+ # operations returns various properties of each SAP HANA on Azure instance.
897
+ #
898
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
899
+ # will be added to the HTTP request.
900
+ #
901
+ # @return [HanaInstancesListResult] which provide lazy access to pages of the
902
+ # response.
903
+ #
904
+ def list_as_lazy(custom_headers:nil)
905
+ response = list_async(custom_headers:custom_headers).value!
906
+ unless response.nil?
907
+ page = response.body
908
+ page.next_method = Proc.new do |next_page_link|
909
+ list_next_async(next_page_link, custom_headers:custom_headers)
910
+ end
911
+ page
912
+ end
913
+ end
914
+
915
+ #
916
+ # Gets a list of SAP HANA instances in the specified subscription and the
917
+ # resource group.
918
+ #
919
+ # Gets a list of SAP HANA instances in the specified subscription and the
920
+ # resource group. The operations returns various properties of each SAP HANA on
921
+ # Azure instance.
922
+ #
923
+ # @param resource_group_name [String] Name of the resource group.
924
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
925
+ # will be added to the HTTP request.
926
+ #
927
+ # @return [HanaInstancesListResult] which provide lazy access to pages of the
928
+ # response.
929
+ #
930
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
931
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
932
+ unless response.nil?
933
+ page = response.body
934
+ page.next_method = Proc.new do |next_page_link|
935
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
936
+ end
937
+ page
938
+ end
939
+ end
940
+
941
+ end
942
+ end