haipa_compute 0.0.1 → 0.0.2

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 +4 -4
  2. data/lib/1.0/generated/haipa_compute.rb +53 -53
  3. data/lib/1.0/generated/haipa_compute/haipa_compute.rb +136 -136
  4. data/lib/1.0/generated/haipa_compute/machines.rb +578 -578
  5. data/lib/1.0/generated/haipa_compute/models/agent.rb +87 -87
  6. data/lib/1.0/generated/haipa_compute/models/agent_network.rb +93 -93
  7. data/lib/1.0/generated/haipa_compute/models/machine.rb +125 -125
  8. data/lib/1.0/generated/haipa_compute/models/machine_config.rb +91 -91
  9. data/lib/1.0/generated/haipa_compute/models/machine_network.rb +187 -187
  10. data/lib/1.0/generated/haipa_compute/models/machine_network_config.rb +67 -67
  11. data/lib/1.0/generated/haipa_compute/models/machine_subnet_config.rb +47 -47
  12. data/lib/1.0/generated/haipa_compute/models/network.rb +109 -109
  13. data/lib/1.0/generated/haipa_compute/models/odata_value_ienumerable_machine.rb +56 -56
  14. data/lib/1.0/generated/haipa_compute/models/odata_value_ienumerable_operation.rb +56 -56
  15. data/lib/1.0/generated/haipa_compute/models/odata_value_ienumerable_operation_log.rb +56 -56
  16. data/lib/1.0/generated/haipa_compute/models/operation.rb +123 -123
  17. data/lib/1.0/generated/haipa_compute/models/operation_log.rb +81 -81
  18. data/lib/1.0/generated/haipa_compute/models/subnet.rb +144 -144
  19. data/lib/1.0/generated/haipa_compute/models/virtual_machine.rb +90 -90
  20. data/lib/1.0/generated/haipa_compute/models/virtual_machine_config.rb +111 -111
  21. data/lib/1.0/generated/haipa_compute/models/virtual_machine_cpu_config.rb +47 -47
  22. data/lib/1.0/generated/haipa_compute/models/virtual_machine_disk_config.rb +80 -80
  23. data/lib/1.0/generated/haipa_compute/models/virtual_machine_memory_config.rb +69 -69
  24. data/lib/1.0/generated/haipa_compute/models/virtual_machine_network_adapter.rb +92 -92
  25. data/lib/1.0/generated/haipa_compute/models/virtual_machine_network_adapter_config.rb +69 -69
  26. data/lib/1.0/generated/haipa_compute/models/virtual_machine_provisioning_config.rb +58 -58
  27. data/lib/1.0/generated/haipa_compute/module_definition.rb +9 -9
  28. data/lib/1.0/generated/haipa_compute/networks.rb +415 -415
  29. data/lib/1.0/generated/haipa_compute/operations.rb +347 -347
  30. data/lib/1.0/generated/haipa_compute/subnets.rb +100 -100
  31. data/lib/version.rb +1 -1
  32. metadata +5 -6
@@ -1,347 +1,347 @@
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 Haipa::Client::Compute::V1_0
7
- #
8
- # Haipa management API
9
- #
10
- class Operations
11
- include Haipa::Client
12
-
13
- #
14
- # Creates and initializes a new instance of the Operations class.
15
- # @param client service class for accessing basic functionality.
16
- #
17
- def initialize(client)
18
- @client = client
19
- end
20
-
21
- # @return [HaipaCompute] reference to the HaipaCompute
22
- attr_reader :client
23
-
24
- #
25
- # @param select [String] Limits the properties returned in the result.
26
- # @param expand [String] Indicates the related entities to be represented
27
- # inline. The maximum depth is 2.
28
- # @param filter [String] Restricts the set of items returned. The maximum
29
- # number of expressions is 100. The allowed functions are: allfunctions.
30
- # @param orderby [String] Specifies the order in which items are returned. The
31
- # maximum number of expressions is 5.
32
- # @param top [Integer] Limits the number of items returned from a collection.
33
- # @param skip [Integer] Excludes the specified number of items of the queried
34
- # collection from the result.
35
- # @param count [Boolean] Indicates whether the total count of items within a
36
- # collection are returned in the result.
37
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
- # will be added to the HTTP request.
39
- #
40
- # @return [ODataValueIEnumerableOperation] operation results.
41
- #
42
- def list(select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
43
- response = list_async(select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
44
- response.body unless response.nil?
45
- end
46
-
47
- #
48
- # @param select [String] Limits the properties returned in the result.
49
- # @param expand [String] Indicates the related entities to be represented
50
- # inline. The maximum depth is 2.
51
- # @param filter [String] Restricts the set of items returned. The maximum
52
- # number of expressions is 100. The allowed functions are: allfunctions.
53
- # @param orderby [String] Specifies the order in which items are returned. The
54
- # maximum number of expressions is 5.
55
- # @param top [Integer] Limits the number of items returned from a collection.
56
- # @param skip [Integer] Excludes the specified number of items of the queried
57
- # collection from the result.
58
- # @param count [Boolean] Indicates whether the total count of items within a
59
- # collection are returned in the result.
60
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
- # will be added to the HTTP request.
62
- #
63
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
64
- #
65
- def list_with_http_info(select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
66
- list_async(select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
67
- end
68
-
69
- #
70
- # @param select [String] Limits the properties returned in the result.
71
- # @param expand [String] Indicates the related entities to be represented
72
- # inline. The maximum depth is 2.
73
- # @param filter [String] Restricts the set of items returned. The maximum
74
- # number of expressions is 100. The allowed functions are: allfunctions.
75
- # @param orderby [String] Specifies the order in which items are returned. The
76
- # maximum number of expressions is 5.
77
- # @param top [Integer] Limits the number of items returned from a collection.
78
- # @param skip [Integer] Excludes the specified number of items of the queried
79
- # collection from the result.
80
- # @param count [Boolean] Indicates whether the total count of items within a
81
- # collection are returned in the result.
82
- # @param [Hash{String => String}] A hash of custom headers that will be added
83
- # to the HTTP request.
84
- #
85
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
- #
87
- def list_async(select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
88
-
89
-
90
- request_headers = {}
91
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
92
-
93
- # Set Headers
94
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
95
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
96
- path_template = 'odata/v1/Operations'
97
-
98
- request_url = @base_url || @client.base_url
99
-
100
- options = {
101
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
102
- query_params: {'$select' => select,'$expand' => expand,'$filter' => filter,'$orderby' => orderby,'$top' => top,'$skip' => skip,'$count' => count},
103
- headers: request_headers.merge(custom_headers || {}),
104
- base_url: request_url
105
- }
106
- promise = @client.make_request_async(:get, path_template, options)
107
-
108
- promise = promise.then do |result|
109
- http_response = result.response
110
- status_code = http_response.status
111
- response_content = http_response.body
112
- unless status_code == 200
113
- error_model = JSON.load(response_content)
114
- fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
115
- end
116
-
117
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
119
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
120
- # Deserialize Response
121
- if status_code == 200
122
- begin
123
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
- result_mapper = Haipa::Client::Compute::V1_0::Models::ODataValueIEnumerableOperation.mapper()
125
- result.body = @client.deserialize(result_mapper, parsed_response)
126
- rescue Exception => e
127
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
- end
129
- end
130
-
131
- result
132
- end
133
-
134
- promise.execute
135
- end
136
-
137
- #
138
- # @param key
139
- # @param select [String] Limits the properties returned in the result.
140
- # @param expand [String] Indicates the related entities to be represented
141
- # inline. The maximum depth is 2.
142
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
- # will be added to the HTTP request.
144
- #
145
- # @return [Operation] operation results.
146
- #
147
- def get(key, select:nil, expand:nil, custom_headers:nil)
148
- response = get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
149
- response.body unless response.nil?
150
- end
151
-
152
- #
153
- # @param key
154
- # @param select [String] Limits the properties returned in the result.
155
- # @param expand [String] Indicates the related entities to be represented
156
- # inline. The maximum depth is 2.
157
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
- # will be added to the HTTP request.
159
- #
160
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
161
- #
162
- def get_with_http_info(key, select:nil, expand:nil, custom_headers:nil)
163
- get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
164
- end
165
-
166
- #
167
- # @param key
168
- # @param select [String] Limits the properties returned in the result.
169
- # @param expand [String] Indicates the related entities to be represented
170
- # inline. The maximum depth is 2.
171
- # @param [Hash{String => String}] A hash of custom headers that will be added
172
- # to the HTTP request.
173
- #
174
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
- #
176
- def get_async(key, select:nil, expand:nil, custom_headers:nil)
177
- fail ArgumentError, 'key is nil' if key.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 = 'odata/v1/Operations({key})'
187
-
188
- request_url = @base_url || @client.base_url
189
-
190
- options = {
191
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
192
- path_params: {'key' => key},
193
- query_params: {'$select' => select,'$expand' => expand},
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 Haipa::Client::HaipaOperationError.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 = Haipa::Client::Compute::V1_0::Models::Operation.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
- # @param key
230
- # @param select [String] Limits the properties returned in the result.
231
- # @param expand [String] Indicates the related entities to be represented
232
- # inline. The maximum depth is 2.
233
- # @param filter [String] Restricts the set of items returned. The maximum
234
- # number of expressions is 100. The allowed functions are: allfunctions.
235
- # @param orderby [String] Specifies the order in which items are returned. The
236
- # maximum number of expressions is 5.
237
- # @param top [Integer] Limits the number of items returned from a collection.
238
- # @param skip [Integer] Excludes the specified number of items of the queried
239
- # collection from the result.
240
- # @param count [Boolean] Indicates whether the total count of items within a
241
- # collection are returned in the result.
242
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
- # will be added to the HTTP request.
244
- #
245
- # @return [ODataValueIEnumerableOperationLog] operation results.
246
- #
247
- def get_log_entries(key, select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
248
- response = get_log_entries_async(key, select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
249
- response.body unless response.nil?
250
- end
251
-
252
- #
253
- # @param key
254
- # @param select [String] Limits the properties returned in the result.
255
- # @param expand [String] Indicates the related entities to be represented
256
- # inline. The maximum depth is 2.
257
- # @param filter [String] Restricts the set of items returned. The maximum
258
- # number of expressions is 100. The allowed functions are: allfunctions.
259
- # @param orderby [String] Specifies the order in which items are returned. The
260
- # maximum number of expressions is 5.
261
- # @param top [Integer] Limits the number of items returned from a collection.
262
- # @param skip [Integer] Excludes the specified number of items of the queried
263
- # collection from the result.
264
- # @param count [Boolean] Indicates whether the total count of items within a
265
- # collection are returned in the result.
266
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
- # will be added to the HTTP request.
268
- #
269
- # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
270
- #
271
- def get_log_entries_with_http_info(key, select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
272
- get_log_entries_async(key, select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
273
- end
274
-
275
- #
276
- # @param key
277
- # @param select [String] Limits the properties returned in the result.
278
- # @param expand [String] Indicates the related entities to be represented
279
- # inline. The maximum depth is 2.
280
- # @param filter [String] Restricts the set of items returned. The maximum
281
- # number of expressions is 100. The allowed functions are: allfunctions.
282
- # @param orderby [String] Specifies the order in which items are returned. The
283
- # maximum number of expressions is 5.
284
- # @param top [Integer] Limits the number of items returned from a collection.
285
- # @param skip [Integer] Excludes the specified number of items of the queried
286
- # collection from the result.
287
- # @param count [Boolean] Indicates whether the total count of items within a
288
- # collection are returned in the result.
289
- # @param [Hash{String => String}] A hash of custom headers that will be added
290
- # to the HTTP request.
291
- #
292
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
293
- #
294
- def get_log_entries_async(key, select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
295
- fail ArgumentError, 'key is nil' if key.nil?
296
-
297
-
298
- request_headers = {}
299
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
300
-
301
- # Set Headers
302
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
303
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
304
- path_template = 'odata/v1/Operations({key})/logEntries'
305
-
306
- request_url = @base_url || @client.base_url
307
-
308
- options = {
309
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
310
- path_params: {'key' => key},
311
- query_params: {'$select' => select,'$expand' => expand,'$filter' => filter,'$orderby' => orderby,'$top' => top,'$skip' => skip,'$count' => count},
312
- headers: request_headers.merge(custom_headers || {}),
313
- base_url: request_url
314
- }
315
- promise = @client.make_request_async(:get, path_template, options)
316
-
317
- promise = promise.then do |result|
318
- http_response = result.response
319
- status_code = http_response.status
320
- response_content = http_response.body
321
- unless status_code == 200
322
- error_model = JSON.load(response_content)
323
- fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
324
- end
325
-
326
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
327
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
328
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
329
- # Deserialize Response
330
- if status_code == 200
331
- begin
332
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
333
- result_mapper = Haipa::Client::Compute::V1_0::Models::ODataValueIEnumerableOperationLog.mapper()
334
- result.body = @client.deserialize(result_mapper, parsed_response)
335
- rescue Exception => e
336
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
337
- end
338
- end
339
-
340
- result
341
- end
342
-
343
- promise.execute
344
- end
345
-
346
- end
347
- end
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 Haipa::Client::Compute::V1_0
7
+ #
8
+ # Haipa management API
9
+ #
10
+ class Operations
11
+ include Haipa::Client
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HaipaCompute] reference to the HaipaCompute
22
+ attr_reader :client
23
+
24
+ #
25
+ # @param select [String] Limits the properties returned in the result.
26
+ # @param expand [String] Indicates the related entities to be represented
27
+ # inline. The maximum depth is 2.
28
+ # @param filter [String] Restricts the set of items returned. The maximum
29
+ # number of expressions is 100. The allowed functions are: allfunctions.
30
+ # @param orderby [String] Specifies the order in which items are returned. The
31
+ # maximum number of expressions is 5.
32
+ # @param top [Integer] Limits the number of items returned from a collection.
33
+ # @param skip [Integer] Excludes the specified number of items of the queried
34
+ # collection from the result.
35
+ # @param count [Boolean] Indicates whether the total count of items within a
36
+ # collection are returned in the result.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [ODataValueIEnumerableOperation] operation results.
41
+ #
42
+ def list(select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
43
+ response = list_async(select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # @param select [String] Limits the properties returned in the result.
49
+ # @param expand [String] Indicates the related entities to be represented
50
+ # inline. The maximum depth is 2.
51
+ # @param filter [String] Restricts the set of items returned. The maximum
52
+ # number of expressions is 100. The allowed functions are: allfunctions.
53
+ # @param orderby [String] Specifies the order in which items are returned. The
54
+ # maximum number of expressions is 5.
55
+ # @param top [Integer] Limits the number of items returned from a collection.
56
+ # @param skip [Integer] Excludes the specified number of items of the queried
57
+ # collection from the result.
58
+ # @param count [Boolean] Indicates whether the total count of items within a
59
+ # collection are returned in the result.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
64
+ #
65
+ def list_with_http_info(select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
66
+ list_async(select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # @param select [String] Limits the properties returned in the result.
71
+ # @param expand [String] Indicates the related entities to be represented
72
+ # inline. The maximum depth is 2.
73
+ # @param filter [String] Restricts the set of items returned. The maximum
74
+ # number of expressions is 100. The allowed functions are: allfunctions.
75
+ # @param orderby [String] Specifies the order in which items are returned. The
76
+ # maximum number of expressions is 5.
77
+ # @param top [Integer] Limits the number of items returned from a collection.
78
+ # @param skip [Integer] Excludes the specified number of items of the queried
79
+ # collection from the result.
80
+ # @param count [Boolean] Indicates whether the total count of items within a
81
+ # collection are returned in the result.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def list_async(select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
88
+
89
+
90
+ request_headers = {}
91
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
92
+
93
+ # Set Headers
94
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
95
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
96
+ path_template = 'odata/v1/Operations'
97
+
98
+ request_url = @base_url || @client.base_url
99
+
100
+ options = {
101
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
102
+ query_params: {'$select' => select,'$expand' => expand,'$filter' => filter,'$orderby' => orderby,'$top' => top,'$skip' => skip,'$count' => count},
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:get, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 200
113
+ error_model = JSON.load(response_content)
114
+ fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
119
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
120
+ # Deserialize Response
121
+ if status_code == 200
122
+ begin
123
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
+ result_mapper = Haipa::Client::Compute::V1_0::Models::ODataValueIEnumerableOperation.mapper()
125
+ result.body = @client.deserialize(result_mapper, parsed_response)
126
+ rescue Exception => e
127
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
+ end
129
+ end
130
+
131
+ result
132
+ end
133
+
134
+ promise.execute
135
+ end
136
+
137
+ #
138
+ # @param key
139
+ # @param select [String] Limits the properties returned in the result.
140
+ # @param expand [String] Indicates the related entities to be represented
141
+ # inline. The maximum depth is 2.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [Operation] operation results.
146
+ #
147
+ def get(key, select:nil, expand:nil, custom_headers:nil)
148
+ response = get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
149
+ response.body unless response.nil?
150
+ end
151
+
152
+ #
153
+ # @param key
154
+ # @param select [String] Limits the properties returned in the result.
155
+ # @param expand [String] Indicates the related entities to be represented
156
+ # inline. The maximum depth is 2.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
161
+ #
162
+ def get_with_http_info(key, select:nil, expand:nil, custom_headers:nil)
163
+ get_async(key, select:select, expand:expand, custom_headers:custom_headers).value!
164
+ end
165
+
166
+ #
167
+ # @param key
168
+ # @param select [String] Limits the properties returned in the result.
169
+ # @param expand [String] Indicates the related entities to be represented
170
+ # inline. The maximum depth is 2.
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def get_async(key, select:nil, expand:nil, custom_headers:nil)
177
+ fail ArgumentError, 'key is nil' if key.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 = 'odata/v1/Operations({key})'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
192
+ path_params: {'key' => key},
193
+ query_params: {'$select' => select,'$expand' => expand},
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 Haipa::Client::HaipaOperationError.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 = Haipa::Client::Compute::V1_0::Models::Operation.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
+ # @param key
230
+ # @param select [String] Limits the properties returned in the result.
231
+ # @param expand [String] Indicates the related entities to be represented
232
+ # inline. The maximum depth is 2.
233
+ # @param filter [String] Restricts the set of items returned. The maximum
234
+ # number of expressions is 100. The allowed functions are: allfunctions.
235
+ # @param orderby [String] Specifies the order in which items are returned. The
236
+ # maximum number of expressions is 5.
237
+ # @param top [Integer] Limits the number of items returned from a collection.
238
+ # @param skip [Integer] Excludes the specified number of items of the queried
239
+ # collection from the result.
240
+ # @param count [Boolean] Indicates whether the total count of items within a
241
+ # collection are returned in the result.
242
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
+ # will be added to the HTTP request.
244
+ #
245
+ # @return [ODataValueIEnumerableOperationLog] operation results.
246
+ #
247
+ def get_log_entries(key, select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
248
+ response = get_log_entries_async(key, select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
249
+ response.body unless response.nil?
250
+ end
251
+
252
+ #
253
+ # @param key
254
+ # @param select [String] Limits the properties returned in the result.
255
+ # @param expand [String] Indicates the related entities to be represented
256
+ # inline. The maximum depth is 2.
257
+ # @param filter [String] Restricts the set of items returned. The maximum
258
+ # number of expressions is 100. The allowed functions are: allfunctions.
259
+ # @param orderby [String] Specifies the order in which items are returned. The
260
+ # maximum number of expressions is 5.
261
+ # @param top [Integer] Limits the number of items returned from a collection.
262
+ # @param skip [Integer] Excludes the specified number of items of the queried
263
+ # collection from the result.
264
+ # @param count [Boolean] Indicates whether the total count of items within a
265
+ # collection are returned in the result.
266
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
+ # will be added to the HTTP request.
268
+ #
269
+ # @return [Haipa::Client::HaipaOperationResponse] HTTP response information.
270
+ #
271
+ def get_log_entries_with_http_info(key, select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
272
+ get_log_entries_async(key, select:select, expand:expand, filter:filter, orderby:orderby, top:top, skip:skip, count:count, custom_headers:custom_headers).value!
273
+ end
274
+
275
+ #
276
+ # @param key
277
+ # @param select [String] Limits the properties returned in the result.
278
+ # @param expand [String] Indicates the related entities to be represented
279
+ # inline. The maximum depth is 2.
280
+ # @param filter [String] Restricts the set of items returned. The maximum
281
+ # number of expressions is 100. The allowed functions are: allfunctions.
282
+ # @param orderby [String] Specifies the order in which items are returned. The
283
+ # maximum number of expressions is 5.
284
+ # @param top [Integer] Limits the number of items returned from a collection.
285
+ # @param skip [Integer] Excludes the specified number of items of the queried
286
+ # collection from the result.
287
+ # @param count [Boolean] Indicates whether the total count of items within a
288
+ # collection are returned in the result.
289
+ # @param [Hash{String => String}] A hash of custom headers that will be added
290
+ # to the HTTP request.
291
+ #
292
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
293
+ #
294
+ def get_log_entries_async(key, select:nil, expand:nil, filter:nil, orderby:nil, top:nil, skip:nil, count:false, custom_headers:nil)
295
+ fail ArgumentError, 'key is nil' if key.nil?
296
+
297
+
298
+ request_headers = {}
299
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
300
+
301
+ # Set Headers
302
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
303
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
304
+ path_template = 'odata/v1/Operations({key})/logEntries'
305
+
306
+ request_url = @base_url || @client.base_url
307
+
308
+ options = {
309
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02]],
310
+ path_params: {'key' => key},
311
+ query_params: {'$select' => select,'$expand' => expand,'$filter' => filter,'$orderby' => orderby,'$top' => top,'$skip' => skip,'$count' => count},
312
+ headers: request_headers.merge(custom_headers || {}),
313
+ base_url: request_url
314
+ }
315
+ promise = @client.make_request_async(:get, path_template, options)
316
+
317
+ promise = promise.then do |result|
318
+ http_response = result.response
319
+ status_code = http_response.status
320
+ response_content = http_response.body
321
+ unless status_code == 200
322
+ error_model = JSON.load(response_content)
323
+ fail Haipa::Client::HaipaOperationError.new(result.request, http_response, error_model)
324
+ end
325
+
326
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
327
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
328
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
329
+ # Deserialize Response
330
+ if status_code == 200
331
+ begin
332
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
333
+ result_mapper = Haipa::Client::Compute::V1_0::Models::ODataValueIEnumerableOperationLog.mapper()
334
+ result.body = @client.deserialize(result_mapper, parsed_response)
335
+ rescue Exception => e
336
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
337
+ end
338
+ end
339
+
340
+ result
341
+ end
342
+
343
+ promise.execute
344
+ end
345
+
346
+ end
347
+ end