azure_mgmt_server_management 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/LICENSE.txt +21 -0
  4. data/Rakefile +5 -0
  5. data/azure_mgmt_server_management.gemspec +34 -0
  6. data/lib/azure_mgmt_server_management.rb +5 -0
  7. data/lib/generated/azure_mgmt_server_management.rb +57 -0
  8. data/lib/generated/azure_mgmt_server_management/gateway.rb +1394 -0
  9. data/lib/generated/azure_mgmt_server_management/models/auto_upgrade.rb +16 -0
  10. data/lib/generated/azure_mgmt_server_management/models/error.rb +64 -0
  11. data/lib/generated/azure_mgmt_server_management/models/gateway_expand_option.rb +15 -0
  12. data/lib/generated/azure_mgmt_server_management/models/gateway_parameters.rb +67 -0
  13. data/lib/generated/azure_mgmt_server_management/models/gateway_profile.rb +136 -0
  14. data/lib/generated/azure_mgmt_server_management/models/gateway_resource.rb +178 -0
  15. data/lib/generated/azure_mgmt_server_management/models/gateway_resources.rb +93 -0
  16. data/lib/generated/azure_mgmt_server_management/models/gateway_status.rb +153 -0
  17. data/lib/generated/azure_mgmt_server_management/models/node_parameters.rb +94 -0
  18. data/lib/generated/azure_mgmt_server_management/models/node_resource.rb +128 -0
  19. data/lib/generated/azure_mgmt_server_management/models/node_resources.rb +93 -0
  20. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_parameters.rb +44 -0
  21. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_result.rb +146 -0
  22. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_results.rb +82 -0
  23. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_status.rb +135 -0
  24. data/lib/generated/azure_mgmt_server_management/models/power_shell_expand_option.rb +15 -0
  25. data/lib/generated/azure_mgmt_server_management/models/power_shell_session_resource.rb +160 -0
  26. data/lib/generated/azure_mgmt_server_management/models/power_shell_session_resources.rb +63 -0
  27. data/lib/generated/azure_mgmt_server_management/models/power_shell_tab_completion_parameters.rb +44 -0
  28. data/lib/generated/azure_mgmt_server_management/models/power_shell_tab_completion_results.rb +52 -0
  29. data/lib/generated/azure_mgmt_server_management/models/prompt_field_description.rb +87 -0
  30. data/lib/generated/azure_mgmt_server_management/models/prompt_field_type.rb +17 -0
  31. data/lib/generated/azure_mgmt_server_management/models/prompt_message_response.rb +51 -0
  32. data/lib/generated/azure_mgmt_server_management/models/session_parameters.rb +54 -0
  33. data/lib/generated/azure_mgmt_server_management/models/session_resource.rb +118 -0
  34. data/lib/generated/azure_mgmt_server_management/models/version.rb +94 -0
  35. data/lib/generated/azure_mgmt_server_management/module_definition.rb +8 -0
  36. data/lib/generated/azure_mgmt_server_management/node.rb +996 -0
  37. data/lib/generated/azure_mgmt_server_management/power_shell.rb +989 -0
  38. data/lib/generated/azure_mgmt_server_management/server_management.rb +80 -0
  39. data/lib/generated/azure_mgmt_server_management/session.rb +398 -0
  40. data/lib/generated/azure_mgmt_server_management/version.rb +8 -0
  41. metadata +153 -0
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::ServerManagement
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ class SessionParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] User name to be used to connect to node
16
+ attr_accessor :user_name
17
+
18
+ # @return [String] Password associated with user name
19
+ attr_accessor :password
20
+
21
+
22
+ #
23
+ # Mapper for SessionParameters class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ required: false,
29
+ serialized_name: 'SessionParameters',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'SessionParameters',
33
+ model_properties: {
34
+ user_name: {
35
+ required: false,
36
+ serialized_name: 'properties.userName',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ },
41
+ password: {
42
+ required: false,
43
+ serialized_name: 'properties.password',
44
+ type: {
45
+ name: 'String'
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,118 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::ServerManagement
7
+ module Models
8
+ #
9
+ # the session object
10
+ #
11
+ class SessionResource < MsRestAzure::Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] the username connecting to the session
16
+ attr_accessor :user_name
17
+
18
+ # @return [DateTime] UTC date and time when node was first added to
19
+ # management service
20
+ attr_accessor :created
21
+
22
+ # @return [DateTime] UTC date and time when node was last updated.
23
+ attr_accessor :updated
24
+
25
+
26
+ #
27
+ # Mapper for SessionResource class as Ruby Hash.
28
+ # This will be used for serialization/deserialization.
29
+ #
30
+ def self.mapper()
31
+ {
32
+ required: false,
33
+ serialized_name: 'SessionResource',
34
+ type: {
35
+ name: 'Composite',
36
+ class_name: 'SessionResource',
37
+ model_properties: {
38
+ id: {
39
+ required: false,
40
+ read_only: true,
41
+ serialized_name: 'id',
42
+ type: {
43
+ name: 'String'
44
+ }
45
+ },
46
+ type: {
47
+ required: false,
48
+ read_only: true,
49
+ serialized_name: 'type',
50
+ type: {
51
+ name: 'String'
52
+ }
53
+ },
54
+ name: {
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'name',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ location: {
63
+ required: false,
64
+ read_only: true,
65
+ serialized_name: 'location',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ },
70
+ tags: {
71
+ required: false,
72
+ serialized_name: 'tags',
73
+ type: {
74
+ name: 'Dictionary',
75
+ value: {
76
+ required: false,
77
+ serialized_name: 'StringElementType',
78
+ type: {
79
+ name: 'String'
80
+ }
81
+ }
82
+ }
83
+ },
84
+ etag: {
85
+ required: false,
86
+ serialized_name: 'etag',
87
+ type: {
88
+ name: 'String'
89
+ }
90
+ },
91
+ user_name: {
92
+ required: false,
93
+ serialized_name: 'properties.userName',
94
+ type: {
95
+ name: 'String'
96
+ }
97
+ },
98
+ created: {
99
+ required: false,
100
+ serialized_name: 'properties.created',
101
+ type: {
102
+ name: 'DateTime'
103
+ }
104
+ },
105
+ updated: {
106
+ required: false,
107
+ serialized_name: 'properties.updated',
108
+ type: {
109
+ name: 'DateTime'
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,94 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::ServerManagement
7
+ module Models
8
+ #
9
+ # A multipart-numeric version number
10
+ #
11
+ class Version
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Integer] the leftmost number of the version
16
+ attr_accessor :major
17
+
18
+ # @return [Integer] the second leftmost number of the version
19
+ attr_accessor :minor
20
+
21
+ # @return [Integer] the third number of the version
22
+ attr_accessor :build
23
+
24
+ # @return [Integer] the fourth number of the version
25
+ attr_accessor :revision
26
+
27
+ # @return [Integer] the MSW of the fourth part
28
+ attr_accessor :major_revision
29
+
30
+ # @return [Integer] the LSW of the fourth part
31
+ attr_accessor :minor_revision
32
+
33
+
34
+ #
35
+ # Mapper for Version class as Ruby Hash.
36
+ # This will be used for serialization/deserialization.
37
+ #
38
+ def self.mapper()
39
+ {
40
+ required: false,
41
+ serialized_name: 'Version',
42
+ type: {
43
+ name: 'Composite',
44
+ class_name: 'Version',
45
+ model_properties: {
46
+ major: {
47
+ required: false,
48
+ serialized_name: 'major',
49
+ type: {
50
+ name: 'Number'
51
+ }
52
+ },
53
+ minor: {
54
+ required: false,
55
+ serialized_name: 'minor',
56
+ type: {
57
+ name: 'Number'
58
+ }
59
+ },
60
+ build: {
61
+ required: false,
62
+ serialized_name: 'build',
63
+ type: {
64
+ name: 'Number'
65
+ }
66
+ },
67
+ revision: {
68
+ required: false,
69
+ serialized_name: 'revision',
70
+ type: {
71
+ name: 'Number'
72
+ }
73
+ },
74
+ major_revision: {
75
+ required: false,
76
+ serialized_name: 'majorRevision',
77
+ type: {
78
+ name: 'Number'
79
+ }
80
+ },
81
+ minor_revision: {
82
+ required: false,
83
+ serialized_name: 'minorRevision',
84
+ type: {
85
+ name: 'Number'
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure end
7
+ module Azure::ARM end
8
+ module Azure::ARM::ServerManagement end
@@ -0,0 +1,996 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::ServerManagement
7
+ #
8
+ # REST API for Azure Server Management Service
9
+ #
10
+ class Node
11
+ include Azure::ARM::ServerManagement::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Node class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return reference to the ServerManagement
23
+ attr_reader :client
24
+
25
+ #
26
+ # Creates or updates a management node
27
+ #
28
+ # @param resource_group_name [String] The resource group name uniquely
29
+ # identifies the resource group within the user subscriptionId.
30
+ # @param node_name [String] The node name (256 characters maximum).
31
+ # @param location [String] location of the resource?
32
+ # @param tags resource tags
33
+ # @param gateway_id [String] Gateway id which will manage this node
34
+ # @param connection_name [String] myhost.domain.com
35
+ # @param user_name [String] User name to be used to connect to node
36
+ # @param password [String] Password associated with user name
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [NodeResource] operation results.
41
+ #
42
+ def create(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
43
+ response = create_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # @param resource_group_name [String] The resource group name uniquely
49
+ # identifies the resource group within the user subscriptionId.
50
+ # @param node_name [String] The node name (256 characters maximum).
51
+ # @param location [String] location of the resource?
52
+ # @param tags resource tags
53
+ # @param gateway_id [String] Gateway id which will manage this node
54
+ # @param connection_name [String] myhost.domain.com
55
+ # @param user_name [String] User name to be used to connect to node
56
+ # @param password [String] Password associated with user name
57
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
+ # will be added to the HTTP request.
59
+ #
60
+ # @return [Concurrent::Promise] promise which provides async access to http
61
+ # response.
62
+ #
63
+ def create_async(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
64
+ # Send request
65
+ promise = begin_create_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers)
66
+
67
+ promise = promise.then do |response|
68
+ # Defining deserialization method.
69
+ deserialize_method = lambda do |parsed_response|
70
+ result_mapper = NodeResource.mapper()
71
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
72
+ end
73
+
74
+ # Waiting for response.
75
+ @client.get_long_running_operation_result(response, deserialize_method)
76
+ end
77
+
78
+ promise
79
+ end
80
+
81
+ #
82
+ # Creates or updates a management node
83
+ #
84
+ # @param resource_group_name [String] The resource group name uniquely
85
+ # identifies the resource group within the user subscriptionId.
86
+ # @param node_name [String] The node name (256 characters maximum).
87
+ # @param location [String] location of the resource?
88
+ # @param tags resource tags
89
+ # @param gateway_id [String] Gateway id which will manage this node
90
+ # @param connection_name [String] myhost.domain.com
91
+ # @param user_name [String] User name to be used to connect to node
92
+ # @param password [String] Password associated with user name
93
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
94
+ # will be added to the HTTP request.
95
+ #
96
+ # @return [NodeResource] operation results.
97
+ #
98
+ def begin_create(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
99
+ response = begin_create_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers).value!
100
+ response.body unless response.nil?
101
+ end
102
+
103
+ #
104
+ # Creates or updates a management node
105
+ #
106
+ # @param resource_group_name [String] The resource group name uniquely
107
+ # identifies the resource group within the user subscriptionId.
108
+ # @param node_name [String] The node name (256 characters maximum).
109
+ # @param location [String] location of the resource?
110
+ # @param tags resource tags
111
+ # @param gateway_id [String] Gateway id which will manage this node
112
+ # @param connection_name [String] myhost.domain.com
113
+ # @param user_name [String] User name to be used to connect to node
114
+ # @param password [String] Password associated with user name
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
119
+ #
120
+ def begin_create_with_http_info(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
121
+ begin_create_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers).value!
122
+ end
123
+
124
+ #
125
+ # Creates or updates a management node
126
+ #
127
+ # @param resource_group_name [String] The resource group name uniquely
128
+ # identifies the resource group within the user subscriptionId.
129
+ # @param node_name [String] The node name (256 characters maximum).
130
+ # @param location [String] location of the resource?
131
+ # @param tags resource tags
132
+ # @param gateway_id [String] Gateway id which will manage this node
133
+ # @param connection_name [String] myhost.domain.com
134
+ # @param user_name [String] User name to be used to connect to node
135
+ # @param password [String] Password associated with user name
136
+ # @param [Hash{String => String}] A hash of custom headers that will be added
137
+ # to the HTTP request.
138
+ #
139
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
140
+ #
141
+ def begin_create_async(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
142
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
143
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
144
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
145
+ fail ArgumentError, 'node_name is nil' if node_name.nil?
146
+
147
+ gateway_parameters = NodeParameters.new
148
+ unless location.nil? && tags.nil? && gateway_id.nil? && connection_name.nil? && user_name.nil? && password.nil?
149
+ gateway_parameters.location = location
150
+ gateway_parameters.tags = tags
151
+ gateway_parameters.gateway_id = gateway_id
152
+ gateway_parameters.connection_name = connection_name
153
+ gateway_parameters.user_name = user_name
154
+ gateway_parameters.password = password
155
+ end
156
+
157
+ request_headers = {}
158
+
159
+ # Set Headers
160
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
161
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
162
+
163
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
164
+
165
+ # Serialize Request
166
+ request_mapper = NodeParameters.mapper()
167
+ request_content = @client.serialize(request_mapper, gateway_parameters, 'gateway_parameters')
168
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
169
+
170
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'
171
+ options = {
172
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
173
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name},
174
+ query_params: {'api-version' => @client.api_version},
175
+ body: request_content,
176
+ headers: request_headers.merge(custom_headers || {})
177
+ }
178
+
179
+ request_url = @base_url || @client.base_url
180
+
181
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
182
+ promise = request.run_promise do |req|
183
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
184
+ end
185
+
186
+ promise = promise.then do |http_response|
187
+ status_code = http_response.status
188
+ response_content = http_response.body
189
+ unless status_code == 200 || status_code == 201 || status_code == 202
190
+ error_model = JSON.load(response_content)
191
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
192
+ end
193
+
194
+ # Create Result
195
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
196
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
197
+ # Deserialize Response
198
+ if status_code == 200
199
+ begin
200
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
201
+ result_mapper = NodeResource.mapper()
202
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
203
+ rescue Exception => e
204
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
205
+ end
206
+ end
207
+ # Deserialize Response
208
+ if status_code == 201
209
+ begin
210
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
211
+ result_mapper = NodeResource.mapper()
212
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
213
+ rescue Exception => e
214
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
215
+ end
216
+ end
217
+
218
+ result
219
+ end
220
+
221
+ promise.execute
222
+ end
223
+
224
+ #
225
+ # Updates a management node
226
+ #
227
+ # @param resource_group_name [String] The resource group name uniquely
228
+ # identifies the resource group within the user subscriptionId.
229
+ # @param node_name [String] The node name (256 characters maximum).
230
+ # @param location [String] location of the resource?
231
+ # @param tags resource tags
232
+ # @param gateway_id [String] Gateway id which will manage this node
233
+ # @param connection_name [String] myhost.domain.com
234
+ # @param user_name [String] User name to be used to connect to node
235
+ # @param password [String] Password associated with user name
236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
+ # will be added to the HTTP request.
238
+ #
239
+ # @return [NodeResource] operation results.
240
+ #
241
+ def update(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
242
+ response = update_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers).value!
243
+ response.body unless response.nil?
244
+ end
245
+
246
+ #
247
+ # @param resource_group_name [String] The resource group name uniquely
248
+ # identifies the resource group within the user subscriptionId.
249
+ # @param node_name [String] The node name (256 characters maximum).
250
+ # @param location [String] location of the resource?
251
+ # @param tags resource tags
252
+ # @param gateway_id [String] Gateway id which will manage this node
253
+ # @param connection_name [String] myhost.domain.com
254
+ # @param user_name [String] User name to be used to connect to node
255
+ # @param password [String] Password associated with user name
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [Concurrent::Promise] promise which provides async access to http
260
+ # response.
261
+ #
262
+ def update_async(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
263
+ # Send request
264
+ promise = begin_update_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers)
265
+
266
+ promise = promise.then do |response|
267
+ # Defining deserialization method.
268
+ deserialize_method = lambda do |parsed_response|
269
+ result_mapper = NodeResource.mapper()
270
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
271
+ end
272
+
273
+ # Waiting for response.
274
+ @client.get_long_running_operation_result(response, deserialize_method)
275
+ end
276
+
277
+ promise
278
+ end
279
+
280
+ #
281
+ # Updates a management node
282
+ #
283
+ # @param resource_group_name [String] The resource group name uniquely
284
+ # identifies the resource group within the user subscriptionId.
285
+ # @param node_name [String] The node name (256 characters maximum).
286
+ # @param location [String] location of the resource?
287
+ # @param tags resource tags
288
+ # @param gateway_id [String] Gateway id which will manage this node
289
+ # @param connection_name [String] myhost.domain.com
290
+ # @param user_name [String] User name to be used to connect to node
291
+ # @param password [String] Password associated with user name
292
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
293
+ # will be added to the HTTP request.
294
+ #
295
+ # @return [NodeResource] operation results.
296
+ #
297
+ def begin_update(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
298
+ response = begin_update_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers).value!
299
+ response.body unless response.nil?
300
+ end
301
+
302
+ #
303
+ # Updates a management node
304
+ #
305
+ # @param resource_group_name [String] The resource group name uniquely
306
+ # identifies the resource group within the user subscriptionId.
307
+ # @param node_name [String] The node name (256 characters maximum).
308
+ # @param location [String] location of the resource?
309
+ # @param tags resource tags
310
+ # @param gateway_id [String] Gateway id which will manage this node
311
+ # @param connection_name [String] myhost.domain.com
312
+ # @param user_name [String] User name to be used to connect to node
313
+ # @param password [String] Password associated with user name
314
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
315
+ # will be added to the HTTP request.
316
+ #
317
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
318
+ #
319
+ def begin_update_with_http_info(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
320
+ begin_update_async(resource_group_name, node_name, location, tags, gateway_id, connection_name, user_name, password, custom_headers).value!
321
+ end
322
+
323
+ #
324
+ # Updates a management node
325
+ #
326
+ # @param resource_group_name [String] The resource group name uniquely
327
+ # identifies the resource group within the user subscriptionId.
328
+ # @param node_name [String] The node name (256 characters maximum).
329
+ # @param location [String] location of the resource?
330
+ # @param tags resource tags
331
+ # @param gateway_id [String] Gateway id which will manage this node
332
+ # @param connection_name [String] myhost.domain.com
333
+ # @param user_name [String] User name to be used to connect to node
334
+ # @param password [String] Password associated with user name
335
+ # @param [Hash{String => String}] A hash of custom headers that will be added
336
+ # to the HTTP request.
337
+ #
338
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
339
+ #
340
+ def begin_update_async(resource_group_name, node_name, location = nil, tags = nil, gateway_id = nil, connection_name = nil, user_name = nil, password = nil, custom_headers = nil)
341
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
342
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
343
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
344
+ fail ArgumentError, 'node_name is nil' if node_name.nil?
345
+
346
+ node_parameters = NodeParameters.new
347
+ unless location.nil? && tags.nil? && gateway_id.nil? && connection_name.nil? && user_name.nil? && password.nil?
348
+ node_parameters.location = location
349
+ node_parameters.tags = tags
350
+ node_parameters.gateway_id = gateway_id
351
+ node_parameters.connection_name = connection_name
352
+ node_parameters.user_name = user_name
353
+ node_parameters.password = password
354
+ end
355
+
356
+ request_headers = {}
357
+
358
+ # Set Headers
359
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
360
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
361
+
362
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
363
+
364
+ # Serialize Request
365
+ request_mapper = NodeParameters.mapper()
366
+ request_content = @client.serialize(request_mapper, node_parameters, 'node_parameters')
367
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
368
+
369
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'
370
+ options = {
371
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
372
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name},
373
+ query_params: {'api-version' => @client.api_version},
374
+ body: request_content,
375
+ headers: request_headers.merge(custom_headers || {})
376
+ }
377
+
378
+ request_url = @base_url || @client.base_url
379
+
380
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
381
+ promise = request.run_promise do |req|
382
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
383
+ end
384
+
385
+ promise = promise.then do |http_response|
386
+ status_code = http_response.status
387
+ response_content = http_response.body
388
+ unless status_code == 200 || status_code == 202
389
+ error_model = JSON.load(response_content)
390
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
391
+ end
392
+
393
+ # Create Result
394
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
395
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
396
+ # Deserialize Response
397
+ if status_code == 200
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ result_mapper = NodeResource.mapper()
401
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
402
+ rescue Exception => e
403
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
404
+ end
405
+ end
406
+
407
+ result
408
+ end
409
+
410
+ promise.execute
411
+ end
412
+
413
+ #
414
+ # deletes a management node
415
+ #
416
+ # @param resource_group_name [String] The resource group name uniquely
417
+ # identifies the resource group within the user subscriptionId.
418
+ # @param node_name [String] The node name (256 characters maximum).
419
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
420
+ # will be added to the HTTP request.
421
+ #
422
+ #
423
+ def delete(resource_group_name, node_name, custom_headers = nil)
424
+ response = delete_async(resource_group_name, node_name, custom_headers).value!
425
+ nil
426
+ end
427
+
428
+ #
429
+ # deletes a management node
430
+ #
431
+ # @param resource_group_name [String] The resource group name uniquely
432
+ # identifies the resource group within the user subscriptionId.
433
+ # @param node_name [String] The node name (256 characters maximum).
434
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
+ # will be added to the HTTP request.
436
+ #
437
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
438
+ #
439
+ def delete_with_http_info(resource_group_name, node_name, custom_headers = nil)
440
+ delete_async(resource_group_name, node_name, custom_headers).value!
441
+ end
442
+
443
+ #
444
+ # deletes a management node
445
+ #
446
+ # @param resource_group_name [String] The resource group name uniquely
447
+ # identifies the resource group within the user subscriptionId.
448
+ # @param node_name [String] The node name (256 characters maximum).
449
+ # @param [Hash{String => String}] A hash of custom headers that will be added
450
+ # to the HTTP request.
451
+ #
452
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
453
+ #
454
+ def delete_async(resource_group_name, node_name, custom_headers = nil)
455
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
456
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
457
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
458
+ fail ArgumentError, 'node_name is nil' if node_name.nil?
459
+
460
+
461
+ request_headers = {}
462
+
463
+ # Set Headers
464
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
465
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
466
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'
467
+ options = {
468
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
469
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name},
470
+ query_params: {'api-version' => @client.api_version},
471
+ headers: request_headers.merge(custom_headers || {})
472
+ }
473
+
474
+ request_url = @base_url || @client.base_url
475
+
476
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
477
+ promise = request.run_promise do |req|
478
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
479
+ end
480
+
481
+ promise = promise.then do |http_response|
482
+ status_code = http_response.status
483
+ response_content = http_response.body
484
+ unless status_code == 200 || status_code == 204
485
+ error_model = JSON.load(response_content)
486
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
487
+ end
488
+
489
+ # Create Result
490
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
491
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
492
+
493
+ result
494
+ end
495
+
496
+ promise.execute
497
+ end
498
+
499
+ #
500
+ # gets a management node
501
+ #
502
+ # @param resource_group_name [String] The resource group name uniquely
503
+ # identifies the resource group within the user subscriptionId.
504
+ # @param node_name [String] The node name (256 characters maximum).
505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
506
+ # will be added to the HTTP request.
507
+ #
508
+ # @return [NodeResource] operation results.
509
+ #
510
+ def get(resource_group_name, node_name, custom_headers = nil)
511
+ response = get_async(resource_group_name, node_name, custom_headers).value!
512
+ response.body unless response.nil?
513
+ end
514
+
515
+ #
516
+ # gets a management node
517
+ #
518
+ # @param resource_group_name [String] The resource group name uniquely
519
+ # identifies the resource group within the user subscriptionId.
520
+ # @param node_name [String] The node name (256 characters maximum).
521
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
522
+ # will be added to the HTTP request.
523
+ #
524
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
525
+ #
526
+ def get_with_http_info(resource_group_name, node_name, custom_headers = nil)
527
+ get_async(resource_group_name, node_name, custom_headers).value!
528
+ end
529
+
530
+ #
531
+ # gets a management node
532
+ #
533
+ # @param resource_group_name [String] The resource group name uniquely
534
+ # identifies the resource group within the user subscriptionId.
535
+ # @param node_name [String] The node name (256 characters maximum).
536
+ # @param [Hash{String => String}] A hash of custom headers that will be added
537
+ # to the HTTP request.
538
+ #
539
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
540
+ #
541
+ def get_async(resource_group_name, node_name, custom_headers = nil)
542
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
543
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
544
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
545
+ fail ArgumentError, 'node_name is nil' if node_name.nil?
546
+
547
+
548
+ request_headers = {}
549
+
550
+ # Set Headers
551
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
552
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
553
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}'
554
+ options = {
555
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
556
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name},
557
+ query_params: {'api-version' => @client.api_version},
558
+ headers: request_headers.merge(custom_headers || {})
559
+ }
560
+
561
+ request_url = @base_url || @client.base_url
562
+
563
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
564
+ promise = request.run_promise do |req|
565
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
566
+ end
567
+
568
+ promise = promise.then do |http_response|
569
+ status_code = http_response.status
570
+ response_content = http_response.body
571
+ unless status_code == 200
572
+ error_model = JSON.load(response_content)
573
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
574
+ end
575
+
576
+ # Create Result
577
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
578
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
579
+ # Deserialize Response
580
+ if status_code == 200
581
+ begin
582
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
583
+ result_mapper = NodeResource.mapper()
584
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
585
+ rescue Exception => e
586
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
587
+ end
588
+ end
589
+
590
+ result
591
+ end
592
+
593
+ promise.execute
594
+ end
595
+
596
+ #
597
+ # Returns nodes in a subscription
598
+ #
599
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
600
+ # will be added to the HTTP request.
601
+ #
602
+ # @return [NodeResources] which provide lazy access to pages of the response.
603
+ #
604
+ def list_as_lazy(custom_headers = nil)
605
+ response = list_async(custom_headers).value!
606
+ unless response.nil?
607
+ page = response.body
608
+ page.next_method = Proc.new do |next_link|
609
+ list_next_async(next_link, custom_headers)
610
+ end
611
+ page
612
+ end
613
+ end
614
+
615
+ #
616
+ # Returns nodes in a subscription
617
+ #
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [Array<NodeResource>] operation results.
622
+ #
623
+ def list(custom_headers = nil)
624
+ first_page = list_as_lazy(custom_headers)
625
+ first_page.get_all_items
626
+ end
627
+
628
+ #
629
+ # Returns nodes in a subscription
630
+ #
631
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
632
+ # will be added to the HTTP request.
633
+ #
634
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
635
+ #
636
+ def list_with_http_info(custom_headers = nil)
637
+ list_async(custom_headers).value!
638
+ end
639
+
640
+ #
641
+ # Returns nodes in a subscription
642
+ #
643
+ # @param [Hash{String => String}] A hash of custom headers that will be added
644
+ # to the HTTP request.
645
+ #
646
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
647
+ #
648
+ def list_async(custom_headers = nil)
649
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
650
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
651
+
652
+
653
+ request_headers = {}
654
+
655
+ # Set Headers
656
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
657
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
658
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.ServerManagement/nodes'
659
+ options = {
660
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
661
+ path_params: {'subscriptionId' => @client.subscription_id},
662
+ query_params: {'api-version' => @client.api_version},
663
+ headers: request_headers.merge(custom_headers || {})
664
+ }
665
+
666
+ request_url = @base_url || @client.base_url
667
+
668
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
669
+ promise = request.run_promise do |req|
670
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
671
+ end
672
+
673
+ promise = promise.then do |http_response|
674
+ status_code = http_response.status
675
+ response_content = http_response.body
676
+ unless status_code == 200
677
+ error_model = JSON.load(response_content)
678
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
679
+ end
680
+
681
+ # Create Result
682
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
683
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
684
+ # Deserialize Response
685
+ if status_code == 200
686
+ begin
687
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
688
+ result_mapper = NodeResources.mapper()
689
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
690
+ rescue Exception => e
691
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
692
+ end
693
+ end
694
+
695
+ result
696
+ end
697
+
698
+ promise.execute
699
+ end
700
+
701
+ #
702
+ # Returns nodes in a resource group
703
+ #
704
+ # @param resource_group_name [String] The resource group name uniquely
705
+ # identifies the resource group within the user subscriptionId.
706
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
707
+ # will be added to the HTTP request.
708
+ #
709
+ # @return [NodeResources] which provide lazy access to pages of the response.
710
+ #
711
+ def list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil)
712
+ response = list_for_resource_group_async(resource_group_name, custom_headers).value!
713
+ unless response.nil?
714
+ page = response.body
715
+ page.next_method = Proc.new do |next_link|
716
+ list_for_resource_group_next_async(next_link, custom_headers)
717
+ end
718
+ page
719
+ end
720
+ end
721
+
722
+ #
723
+ # Returns nodes in a resource group
724
+ #
725
+ # @param resource_group_name [String] The resource group name uniquely
726
+ # identifies the resource group within the user subscriptionId.
727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
+ # will be added to the HTTP request.
729
+ #
730
+ # @return [Array<NodeResource>] operation results.
731
+ #
732
+ def list_for_resource_group(resource_group_name, custom_headers = nil)
733
+ first_page = list_for_resource_group_as_lazy(resource_group_name, custom_headers)
734
+ first_page.get_all_items
735
+ end
736
+
737
+ #
738
+ # Returns nodes in a resource group
739
+ #
740
+ # @param resource_group_name [String] The resource group name uniquely
741
+ # identifies the resource group within the user subscriptionId.
742
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
743
+ # will be added to the HTTP request.
744
+ #
745
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
746
+ #
747
+ def list_for_resource_group_with_http_info(resource_group_name, custom_headers = nil)
748
+ list_for_resource_group_async(resource_group_name, custom_headers).value!
749
+ end
750
+
751
+ #
752
+ # Returns nodes in a resource group
753
+ #
754
+ # @param resource_group_name [String] The resource group name uniquely
755
+ # identifies the resource group within the user subscriptionId.
756
+ # @param [Hash{String => String}] A hash of custom headers that will be added
757
+ # to the HTTP request.
758
+ #
759
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
760
+ #
761
+ def list_for_resource_group_async(resource_group_name, custom_headers = nil)
762
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
763
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
764
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
765
+
766
+
767
+ request_headers = {}
768
+
769
+ # Set Headers
770
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
771
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
772
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes'
773
+ options = {
774
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
775
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
776
+ query_params: {'api-version' => @client.api_version},
777
+ headers: request_headers.merge(custom_headers || {})
778
+ }
779
+
780
+ request_url = @base_url || @client.base_url
781
+
782
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
783
+ promise = request.run_promise do |req|
784
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
785
+ end
786
+
787
+ promise = promise.then do |http_response|
788
+ status_code = http_response.status
789
+ response_content = http_response.body
790
+ unless status_code == 200
791
+ error_model = JSON.load(response_content)
792
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
793
+ end
794
+
795
+ # Create Result
796
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
797
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
798
+ # Deserialize Response
799
+ if status_code == 200
800
+ begin
801
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
802
+ result_mapper = NodeResources.mapper()
803
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
804
+ rescue Exception => e
805
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
806
+ end
807
+ end
808
+
809
+ result
810
+ end
811
+
812
+ promise.execute
813
+ end
814
+
815
+ #
816
+ # Returns nodes in a subscription
817
+ #
818
+ # @param next_page_link [String] The NextLink from the previous successful
819
+ # call to List operation.
820
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
821
+ # will be added to the HTTP request.
822
+ #
823
+ # @return [NodeResources] operation results.
824
+ #
825
+ def list_next(next_page_link, custom_headers = nil)
826
+ response = list_next_async(next_page_link, custom_headers).value!
827
+ response.body unless response.nil?
828
+ end
829
+
830
+ #
831
+ # Returns nodes in a subscription
832
+ #
833
+ # @param next_page_link [String] The NextLink from the previous successful
834
+ # call to List operation.
835
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
836
+ # will be added to the HTTP request.
837
+ #
838
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
839
+ #
840
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
841
+ list_next_async(next_page_link, custom_headers).value!
842
+ end
843
+
844
+ #
845
+ # Returns nodes in a subscription
846
+ #
847
+ # @param next_page_link [String] The NextLink from the previous successful
848
+ # call to List operation.
849
+ # @param [Hash{String => String}] A hash of custom headers that will be added
850
+ # to the HTTP request.
851
+ #
852
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
853
+ #
854
+ def list_next_async(next_page_link, custom_headers = nil)
855
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
856
+
857
+
858
+ request_headers = {}
859
+
860
+ # Set Headers
861
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
862
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
863
+ path_template = '{nextLink}'
864
+ options = {
865
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
866
+ skip_encoding_path_params: {'nextLink' => next_page_link},
867
+ headers: request_headers.merge(custom_headers || {})
868
+ }
869
+
870
+ request_url = @base_url || @client.base_url
871
+
872
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
873
+ promise = request.run_promise do |req|
874
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
875
+ end
876
+
877
+ promise = promise.then do |http_response|
878
+ status_code = http_response.status
879
+ response_content = http_response.body
880
+ unless status_code == 200
881
+ error_model = JSON.load(response_content)
882
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
883
+ end
884
+
885
+ # Create Result
886
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
887
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
888
+ # Deserialize Response
889
+ if status_code == 200
890
+ begin
891
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
892
+ result_mapper = NodeResources.mapper()
893
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
894
+ rescue Exception => e
895
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
896
+ end
897
+ end
898
+
899
+ result
900
+ end
901
+
902
+ promise.execute
903
+ end
904
+
905
+ #
906
+ # Returns nodes in a resource group
907
+ #
908
+ # @param next_page_link [String] The NextLink from the previous successful
909
+ # call to List operation.
910
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
911
+ # will be added to the HTTP request.
912
+ #
913
+ # @return [NodeResources] operation results.
914
+ #
915
+ def list_for_resource_group_next(next_page_link, custom_headers = nil)
916
+ response = list_for_resource_group_next_async(next_page_link, custom_headers).value!
917
+ response.body unless response.nil?
918
+ end
919
+
920
+ #
921
+ # Returns nodes in a resource group
922
+ #
923
+ # @param next_page_link [String] The NextLink from the previous successful
924
+ # call to List operation.
925
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
926
+ # will be added to the HTTP request.
927
+ #
928
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
929
+ #
930
+ def list_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
931
+ list_for_resource_group_next_async(next_page_link, custom_headers).value!
932
+ end
933
+
934
+ #
935
+ # Returns nodes in a resource group
936
+ #
937
+ # @param next_page_link [String] The NextLink from the previous successful
938
+ # call to List operation.
939
+ # @param [Hash{String => String}] A hash of custom headers that will be added
940
+ # to the HTTP request.
941
+ #
942
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
943
+ #
944
+ def list_for_resource_group_next_async(next_page_link, custom_headers = nil)
945
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
946
+
947
+
948
+ request_headers = {}
949
+
950
+ # Set Headers
951
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
952
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
953
+ path_template = '{nextLink}'
954
+ options = {
955
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
956
+ skip_encoding_path_params: {'nextLink' => next_page_link},
957
+ headers: request_headers.merge(custom_headers || {})
958
+ }
959
+
960
+ request_url = @base_url || @client.base_url
961
+
962
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
963
+ promise = request.run_promise do |req|
964
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
965
+ end
966
+
967
+ promise = promise.then do |http_response|
968
+ status_code = http_response.status
969
+ response_content = http_response.body
970
+ unless status_code == 200
971
+ error_model = JSON.load(response_content)
972
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
973
+ end
974
+
975
+ # Create Result
976
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
977
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
978
+ # Deserialize Response
979
+ if status_code == 200
980
+ begin
981
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
982
+ result_mapper = NodeResources.mapper()
983
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
984
+ rescue Exception => e
985
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
986
+ end
987
+ end
988
+
989
+ result
990
+ end
991
+
992
+ promise.execute
993
+ end
994
+
995
+ end
996
+ end