azure_mgmt_analysis_services 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-05-16/generated/azure_mgmt_analysis_services.rb +7 -3
  3. data/lib/2016-05-16/generated/azure_mgmt_analysis_services/analysis_services_management_client.rb +4 -1
  4. data/lib/2016-05-16/generated/azure_mgmt_analysis_services/models/check_server_name_availability_parameters.rb +64 -0
  5. data/lib/2016-05-16/generated/azure_mgmt_analysis_services/models/check_server_name_availability_result.rb +68 -0
  6. data/lib/2016-05-16/generated/azure_mgmt_analysis_services/models/error_response.rb +57 -0
  7. data/lib/2016-05-16/generated/azure_mgmt_analysis_services/models/operation_status.rb +102 -0
  8. data/lib/2016-05-16/generated/azure_mgmt_analysis_services/servers.rb +374 -74
  9. data/lib/2017-07-14/generated/azure_mgmt_analysis_services.rb +10 -6
  10. data/lib/2017-07-14/generated/azure_mgmt_analysis_services/analysis_services_management_client.rb +4 -1
  11. data/lib/2017-07-14/generated/azure_mgmt_analysis_services/models/check_server_name_availability_parameters.rb +64 -0
  12. data/lib/2017-07-14/generated/azure_mgmt_analysis_services/models/check_server_name_availability_result.rb +68 -0
  13. data/lib/2017-07-14/generated/azure_mgmt_analysis_services/models/error_response.rb +57 -0
  14. data/lib/2017-07-14/generated/azure_mgmt_analysis_services/models/operation_status.rb +102 -0
  15. data/lib/2017-07-14/generated/azure_mgmt_analysis_services/servers.rb +386 -84
  16. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services.rb +56 -0
  17. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/analysis_services_management_client.rb +135 -0
  18. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/analysis_services_server.rb +207 -0
  19. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/analysis_services_server_update_parameters.rb +135 -0
  20. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/analysis_services_servers.rb +56 -0
  21. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/check_server_name_availability_parameters.rb +64 -0
  22. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/check_server_name_availability_result.rb +68 -0
  23. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/connection_mode.rb +16 -0
  24. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/error_response.rb +57 -0
  25. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/gateway_details.rb +71 -0
  26. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/gateway_error.rb +57 -0
  27. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/gateway_list_status_error.rb +47 -0
  28. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/gateway_list_status_live.rb +48 -0
  29. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/ipv4firewall_rule.rb +68 -0
  30. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/ipv4firewall_settings.rb +66 -0
  31. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/operation.rb +59 -0
  32. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/operation_display.rb +72 -0
  33. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/operation_list_result.rb +103 -0
  34. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/operation_status.rb +102 -0
  35. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/provisioning_state.rb +26 -0
  36. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/resource.rb +115 -0
  37. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/resource_sku.rb +76 -0
  38. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/server_administrators.rb +54 -0
  39. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/sku_details_for_existing_resource.rb +47 -0
  40. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/sku_enumeration_for_existing_resource_result.rb +56 -0
  41. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/sku_enumeration_for_new_resource_result.rb +56 -0
  42. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/sku_tier.rb +17 -0
  43. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/state.rb +26 -0
  44. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/models/status.rb +15 -0
  45. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/module_definition.rb +9 -0
  46. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/operations.rb +217 -0
  47. data/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb +1790 -0
  48. data/lib/2017-08-01/generated/azure_mgmt_analysis_services.rb +56 -0
  49. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/analysis_services_management_client.rb +135 -0
  50. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/analysis_services_server.rb +207 -0
  51. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/analysis_services_server_update_parameters.rb +135 -0
  52. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/analysis_services_servers.rb +56 -0
  53. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/check_server_name_availability_parameters.rb +64 -0
  54. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/check_server_name_availability_result.rb +68 -0
  55. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/connection_mode.rb +16 -0
  56. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/error_response.rb +57 -0
  57. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/gateway_details.rb +71 -0
  58. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/gateway_error.rb +57 -0
  59. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/gateway_list_status_error.rb +47 -0
  60. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/gateway_list_status_live.rb +48 -0
  61. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/ipv4firewall_rule.rb +68 -0
  62. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/ipv4firewall_settings.rb +66 -0
  63. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/operation.rb +59 -0
  64. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/operation_display.rb +72 -0
  65. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/operation_list_result.rb +103 -0
  66. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/operation_status.rb +102 -0
  67. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/provisioning_state.rb +26 -0
  68. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/resource.rb +115 -0
  69. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/resource_sku.rb +76 -0
  70. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/server_administrators.rb +54 -0
  71. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/sku_details_for_existing_resource.rb +47 -0
  72. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/sku_enumeration_for_existing_resource_result.rb +56 -0
  73. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/sku_enumeration_for_new_resource_result.rb +56 -0
  74. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/sku_tier.rb +17 -0
  75. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/state.rb +26 -0
  76. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/models/status.rb +15 -0
  77. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/module_definition.rb +9 -0
  78. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/operations.rb +217 -0
  79. data/lib/2017-08-01/generated/azure_mgmt_analysis_services/servers.rb +1790 -0
  80. data/lib/azure_mgmt_analysis_services.rb +2 -0
  81. data/lib/profiles/latest/analysisservices_latest_profile_client.rb +28 -9
  82. data/lib/profiles/latest/analysisservices_module_definition.rb +0 -1
  83. data/lib/profiles/latest/modules/analysisservices_profile_module.rb +139 -78
  84. data/lib/version.rb +1 -1
  85. metadata +74 -2
@@ -0,0 +1,26 @@
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::AnalysisServices::Mgmt::V2017_08_01_beta
7
+ module Models
8
+ #
9
+ # Defines values for State
10
+ #
11
+ module State
12
+ Deleting = "Deleting"
13
+ Succeeded = "Succeeded"
14
+ Failed = "Failed"
15
+ Paused = "Paused"
16
+ Suspended = "Suspended"
17
+ Provisioning = "Provisioning"
18
+ Updating = "Updating"
19
+ Suspending = "Suspending"
20
+ Pausing = "Pausing"
21
+ Resuming = "Resuming"
22
+ Preparing = "Preparing"
23
+ Scaling = "Scaling"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,15 @@
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::AnalysisServices::Mgmt::V2017_08_01_beta
7
+ module Models
8
+ #
9
+ # Defines values for Status
10
+ #
11
+ module Status
12
+ Live = "Live"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::AnalysisServices end
8
+ module Azure::AnalysisServices::Mgmt end
9
+ module Azure::AnalysisServices::Mgmt::V2017_08_01_beta end
@@ -0,0 +1,217 @@
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::AnalysisServices::Mgmt::V2017_08_01_beta
7
+ #
8
+ # The Azure Analysis Services Web API provides a RESTful set of web services
9
+ # that enables users to create, retrieve, update, and delete Analysis
10
+ # Services servers
11
+ #
12
+ class Operations
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the Operations class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [AnalysisServicesManagementClient] reference to the AnalysisServicesManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Lists all of the available consumption REST API operations.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<Operation>] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ first_page = list_as_lazy(custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Lists all of the available consumption REST API operations.
41
+ #
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(custom_headers:nil)
48
+ list_async(custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Lists all of the available consumption REST API operations.
53
+ #
54
+ # @param [Hash{String => String}] A hash of custom headers that will be added
55
+ # to the HTTP request.
56
+ #
57
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
58
+ #
59
+ def list_async(custom_headers:nil)
60
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
61
+
62
+
63
+ request_headers = {}
64
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
65
+
66
+ # Set Headers
67
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
68
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
69
+ path_template = 'providers/Microsoft.AnalysisServices/operations'
70
+
71
+ request_url = @base_url || @client.base_url
72
+
73
+ options = {
74
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
75
+ query_params: {'api-version' => @client.api_version},
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
78
+ }
79
+ promise = @client.make_request_async(:get, path_template, options)
80
+
81
+ promise = promise.then do |result|
82
+ http_response = result.response
83
+ status_code = http_response.status
84
+ response_content = http_response.body
85
+ unless status_code == 200
86
+ error_model = JSON.load(response_content)
87
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
88
+ end
89
+
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::OperationListResult.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ #
109
+ # Lists all of the available consumption REST API operations.
110
+ #
111
+ # @param next_page_link [String] The NextLink from the previous successful call
112
+ # to List operation.
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ # @return [OperationListResult] operation results.
117
+ #
118
+ def list_next(next_page_link, custom_headers:nil)
119
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
120
+ response.body unless response.nil?
121
+ end
122
+
123
+ #
124
+ # Lists all of the available consumption REST API operations.
125
+ #
126
+ # @param next_page_link [String] The NextLink from the previous successful call
127
+ # to List operation.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
134
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Lists all of the available consumption REST API operations.
139
+ #
140
+ # @param next_page_link [String] The NextLink from the previous successful call
141
+ # to List operation.
142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
143
+ # to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def list_next_async(next_page_link, custom_headers:nil)
148
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
149
+
150
+
151
+ request_headers = {}
152
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
153
+
154
+ # Set Headers
155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
+ path_template = '{nextLink}'
158
+
159
+ request_url = @base_url || @client.base_url
160
+
161
+ options = {
162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
163
+ skip_encoding_path_params: {'nextLink' => next_page_link},
164
+ headers: request_headers.merge(custom_headers || {}),
165
+ base_url: request_url
166
+ }
167
+ promise = @client.make_request_async(:get, path_template, options)
168
+
169
+ promise = promise.then do |result|
170
+ http_response = result.response
171
+ status_code = http_response.status
172
+ response_content = http_response.body
173
+ unless status_code == 200
174
+ error_model = JSON.load(response_content)
175
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
176
+ end
177
+
178
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
179
+ # Deserialize Response
180
+ if status_code == 200
181
+ begin
182
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
183
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::OperationListResult.mapper()
184
+ result.body = @client.deserialize(result_mapper, parsed_response)
185
+ rescue Exception => e
186
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
187
+ end
188
+ end
189
+
190
+ result
191
+ end
192
+
193
+ promise.execute
194
+ end
195
+
196
+ #
197
+ # Lists all of the available consumption REST API operations.
198
+ #
199
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
200
+ # will be added to the HTTP request.
201
+ #
202
+ # @return [OperationListResult] which provide lazy access to pages of the
203
+ # response.
204
+ #
205
+ def list_as_lazy(custom_headers:nil)
206
+ response = list_async(custom_headers:custom_headers).value!
207
+ unless response.nil?
208
+ page = response.body
209
+ page.next_method = Proc.new do |next_page_link|
210
+ list_next_async(next_page_link, custom_headers:custom_headers)
211
+ end
212
+ page
213
+ end
214
+ end
215
+
216
+ end
217
+ end
@@ -0,0 +1,1790 @@
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::AnalysisServices::Mgmt::V2017_08_01_beta
7
+ #
8
+ # The Azure Analysis Services Web API provides a RESTful set of web services
9
+ # that enables users to create, retrieve, update, and delete Analysis
10
+ # Services servers
11
+ #
12
+ class Servers
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the Servers class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [AnalysisServicesManagementClient] reference to the AnalysisServicesManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Gets details about the specified Analysis Services server.
28
+ #
29
+ # @param resource_group_name [String] The name of the Azure Resource group of
30
+ # which a given Analysis Services server is part. This name must be at least 1
31
+ # character in length, and no more than 90.
32
+ # @param server_name [String] The name of the Analysis Services server. It must
33
+ # be a minimum of 3 characters, and a maximum of 63.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [AnalysisServicesServer] operation results.
38
+ #
39
+ def get_details(resource_group_name, server_name, custom_headers:nil)
40
+ response = get_details_async(resource_group_name, server_name, custom_headers:custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Gets details about the specified Analysis Services server.
46
+ #
47
+ # @param resource_group_name [String] The name of the Azure Resource group of
48
+ # which a given Analysis Services server is part. This name must be at least 1
49
+ # character in length, and no more than 90.
50
+ # @param server_name [String] The name of the Analysis Services server. It must
51
+ # be a minimum of 3 characters, and a maximum of 63.
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def get_details_with_http_info(resource_group_name, server_name, custom_headers:nil)
58
+ get_details_async(resource_group_name, server_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Gets details about the specified Analysis Services server.
63
+ #
64
+ # @param resource_group_name [String] The name of the Azure Resource group of
65
+ # which a given Analysis Services server is part. This name must be at least 1
66
+ # character in length, and no more than 90.
67
+ # @param server_name [String] The name of the Analysis Services server. It must
68
+ # be a minimum of 3 characters, and a maximum of 63.
69
+ # @param [Hash{String => String}] A hash of custom headers that will be added
70
+ # to the HTTP request.
71
+ #
72
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
73
+ #
74
+ def get_details_async(resource_group_name, server_name, custom_headers:nil)
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
77
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
78
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
79
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
80
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
81
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
82
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
83
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
84
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
85
+
86
+
87
+ request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
+
90
+ # Set Headers
91
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}'
94
+
95
+ request_url = @base_url || @client.base_url
96
+
97
+ options = {
98
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
100
+ query_params: {'api-version' => @client.api_version},
101
+ headers: request_headers.merge(custom_headers || {}),
102
+ base_url: request_url
103
+ }
104
+ promise = @client.make_request_async(:get, path_template, options)
105
+
106
+ promise = promise.then do |result|
107
+ http_response = result.response
108
+ status_code = http_response.status
109
+ response_content = http_response.body
110
+ unless status_code == 200
111
+ error_model = JSON.load(response_content)
112
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
113
+ end
114
+
115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ # Deserialize Response
117
+ if status_code == 200
118
+ begin
119
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
120
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
121
+ result.body = @client.deserialize(result_mapper, parsed_response)
122
+ rescue Exception => e
123
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
124
+ end
125
+ end
126
+
127
+ result
128
+ end
129
+
130
+ promise.execute
131
+ end
132
+
133
+ #
134
+ # Provisions the specified Analysis Services server based on the configuration
135
+ # specified in the request.
136
+ #
137
+ # @param resource_group_name [String] The name of the Azure Resource group of
138
+ # which a given Analysis Services server is part. This name must be at least 1
139
+ # character in length, and no more than 90.
140
+ # @param server_name [String] The name of the Analysis Services server. It must
141
+ # be a minimum of 3 characters, and a maximum of 63.
142
+ # @param server_parameters [AnalysisServicesServer] Contains the information
143
+ # used to provision the Analysis Services server.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [AnalysisServicesServer] operation results.
148
+ #
149
+ def create(resource_group_name, server_name, server_parameters, custom_headers:nil)
150
+ response = create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # @param resource_group_name [String] The name of the Azure Resource group of
156
+ # which a given Analysis Services server is part. This name must be at least 1
157
+ # character in length, and no more than 90.
158
+ # @param server_name [String] The name of the Analysis Services server. It must
159
+ # be a minimum of 3 characters, and a maximum of 63.
160
+ # @param server_parameters [AnalysisServicesServer] Contains the information
161
+ # used to provision the Analysis Services server.
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [Concurrent::Promise] promise which provides async access to http
166
+ # response.
167
+ #
168
+ def create_async(resource_group_name, server_name, server_parameters, custom_headers:nil)
169
+ # Send request
170
+ promise = begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers)
171
+
172
+ promise = promise.then do |response|
173
+ # Defining deserialization method.
174
+ deserialize_method = lambda do |parsed_response|
175
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
176
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
177
+ end
178
+
179
+ # Waiting for response.
180
+ @client.get_long_running_operation_result(response, deserialize_method)
181
+ end
182
+
183
+ promise
184
+ end
185
+
186
+ #
187
+ # Deletes the specified Analysis Services server.
188
+ #
189
+ # @param resource_group_name [String] The name of the Azure Resource group of
190
+ # which a given Analysis Services server is part. This name must be at least 1
191
+ # character in length, and no more than 90.
192
+ # @param server_name [String] The name of the Analysis Services server. It must
193
+ # be at least 3 characters in length, and no more than 63.
194
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
195
+ # will be added to the HTTP request.
196
+ #
197
+ def delete(resource_group_name, server_name, custom_headers:nil)
198
+ response = delete_async(resource_group_name, server_name, custom_headers:custom_headers).value!
199
+ nil
200
+ end
201
+
202
+ #
203
+ # @param resource_group_name [String] The name of the Azure Resource group of
204
+ # which a given Analysis Services server is part. This name must be at least 1
205
+ # character in length, and no more than 90.
206
+ # @param server_name [String] The name of the Analysis Services server. It must
207
+ # be at least 3 characters in length, and no more than 63.
208
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
209
+ # will be added to the HTTP request.
210
+ #
211
+ # @return [Concurrent::Promise] promise which provides async access to http
212
+ # response.
213
+ #
214
+ def delete_async(resource_group_name, server_name, custom_headers:nil)
215
+ # Send request
216
+ promise = begin_delete_async(resource_group_name, server_name, custom_headers:custom_headers)
217
+
218
+ promise = promise.then do |response|
219
+ # Defining deserialization method.
220
+ deserialize_method = lambda do |parsed_response|
221
+ end
222
+
223
+ # Waiting for response.
224
+ @client.get_long_running_operation_result(response, deserialize_method)
225
+ end
226
+
227
+ promise
228
+ end
229
+
230
+ #
231
+ # Updates the current state of the specified Analysis Services server.
232
+ #
233
+ # @param resource_group_name [String] The name of the Azure Resource group of
234
+ # which a given Analysis Services server is part. This name must be at least 1
235
+ # character in length, and no more than 90.
236
+ # @param server_name [String] The name of the Analysis Services server. It must
237
+ # be at least 3 characters in length, and no more than 63.
238
+ # @param server_update_parameters [AnalysisServicesServerUpdateParameters]
239
+ # Request object that contains the updated information for the server.
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ # @return [AnalysisServicesServer] operation results.
244
+ #
245
+ def update(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
246
+ response = update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
247
+ response.body unless response.nil?
248
+ end
249
+
250
+ #
251
+ # @param resource_group_name [String] The name of the Azure Resource group of
252
+ # which a given Analysis Services server is part. This name must be at least 1
253
+ # character in length, and no more than 90.
254
+ # @param server_name [String] The name of the Analysis Services server. It must
255
+ # be at least 3 characters in length, and no more than 63.
256
+ # @param server_update_parameters [AnalysisServicesServerUpdateParameters]
257
+ # Request object that contains the updated information for the server.
258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
259
+ # will be added to the HTTP request.
260
+ #
261
+ # @return [Concurrent::Promise] promise which provides async access to http
262
+ # response.
263
+ #
264
+ def update_async(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
265
+ # Send request
266
+ promise = begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers)
267
+
268
+ promise = promise.then do |response|
269
+ # Defining deserialization method.
270
+ deserialize_method = lambda do |parsed_response|
271
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
272
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
273
+ end
274
+
275
+ # Waiting for response.
276
+ @client.get_long_running_operation_result(response, deserialize_method)
277
+ end
278
+
279
+ promise
280
+ end
281
+
282
+ #
283
+ # Supends operation of the specified Analysis Services server instance.
284
+ #
285
+ # @param resource_group_name [String] The name of the Azure Resource group of
286
+ # which a given Analysis Services server is part. This name must be at least 1
287
+ # character in length, and no more than 90.
288
+ # @param server_name [String] The name of the Analysis Services server. It must
289
+ # be at least 3 characters in length, and no more than 63.
290
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
291
+ # will be added to the HTTP request.
292
+ #
293
+ def suspend(resource_group_name, server_name, custom_headers:nil)
294
+ response = suspend_async(resource_group_name, server_name, custom_headers:custom_headers).value!
295
+ nil
296
+ end
297
+
298
+ #
299
+ # @param resource_group_name [String] The name of the Azure Resource group of
300
+ # which a given Analysis Services server is part. This name must be at least 1
301
+ # character in length, and no more than 90.
302
+ # @param server_name [String] The name of the Analysis Services server. It must
303
+ # be at least 3 characters in length, and no more than 63.
304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
+ # will be added to the HTTP request.
306
+ #
307
+ # @return [Concurrent::Promise] promise which provides async access to http
308
+ # response.
309
+ #
310
+ def suspend_async(resource_group_name, server_name, custom_headers:nil)
311
+ # Send request
312
+ promise = begin_suspend_async(resource_group_name, server_name, custom_headers:custom_headers)
313
+
314
+ promise = promise.then do |response|
315
+ # Defining deserialization method.
316
+ deserialize_method = lambda do |parsed_response|
317
+ end
318
+
319
+ # Waiting for response.
320
+ @client.get_long_running_operation_result(response, deserialize_method)
321
+ end
322
+
323
+ promise
324
+ end
325
+
326
+ #
327
+ # Resumes operation of the specified Analysis Services server instance.
328
+ #
329
+ # @param resource_group_name [String] The name of the Azure Resource group of
330
+ # which a given Analysis Services server is part. This name must be at least 1
331
+ # character in length, and no more than 90.
332
+ # @param server_name [String] The name of the Analysis Services server. It must
333
+ # be at least 3 characters in length, and no more than 63.
334
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
335
+ # will be added to the HTTP request.
336
+ #
337
+ def resume(resource_group_name, server_name, custom_headers:nil)
338
+ response = resume_async(resource_group_name, server_name, custom_headers:custom_headers).value!
339
+ nil
340
+ end
341
+
342
+ #
343
+ # @param resource_group_name [String] The name of the Azure Resource group of
344
+ # which a given Analysis Services server is part. This name must be at least 1
345
+ # character in length, and no more than 90.
346
+ # @param server_name [String] The name of the Analysis Services server. It must
347
+ # be at least 3 characters in length, and no more than 63.
348
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
349
+ # will be added to the HTTP request.
350
+ #
351
+ # @return [Concurrent::Promise] promise which provides async access to http
352
+ # response.
353
+ #
354
+ def resume_async(resource_group_name, server_name, custom_headers:nil)
355
+ # Send request
356
+ promise = begin_resume_async(resource_group_name, server_name, custom_headers:custom_headers)
357
+
358
+ promise = promise.then do |response|
359
+ # Defining deserialization method.
360
+ deserialize_method = lambda do |parsed_response|
361
+ end
362
+
363
+ # Waiting for response.
364
+ @client.get_long_running_operation_result(response, deserialize_method)
365
+ end
366
+
367
+ promise
368
+ end
369
+
370
+ #
371
+ # Gets all the Analysis Services servers for the given resource group.
372
+ #
373
+ # @param resource_group_name [String] The name of the Azure Resource group of
374
+ # which a given Analysis Services server is part. This name must be at least 1
375
+ # character in length, and no more than 90.
376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
377
+ # will be added to the HTTP request.
378
+ #
379
+ # @return [AnalysisServicesServers] operation results.
380
+ #
381
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
382
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
383
+ response.body unless response.nil?
384
+ end
385
+
386
+ #
387
+ # Gets all the Analysis Services servers for the given resource group.
388
+ #
389
+ # @param resource_group_name [String] The name of the Azure Resource group of
390
+ # which a given Analysis Services server is part. This name must be at least 1
391
+ # character in length, and no more than 90.
392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
393
+ # will be added to the HTTP request.
394
+ #
395
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
396
+ #
397
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
398
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
399
+ end
400
+
401
+ #
402
+ # Gets all the Analysis Services servers for the given resource group.
403
+ #
404
+ # @param resource_group_name [String] The name of the Azure Resource group of
405
+ # which a given Analysis Services server is part. This name must be at least 1
406
+ # character in length, and no more than 90.
407
+ # @param [Hash{String => String}] A hash of custom headers that will be added
408
+ # to the HTTP request.
409
+ #
410
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
411
+ #
412
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
413
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
414
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
415
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
416
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
417
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
418
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
419
+
420
+
421
+ request_headers = {}
422
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
423
+
424
+ # Set Headers
425
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
426
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
427
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers'
428
+
429
+ request_url = @base_url || @client.base_url
430
+
431
+ options = {
432
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
433
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
434
+ query_params: {'api-version' => @client.api_version},
435
+ headers: request_headers.merge(custom_headers || {}),
436
+ base_url: request_url
437
+ }
438
+ promise = @client.make_request_async(:get, path_template, options)
439
+
440
+ promise = promise.then do |result|
441
+ http_response = result.response
442
+ status_code = http_response.status
443
+ response_content = http_response.body
444
+ unless status_code == 200
445
+ error_model = JSON.load(response_content)
446
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
447
+ end
448
+
449
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
450
+ # Deserialize Response
451
+ if status_code == 200
452
+ begin
453
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
454
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServers.mapper()
455
+ result.body = @client.deserialize(result_mapper, parsed_response)
456
+ rescue Exception => e
457
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
458
+ end
459
+ end
460
+
461
+ result
462
+ end
463
+
464
+ promise.execute
465
+ end
466
+
467
+ #
468
+ # Lists all the Analysis Services servers for the given subscription.
469
+ #
470
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
471
+ # will be added to the HTTP request.
472
+ #
473
+ # @return [AnalysisServicesServers] operation results.
474
+ #
475
+ def list(custom_headers:nil)
476
+ response = list_async(custom_headers:custom_headers).value!
477
+ response.body unless response.nil?
478
+ end
479
+
480
+ #
481
+ # Lists all the Analysis Services servers for the given subscription.
482
+ #
483
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
484
+ # will be added to the HTTP request.
485
+ #
486
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
487
+ #
488
+ def list_with_http_info(custom_headers:nil)
489
+ list_async(custom_headers:custom_headers).value!
490
+ end
491
+
492
+ #
493
+ # Lists all the Analysis Services servers for the given subscription.
494
+ #
495
+ # @param [Hash{String => String}] A hash of custom headers that will be added
496
+ # to the HTTP request.
497
+ #
498
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
499
+ #
500
+ def list_async(custom_headers:nil)
501
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
502
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
503
+
504
+
505
+ request_headers = {}
506
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
507
+
508
+ # Set Headers
509
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
510
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
511
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/servers'
512
+
513
+ request_url = @base_url || @client.base_url
514
+
515
+ options = {
516
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
517
+ path_params: {'subscriptionId' => @client.subscription_id},
518
+ query_params: {'api-version' => @client.api_version},
519
+ headers: request_headers.merge(custom_headers || {}),
520
+ base_url: request_url
521
+ }
522
+ promise = @client.make_request_async(:get, path_template, options)
523
+
524
+ promise = promise.then do |result|
525
+ http_response = result.response
526
+ status_code = http_response.status
527
+ response_content = http_response.body
528
+ unless status_code == 200
529
+ error_model = JSON.load(response_content)
530
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
531
+ end
532
+
533
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
534
+ # Deserialize Response
535
+ if status_code == 200
536
+ begin
537
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
538
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServers.mapper()
539
+ result.body = @client.deserialize(result_mapper, parsed_response)
540
+ rescue Exception => e
541
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
542
+ end
543
+ end
544
+
545
+ result
546
+ end
547
+
548
+ promise.execute
549
+ end
550
+
551
+ #
552
+ # Lists eligible SKUs for Analysis Services resource provider.
553
+ #
554
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
555
+ # will be added to the HTTP request.
556
+ #
557
+ # @return [SkuEnumerationForNewResourceResult] operation results.
558
+ #
559
+ def list_skus_for_new(custom_headers:nil)
560
+ response = list_skus_for_new_async(custom_headers:custom_headers).value!
561
+ response.body unless response.nil?
562
+ end
563
+
564
+ #
565
+ # Lists eligible SKUs for Analysis Services resource provider.
566
+ #
567
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
568
+ # will be added to the HTTP request.
569
+ #
570
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
571
+ #
572
+ def list_skus_for_new_with_http_info(custom_headers:nil)
573
+ list_skus_for_new_async(custom_headers:custom_headers).value!
574
+ end
575
+
576
+ #
577
+ # Lists eligible SKUs for Analysis Services resource provider.
578
+ #
579
+ # @param [Hash{String => String}] A hash of custom headers that will be added
580
+ # to the HTTP request.
581
+ #
582
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
583
+ #
584
+ def list_skus_for_new_async(custom_headers:nil)
585
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
586
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
587
+
588
+
589
+ request_headers = {}
590
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
591
+
592
+ # Set Headers
593
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
594
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
595
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/skus'
596
+
597
+ request_url = @base_url || @client.base_url
598
+
599
+ options = {
600
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
601
+ path_params: {'subscriptionId' => @client.subscription_id},
602
+ query_params: {'api-version' => @client.api_version},
603
+ headers: request_headers.merge(custom_headers || {}),
604
+ base_url: request_url
605
+ }
606
+ promise = @client.make_request_async(:get, path_template, options)
607
+
608
+ promise = promise.then do |result|
609
+ http_response = result.response
610
+ status_code = http_response.status
611
+ response_content = http_response.body
612
+ unless status_code == 200
613
+ error_model = JSON.load(response_content)
614
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
615
+ end
616
+
617
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
618
+ # Deserialize Response
619
+ if status_code == 200
620
+ begin
621
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
622
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::SkuEnumerationForNewResourceResult.mapper()
623
+ result.body = @client.deserialize(result_mapper, parsed_response)
624
+ rescue Exception => e
625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
626
+ end
627
+ end
628
+
629
+ result
630
+ end
631
+
632
+ promise.execute
633
+ end
634
+
635
+ #
636
+ # Lists eligible SKUs for an Analysis Services resource.
637
+ #
638
+ # @param resource_group_name [String] The name of the Azure Resource group of
639
+ # which a given Analysis Services server is part. This name must be at least 1
640
+ # character in length, and no more than 90.
641
+ # @param server_name [String] The name of the Analysis Services server. It must
642
+ # be at least 3 characters in length, and no more than 63.
643
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
644
+ # will be added to the HTTP request.
645
+ #
646
+ # @return [SkuEnumerationForExistingResourceResult] operation results.
647
+ #
648
+ def list_skus_for_existing(resource_group_name, server_name, custom_headers:nil)
649
+ response = list_skus_for_existing_async(resource_group_name, server_name, custom_headers:custom_headers).value!
650
+ response.body unless response.nil?
651
+ end
652
+
653
+ #
654
+ # Lists eligible SKUs for an Analysis Services resource.
655
+ #
656
+ # @param resource_group_name [String] The name of the Azure Resource group of
657
+ # which a given Analysis Services server is part. This name must be at least 1
658
+ # character in length, and no more than 90.
659
+ # @param server_name [String] The name of the Analysis Services server. It must
660
+ # be at least 3 characters in length, and no more than 63.
661
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
662
+ # will be added to the HTTP request.
663
+ #
664
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
665
+ #
666
+ def list_skus_for_existing_with_http_info(resource_group_name, server_name, custom_headers:nil)
667
+ list_skus_for_existing_async(resource_group_name, server_name, custom_headers:custom_headers).value!
668
+ end
669
+
670
+ #
671
+ # Lists eligible SKUs for an Analysis Services resource.
672
+ #
673
+ # @param resource_group_name [String] The name of the Azure Resource group of
674
+ # which a given Analysis Services server is part. This name must be at least 1
675
+ # character in length, and no more than 90.
676
+ # @param server_name [String] The name of the Analysis Services server. It must
677
+ # be at least 3 characters in length, and no more than 63.
678
+ # @param [Hash{String => String}] A hash of custom headers that will be added
679
+ # to the HTTP request.
680
+ #
681
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
682
+ #
683
+ def list_skus_for_existing_async(resource_group_name, server_name, custom_headers:nil)
684
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
685
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
686
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
687
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
688
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
689
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
690
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
691
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
692
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
693
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
694
+
695
+
696
+ request_headers = {}
697
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
698
+
699
+ # Set Headers
700
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
701
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
702
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/skus'
703
+
704
+ request_url = @base_url || @client.base_url
705
+
706
+ options = {
707
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
708
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
709
+ query_params: {'api-version' => @client.api_version},
710
+ headers: request_headers.merge(custom_headers || {}),
711
+ base_url: request_url
712
+ }
713
+ promise = @client.make_request_async(:get, path_template, options)
714
+
715
+ promise = promise.then do |result|
716
+ http_response = result.response
717
+ status_code = http_response.status
718
+ response_content = http_response.body
719
+ unless status_code == 200
720
+ error_model = JSON.load(response_content)
721
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
722
+ end
723
+
724
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
725
+ # Deserialize Response
726
+ if status_code == 200
727
+ begin
728
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
729
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::SkuEnumerationForExistingResourceResult.mapper()
730
+ result.body = @client.deserialize(result_mapper, parsed_response)
731
+ rescue Exception => e
732
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
733
+ end
734
+ end
735
+
736
+ result
737
+ end
738
+
739
+ promise.execute
740
+ end
741
+
742
+ #
743
+ # Return the gateway status of the specified Analysis Services server instance.
744
+ #
745
+ # @param resource_group_name [String] The name of the Azure Resource group of
746
+ # which a given Analysis Services server is part. This name must be at least 1
747
+ # character in length, and no more than 90.
748
+ # @param server_name [String] The name of the Analysis Services server.
749
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
750
+ # will be added to the HTTP request.
751
+ #
752
+ # @return [GatewayListStatusLive] operation results.
753
+ #
754
+ def list_gateway_status(resource_group_name, server_name, custom_headers:nil)
755
+ response = list_gateway_status_async(resource_group_name, server_name, custom_headers:custom_headers).value!
756
+ response.body unless response.nil?
757
+ end
758
+
759
+ #
760
+ # Return the gateway status of the specified Analysis Services server instance.
761
+ #
762
+ # @param resource_group_name [String] The name of the Azure Resource group of
763
+ # which a given Analysis Services server is part. This name must be at least 1
764
+ # character in length, and no more than 90.
765
+ # @param server_name [String] The name of the Analysis Services server.
766
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
767
+ # will be added to the HTTP request.
768
+ #
769
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
770
+ #
771
+ def list_gateway_status_with_http_info(resource_group_name, server_name, custom_headers:nil)
772
+ list_gateway_status_async(resource_group_name, server_name, custom_headers:custom_headers).value!
773
+ end
774
+
775
+ #
776
+ # Return the gateway status of the specified Analysis Services server instance.
777
+ #
778
+ # @param resource_group_name [String] The name of the Azure Resource group of
779
+ # which a given Analysis Services server is part. This name must be at least 1
780
+ # character in length, and no more than 90.
781
+ # @param server_name [String] The name of the Analysis Services server.
782
+ # @param [Hash{String => String}] A hash of custom headers that will be added
783
+ # to the HTTP request.
784
+ #
785
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
786
+ #
787
+ def list_gateway_status_async(resource_group_name, server_name, custom_headers:nil)
788
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
789
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
790
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
791
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
792
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
793
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
794
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
795
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
796
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
797
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
798
+
799
+
800
+ request_headers = {}
801
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
802
+
803
+ # Set Headers
804
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
805
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
806
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/listGatewayStatus'
807
+
808
+ request_url = @base_url || @client.base_url
809
+
810
+ options = {
811
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
812
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
813
+ query_params: {'api-version' => @client.api_version},
814
+ headers: request_headers.merge(custom_headers || {}),
815
+ base_url: request_url
816
+ }
817
+ promise = @client.make_request_async(:post, path_template, options)
818
+
819
+ promise = promise.then do |result|
820
+ http_response = result.response
821
+ status_code = http_response.status
822
+ response_content = http_response.body
823
+ unless status_code == 200
824
+ error_model = JSON.load(response_content)
825
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
826
+ end
827
+
828
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
829
+ # Deserialize Response
830
+ if status_code == 200
831
+ begin
832
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
833
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::GatewayListStatusLive.mapper()
834
+ result.body = @client.deserialize(result_mapper, parsed_response)
835
+ rescue Exception => e
836
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
837
+ end
838
+ end
839
+
840
+ result
841
+ end
842
+
843
+ promise.execute
844
+ end
845
+
846
+ #
847
+ # Dissociates a Unified Gateway associated with the server.
848
+ #
849
+ # @param resource_group_name [String] The name of the Azure Resource group of
850
+ # which a given Analysis Services server is part. This name must be at least 1
851
+ # character in length, and no more than 90.
852
+ # @param server_name [String] The name of the Analysis Services server. It must
853
+ # be at least 3 characters in length, and no more than 63.
854
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
855
+ # will be added to the HTTP request.
856
+ #
857
+ #
858
+ def dissociate_gateway(resource_group_name, server_name, custom_headers:nil)
859
+ response = dissociate_gateway_async(resource_group_name, server_name, custom_headers:custom_headers).value!
860
+ nil
861
+ end
862
+
863
+ #
864
+ # Dissociates a Unified Gateway associated with the server.
865
+ #
866
+ # @param resource_group_name [String] The name of the Azure Resource group of
867
+ # which a given Analysis Services server is part. This name must be at least 1
868
+ # character in length, and no more than 90.
869
+ # @param server_name [String] The name of the Analysis Services server. It must
870
+ # be at least 3 characters in length, and no more than 63.
871
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
872
+ # will be added to the HTTP request.
873
+ #
874
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
875
+ #
876
+ def dissociate_gateway_with_http_info(resource_group_name, server_name, custom_headers:nil)
877
+ dissociate_gateway_async(resource_group_name, server_name, custom_headers:custom_headers).value!
878
+ end
879
+
880
+ #
881
+ # Dissociates a Unified Gateway associated with the server.
882
+ #
883
+ # @param resource_group_name [String] The name of the Azure Resource group of
884
+ # which a given Analysis Services server is part. This name must be at least 1
885
+ # character in length, and no more than 90.
886
+ # @param server_name [String] The name of the Analysis Services server. It must
887
+ # be at least 3 characters in length, and no more than 63.
888
+ # @param [Hash{String => String}] A hash of custom headers that will be added
889
+ # to the HTTP request.
890
+ #
891
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
892
+ #
893
+ def dissociate_gateway_async(resource_group_name, server_name, custom_headers:nil)
894
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
895
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
896
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
897
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
898
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
899
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
900
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
901
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
902
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
903
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
904
+
905
+
906
+ request_headers = {}
907
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
908
+
909
+ # Set Headers
910
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
911
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
912
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/dissociateGateway'
913
+
914
+ request_url = @base_url || @client.base_url
915
+
916
+ options = {
917
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
918
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
919
+ query_params: {'api-version' => @client.api_version},
920
+ headers: request_headers.merge(custom_headers || {}),
921
+ base_url: request_url
922
+ }
923
+ promise = @client.make_request_async(:post, path_template, options)
924
+
925
+ promise = promise.then do |result|
926
+ http_response = result.response
927
+ status_code = http_response.status
928
+ response_content = http_response.body
929
+ unless status_code == 200
930
+ error_model = JSON.load(response_content)
931
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
932
+ end
933
+
934
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
935
+
936
+ result
937
+ end
938
+
939
+ promise.execute
940
+ end
941
+
942
+ #
943
+ # Check the name availability in the target location.
944
+ #
945
+ # @param location [String] The region name which the operation will lookup
946
+ # into.
947
+ # @param server_parameters [CheckServerNameAvailabilityParameters] Contains the
948
+ # information used to provision the Analysis Services server.
949
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
950
+ # will be added to the HTTP request.
951
+ #
952
+ # @return [CheckServerNameAvailabilityResult] operation results.
953
+ #
954
+ def check_name_availability(location, server_parameters, custom_headers:nil)
955
+ response = check_name_availability_async(location, server_parameters, custom_headers:custom_headers).value!
956
+ response.body unless response.nil?
957
+ end
958
+
959
+ #
960
+ # Check the name availability in the target location.
961
+ #
962
+ # @param location [String] The region name which the operation will lookup
963
+ # into.
964
+ # @param server_parameters [CheckServerNameAvailabilityParameters] Contains the
965
+ # information used to provision the Analysis Services server.
966
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
967
+ # will be added to the HTTP request.
968
+ #
969
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
970
+ #
971
+ def check_name_availability_with_http_info(location, server_parameters, custom_headers:nil)
972
+ check_name_availability_async(location, server_parameters, custom_headers:custom_headers).value!
973
+ end
974
+
975
+ #
976
+ # Check the name availability in the target location.
977
+ #
978
+ # @param location [String] The region name which the operation will lookup
979
+ # into.
980
+ # @param server_parameters [CheckServerNameAvailabilityParameters] Contains the
981
+ # information used to provision the Analysis Services server.
982
+ # @param [Hash{String => String}] A hash of custom headers that will be added
983
+ # to the HTTP request.
984
+ #
985
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
986
+ #
987
+ def check_name_availability_async(location, server_parameters, custom_headers:nil)
988
+ fail ArgumentError, 'location is nil' if location.nil?
989
+ fail ArgumentError, 'server_parameters is nil' if server_parameters.nil?
990
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
991
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
992
+
993
+
994
+ request_headers = {}
995
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
996
+
997
+ # Set Headers
998
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
999
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1000
+
1001
+ # Serialize Request
1002
+ request_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::CheckServerNameAvailabilityParameters.mapper()
1003
+ request_content = @client.serialize(request_mapper, server_parameters)
1004
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1005
+
1006
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/checkNameAvailability'
1007
+
1008
+ request_url = @base_url || @client.base_url
1009
+
1010
+ options = {
1011
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1012
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
1013
+ query_params: {'api-version' => @client.api_version},
1014
+ body: request_content,
1015
+ headers: request_headers.merge(custom_headers || {}),
1016
+ base_url: request_url
1017
+ }
1018
+ promise = @client.make_request_async(:post, path_template, options)
1019
+
1020
+ promise = promise.then do |result|
1021
+ http_response = result.response
1022
+ status_code = http_response.status
1023
+ response_content = http_response.body
1024
+ unless status_code == 200
1025
+ error_model = JSON.load(response_content)
1026
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1027
+ end
1028
+
1029
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1030
+ # Deserialize Response
1031
+ if status_code == 200
1032
+ begin
1033
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1034
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::CheckServerNameAvailabilityResult.mapper()
1035
+ result.body = @client.deserialize(result_mapper, parsed_response)
1036
+ rescue Exception => e
1037
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1038
+ end
1039
+ end
1040
+
1041
+ result
1042
+ end
1043
+
1044
+ promise.execute
1045
+ end
1046
+
1047
+ #
1048
+ # List the result of the specified operation.
1049
+ #
1050
+ # @param location [String] The region name which the operation will lookup
1051
+ # into.
1052
+ # @param operation_id [String] The target operation Id.
1053
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1054
+ # will be added to the HTTP request.
1055
+ #
1056
+ #
1057
+ def list_operation_results(location, operation_id, custom_headers:nil)
1058
+ response = list_operation_results_async(location, operation_id, custom_headers:custom_headers).value!
1059
+ nil
1060
+ end
1061
+
1062
+ #
1063
+ # List the result of the specified operation.
1064
+ #
1065
+ # @param location [String] The region name which the operation will lookup
1066
+ # into.
1067
+ # @param operation_id [String] The target operation Id.
1068
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1069
+ # will be added to the HTTP request.
1070
+ #
1071
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1072
+ #
1073
+ def list_operation_results_with_http_info(location, operation_id, custom_headers:nil)
1074
+ list_operation_results_async(location, operation_id, custom_headers:custom_headers).value!
1075
+ end
1076
+
1077
+ #
1078
+ # List the result of the specified operation.
1079
+ #
1080
+ # @param location [String] The region name which the operation will lookup
1081
+ # into.
1082
+ # @param operation_id [String] The target operation Id.
1083
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1084
+ # to the HTTP request.
1085
+ #
1086
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1087
+ #
1088
+ def list_operation_results_async(location, operation_id, custom_headers:nil)
1089
+ fail ArgumentError, 'location is nil' if location.nil?
1090
+ fail ArgumentError, 'operation_id is nil' if operation_id.nil?
1091
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1092
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1093
+
1094
+
1095
+ request_headers = {}
1096
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1097
+
1098
+ # Set Headers
1099
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1100
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1101
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/operationresults/{operationId}'
1102
+
1103
+ request_url = @base_url || @client.base_url
1104
+
1105
+ options = {
1106
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1107
+ path_params: {'location' => location,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
1108
+ query_params: {'api-version' => @client.api_version},
1109
+ headers: request_headers.merge(custom_headers || {}),
1110
+ base_url: request_url
1111
+ }
1112
+ promise = @client.make_request_async(:get, path_template, options)
1113
+
1114
+ promise = promise.then do |result|
1115
+ http_response = result.response
1116
+ status_code = http_response.status
1117
+ response_content = http_response.body
1118
+ unless status_code == 200 || status_code == 202
1119
+ error_model = JSON.load(response_content)
1120
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1121
+ end
1122
+
1123
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1124
+
1125
+ result
1126
+ end
1127
+
1128
+ promise.execute
1129
+ end
1130
+
1131
+ #
1132
+ # List the status of operation.
1133
+ #
1134
+ # @param location [String] The region name which the operation will lookup
1135
+ # into.
1136
+ # @param operation_id [String] The target operation Id.
1137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1138
+ # will be added to the HTTP request.
1139
+ #
1140
+ # @return [OperationStatus] operation results.
1141
+ #
1142
+ def list_operation_statuses(location, operation_id, custom_headers:nil)
1143
+ response = list_operation_statuses_async(location, operation_id, custom_headers:custom_headers).value!
1144
+ response.body unless response.nil?
1145
+ end
1146
+
1147
+ #
1148
+ # List the status of operation.
1149
+ #
1150
+ # @param location [String] The region name which the operation will lookup
1151
+ # into.
1152
+ # @param operation_id [String] The target operation Id.
1153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1154
+ # will be added to the HTTP request.
1155
+ #
1156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1157
+ #
1158
+ def list_operation_statuses_with_http_info(location, operation_id, custom_headers:nil)
1159
+ list_operation_statuses_async(location, operation_id, custom_headers:custom_headers).value!
1160
+ end
1161
+
1162
+ #
1163
+ # List the status of operation.
1164
+ #
1165
+ # @param location [String] The region name which the operation will lookup
1166
+ # into.
1167
+ # @param operation_id [String] The target operation Id.
1168
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1169
+ # to the HTTP request.
1170
+ #
1171
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1172
+ #
1173
+ def list_operation_statuses_async(location, operation_id, custom_headers:nil)
1174
+ fail ArgumentError, 'location is nil' if location.nil?
1175
+ fail ArgumentError, 'operation_id is nil' if operation_id.nil?
1176
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1177
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1178
+
1179
+
1180
+ request_headers = {}
1181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1182
+
1183
+ # Set Headers
1184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1186
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/operationstatuses/{operationId}'
1187
+
1188
+ request_url = @base_url || @client.base_url
1189
+
1190
+ options = {
1191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1192
+ path_params: {'location' => location,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
1193
+ query_params: {'api-version' => @client.api_version},
1194
+ headers: request_headers.merge(custom_headers || {}),
1195
+ base_url: request_url
1196
+ }
1197
+ promise = @client.make_request_async(:get, path_template, options)
1198
+
1199
+ promise = promise.then do |result|
1200
+ http_response = result.response
1201
+ status_code = http_response.status
1202
+ response_content = http_response.body
1203
+ unless status_code == 200 || status_code == 202
1204
+ error_model = JSON.load(response_content)
1205
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1206
+ end
1207
+
1208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1209
+ # Deserialize Response
1210
+ if status_code == 200
1211
+ begin
1212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1213
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::OperationStatus.mapper()
1214
+ result.body = @client.deserialize(result_mapper, parsed_response)
1215
+ rescue Exception => e
1216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1217
+ end
1218
+ end
1219
+ # Deserialize Response
1220
+ if status_code == 202
1221
+ begin
1222
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1223
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::OperationStatus.mapper()
1224
+ result.body = @client.deserialize(result_mapper, parsed_response)
1225
+ rescue Exception => e
1226
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1227
+ end
1228
+ end
1229
+
1230
+ result
1231
+ end
1232
+
1233
+ promise.execute
1234
+ end
1235
+
1236
+ #
1237
+ # Provisions the specified Analysis Services server based on the configuration
1238
+ # specified in the request.
1239
+ #
1240
+ # @param resource_group_name [String] The name of the Azure Resource group of
1241
+ # which a given Analysis Services server is part. This name must be at least 1
1242
+ # character in length, and no more than 90.
1243
+ # @param server_name [String] The name of the Analysis Services server. It must
1244
+ # be a minimum of 3 characters, and a maximum of 63.
1245
+ # @param server_parameters [AnalysisServicesServer] Contains the information
1246
+ # used to provision the Analysis Services server.
1247
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1248
+ # will be added to the HTTP request.
1249
+ #
1250
+ # @return [AnalysisServicesServer] operation results.
1251
+ #
1252
+ def begin_create(resource_group_name, server_name, server_parameters, custom_headers:nil)
1253
+ response = begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
1254
+ response.body unless response.nil?
1255
+ end
1256
+
1257
+ #
1258
+ # Provisions the specified Analysis Services server based on the configuration
1259
+ # specified in the request.
1260
+ #
1261
+ # @param resource_group_name [String] The name of the Azure Resource group of
1262
+ # which a given Analysis Services server is part. This name must be at least 1
1263
+ # character in length, and no more than 90.
1264
+ # @param server_name [String] The name of the Analysis Services server. It must
1265
+ # be a minimum of 3 characters, and a maximum of 63.
1266
+ # @param server_parameters [AnalysisServicesServer] Contains the information
1267
+ # used to provision the Analysis Services server.
1268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1269
+ # will be added to the HTTP request.
1270
+ #
1271
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1272
+ #
1273
+ def begin_create_with_http_info(resource_group_name, server_name, server_parameters, custom_headers:nil)
1274
+ begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
1275
+ end
1276
+
1277
+ #
1278
+ # Provisions the specified Analysis Services server based on the configuration
1279
+ # specified in the request.
1280
+ #
1281
+ # @param resource_group_name [String] The name of the Azure Resource group of
1282
+ # which a given Analysis Services server is part. This name must be at least 1
1283
+ # character in length, and no more than 90.
1284
+ # @param server_name [String] The name of the Analysis Services server. It must
1285
+ # be a minimum of 3 characters, and a maximum of 63.
1286
+ # @param server_parameters [AnalysisServicesServer] Contains the information
1287
+ # used to provision the Analysis Services server.
1288
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1289
+ # to the HTTP request.
1290
+ #
1291
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1292
+ #
1293
+ def begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:nil)
1294
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1295
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1296
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1297
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1298
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1299
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
1300
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
1301
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1302
+ fail ArgumentError, 'server_parameters is nil' if server_parameters.nil?
1303
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1304
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1305
+
1306
+
1307
+ request_headers = {}
1308
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1309
+
1310
+ # Set Headers
1311
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1312
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1313
+
1314
+ # Serialize Request
1315
+ request_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
1316
+ request_content = @client.serialize(request_mapper, server_parameters)
1317
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1318
+
1319
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}'
1320
+
1321
+ request_url = @base_url || @client.base_url
1322
+
1323
+ options = {
1324
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1325
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1326
+ query_params: {'api-version' => @client.api_version},
1327
+ body: request_content,
1328
+ headers: request_headers.merge(custom_headers || {}),
1329
+ base_url: request_url
1330
+ }
1331
+ promise = @client.make_request_async(:put, path_template, options)
1332
+
1333
+ promise = promise.then do |result|
1334
+ http_response = result.response
1335
+ status_code = http_response.status
1336
+ response_content = http_response.body
1337
+ unless status_code == 200 || status_code == 201
1338
+ error_model = JSON.load(response_content)
1339
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1340
+ end
1341
+
1342
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1343
+ # Deserialize Response
1344
+ if status_code == 200
1345
+ begin
1346
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1347
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
1348
+ result.body = @client.deserialize(result_mapper, parsed_response)
1349
+ rescue Exception => e
1350
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1351
+ end
1352
+ end
1353
+ # Deserialize Response
1354
+ if status_code == 201
1355
+ begin
1356
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1357
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
1358
+ result.body = @client.deserialize(result_mapper, parsed_response)
1359
+ rescue Exception => e
1360
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1361
+ end
1362
+ end
1363
+
1364
+ result
1365
+ end
1366
+
1367
+ promise.execute
1368
+ end
1369
+
1370
+ #
1371
+ # Deletes the specified Analysis Services server.
1372
+ #
1373
+ # @param resource_group_name [String] The name of the Azure Resource group of
1374
+ # which a given Analysis Services server is part. This name must be at least 1
1375
+ # character in length, and no more than 90.
1376
+ # @param server_name [String] The name of the Analysis Services server. It must
1377
+ # be at least 3 characters in length, and no more than 63.
1378
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1379
+ # will be added to the HTTP request.
1380
+ #
1381
+ #
1382
+ def begin_delete(resource_group_name, server_name, custom_headers:nil)
1383
+ response = begin_delete_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1384
+ nil
1385
+ end
1386
+
1387
+ #
1388
+ # Deletes the specified Analysis Services server.
1389
+ #
1390
+ # @param resource_group_name [String] The name of the Azure Resource group of
1391
+ # which a given Analysis Services server is part. This name must be at least 1
1392
+ # character in length, and no more than 90.
1393
+ # @param server_name [String] The name of the Analysis Services server. It must
1394
+ # be at least 3 characters in length, and no more than 63.
1395
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1396
+ # will be added to the HTTP request.
1397
+ #
1398
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1399
+ #
1400
+ def begin_delete_with_http_info(resource_group_name, server_name, custom_headers:nil)
1401
+ begin_delete_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1402
+ end
1403
+
1404
+ #
1405
+ # Deletes the specified Analysis Services server.
1406
+ #
1407
+ # @param resource_group_name [String] The name of the Azure Resource group of
1408
+ # which a given Analysis Services server is part. This name must be at least 1
1409
+ # character in length, and no more than 90.
1410
+ # @param server_name [String] The name of the Analysis Services server. It must
1411
+ # be at least 3 characters in length, and no more than 63.
1412
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1413
+ # to the HTTP request.
1414
+ #
1415
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1416
+ #
1417
+ def begin_delete_async(resource_group_name, server_name, custom_headers:nil)
1418
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1419
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1420
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1421
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1422
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1423
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
1424
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
1425
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1426
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1427
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1428
+
1429
+
1430
+ request_headers = {}
1431
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1432
+
1433
+ # Set Headers
1434
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1435
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1436
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}'
1437
+
1438
+ request_url = @base_url || @client.base_url
1439
+
1440
+ options = {
1441
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1442
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1443
+ query_params: {'api-version' => @client.api_version},
1444
+ headers: request_headers.merge(custom_headers || {}),
1445
+ base_url: request_url
1446
+ }
1447
+ promise = @client.make_request_async(:delete, path_template, options)
1448
+
1449
+ promise = promise.then do |result|
1450
+ http_response = result.response
1451
+ status_code = http_response.status
1452
+ response_content = http_response.body
1453
+ unless status_code == 200 || status_code == 204 || status_code == 202
1454
+ error_model = JSON.load(response_content)
1455
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1456
+ end
1457
+
1458
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1459
+
1460
+ result
1461
+ end
1462
+
1463
+ promise.execute
1464
+ end
1465
+
1466
+ #
1467
+ # Updates the current state of the specified Analysis Services server.
1468
+ #
1469
+ # @param resource_group_name [String] The name of the Azure Resource group of
1470
+ # which a given Analysis Services server is part. This name must be at least 1
1471
+ # character in length, and no more than 90.
1472
+ # @param server_name [String] The name of the Analysis Services server. It must
1473
+ # be at least 3 characters in length, and no more than 63.
1474
+ # @param server_update_parameters [AnalysisServicesServerUpdateParameters]
1475
+ # Request object that contains the updated information for the server.
1476
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1477
+ # will be added to the HTTP request.
1478
+ #
1479
+ # @return [AnalysisServicesServer] operation results.
1480
+ #
1481
+ def begin_update(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
1482
+ response = begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
1483
+ response.body unless response.nil?
1484
+ end
1485
+
1486
+ #
1487
+ # Updates the current state of the specified Analysis Services server.
1488
+ #
1489
+ # @param resource_group_name [String] The name of the Azure Resource group of
1490
+ # which a given Analysis Services server is part. This name must be at least 1
1491
+ # character in length, and no more than 90.
1492
+ # @param server_name [String] The name of the Analysis Services server. It must
1493
+ # be at least 3 characters in length, and no more than 63.
1494
+ # @param server_update_parameters [AnalysisServicesServerUpdateParameters]
1495
+ # Request object that contains the updated information for the server.
1496
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1497
+ # will be added to the HTTP request.
1498
+ #
1499
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1500
+ #
1501
+ def begin_update_with_http_info(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
1502
+ begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
1503
+ end
1504
+
1505
+ #
1506
+ # Updates the current state of the specified Analysis Services server.
1507
+ #
1508
+ # @param resource_group_name [String] The name of the Azure Resource group of
1509
+ # which a given Analysis Services server is part. This name must be at least 1
1510
+ # character in length, and no more than 90.
1511
+ # @param server_name [String] The name of the Analysis Services server. It must
1512
+ # be at least 3 characters in length, and no more than 63.
1513
+ # @param server_update_parameters [AnalysisServicesServerUpdateParameters]
1514
+ # Request object that contains the updated information for the server.
1515
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1516
+ # to the HTTP request.
1517
+ #
1518
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1519
+ #
1520
+ def begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
1521
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1522
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1523
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1524
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1525
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1526
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
1527
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
1528
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1529
+ fail ArgumentError, 'server_update_parameters is nil' if server_update_parameters.nil?
1530
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1531
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1532
+
1533
+
1534
+ request_headers = {}
1535
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1536
+
1537
+ # Set Headers
1538
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1539
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1540
+
1541
+ # Serialize Request
1542
+ request_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServerUpdateParameters.mapper()
1543
+ request_content = @client.serialize(request_mapper, server_update_parameters)
1544
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1545
+
1546
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}'
1547
+
1548
+ request_url = @base_url || @client.base_url
1549
+
1550
+ options = {
1551
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1552
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1553
+ query_params: {'api-version' => @client.api_version},
1554
+ body: request_content,
1555
+ headers: request_headers.merge(custom_headers || {}),
1556
+ base_url: request_url
1557
+ }
1558
+ promise = @client.make_request_async(:patch, path_template, options)
1559
+
1560
+ promise = promise.then do |result|
1561
+ http_response = result.response
1562
+ status_code = http_response.status
1563
+ response_content = http_response.body
1564
+ unless status_code == 200 || status_code == 202
1565
+ error_model = JSON.load(response_content)
1566
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1567
+ end
1568
+
1569
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1570
+ # Deserialize Response
1571
+ if status_code == 200
1572
+ begin
1573
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1574
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
1575
+ result.body = @client.deserialize(result_mapper, parsed_response)
1576
+ rescue Exception => e
1577
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1578
+ end
1579
+ end
1580
+ # Deserialize Response
1581
+ if status_code == 202
1582
+ begin
1583
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1584
+ result_mapper = Azure::AnalysisServices::Mgmt::V2017_08_01_beta::Models::AnalysisServicesServer.mapper()
1585
+ result.body = @client.deserialize(result_mapper, parsed_response)
1586
+ rescue Exception => e
1587
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1588
+ end
1589
+ end
1590
+
1591
+ result
1592
+ end
1593
+
1594
+ promise.execute
1595
+ end
1596
+
1597
+ #
1598
+ # Supends operation of the specified Analysis Services server instance.
1599
+ #
1600
+ # @param resource_group_name [String] The name of the Azure Resource group of
1601
+ # which a given Analysis Services server is part. This name must be at least 1
1602
+ # character in length, and no more than 90.
1603
+ # @param server_name [String] The name of the Analysis Services server. It must
1604
+ # be at least 3 characters in length, and no more than 63.
1605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1606
+ # will be added to the HTTP request.
1607
+ #
1608
+ #
1609
+ def begin_suspend(resource_group_name, server_name, custom_headers:nil)
1610
+ response = begin_suspend_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1611
+ nil
1612
+ end
1613
+
1614
+ #
1615
+ # Supends operation of the specified Analysis Services server instance.
1616
+ #
1617
+ # @param resource_group_name [String] The name of the Azure Resource group of
1618
+ # which a given Analysis Services server is part. This name must be at least 1
1619
+ # character in length, and no more than 90.
1620
+ # @param server_name [String] The name of the Analysis Services server. It must
1621
+ # be at least 3 characters in length, and no more than 63.
1622
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1623
+ # will be added to the HTTP request.
1624
+ #
1625
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1626
+ #
1627
+ def begin_suspend_with_http_info(resource_group_name, server_name, custom_headers:nil)
1628
+ begin_suspend_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1629
+ end
1630
+
1631
+ #
1632
+ # Supends operation of the specified Analysis Services server instance.
1633
+ #
1634
+ # @param resource_group_name [String] The name of the Azure Resource group of
1635
+ # which a given Analysis Services server is part. This name must be at least 1
1636
+ # character in length, and no more than 90.
1637
+ # @param server_name [String] The name of the Analysis Services server. It must
1638
+ # be at least 3 characters in length, and no more than 63.
1639
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1640
+ # to the HTTP request.
1641
+ #
1642
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1643
+ #
1644
+ def begin_suspend_async(resource_group_name, server_name, custom_headers:nil)
1645
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1646
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1647
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1648
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1649
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1650
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
1651
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
1652
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1653
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1654
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1655
+
1656
+
1657
+ request_headers = {}
1658
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1659
+
1660
+ # Set Headers
1661
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1662
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1663
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/suspend'
1664
+
1665
+ request_url = @base_url || @client.base_url
1666
+
1667
+ options = {
1668
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1669
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1670
+ query_params: {'api-version' => @client.api_version},
1671
+ headers: request_headers.merge(custom_headers || {}),
1672
+ base_url: request_url
1673
+ }
1674
+ promise = @client.make_request_async(:post, path_template, options)
1675
+
1676
+ promise = promise.then do |result|
1677
+ http_response = result.response
1678
+ status_code = http_response.status
1679
+ response_content = http_response.body
1680
+ unless status_code == 200 || status_code == 202
1681
+ error_model = JSON.load(response_content)
1682
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1683
+ end
1684
+
1685
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1686
+
1687
+ result
1688
+ end
1689
+
1690
+ promise.execute
1691
+ end
1692
+
1693
+ #
1694
+ # Resumes operation of the specified Analysis Services server instance.
1695
+ #
1696
+ # @param resource_group_name [String] The name of the Azure Resource group of
1697
+ # which a given Analysis Services server is part. This name must be at least 1
1698
+ # character in length, and no more than 90.
1699
+ # @param server_name [String] The name of the Analysis Services server. It must
1700
+ # be at least 3 characters in length, and no more than 63.
1701
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1702
+ # will be added to the HTTP request.
1703
+ #
1704
+ #
1705
+ def begin_resume(resource_group_name, server_name, custom_headers:nil)
1706
+ response = begin_resume_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1707
+ nil
1708
+ end
1709
+
1710
+ #
1711
+ # Resumes operation of the specified Analysis Services server instance.
1712
+ #
1713
+ # @param resource_group_name [String] The name of the Azure Resource group of
1714
+ # which a given Analysis Services server is part. This name must be at least 1
1715
+ # character in length, and no more than 90.
1716
+ # @param server_name [String] The name of the Analysis Services server. It must
1717
+ # be at least 3 characters in length, and no more than 63.
1718
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1719
+ # will be added to the HTTP request.
1720
+ #
1721
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1722
+ #
1723
+ def begin_resume_with_http_info(resource_group_name, server_name, custom_headers:nil)
1724
+ begin_resume_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1725
+ end
1726
+
1727
+ #
1728
+ # Resumes operation of the specified Analysis Services server instance.
1729
+ #
1730
+ # @param resource_group_name [String] The name of the Azure Resource group of
1731
+ # which a given Analysis Services server is part. This name must be at least 1
1732
+ # character in length, and no more than 90.
1733
+ # @param server_name [String] The name of the Analysis Services server. It must
1734
+ # be at least 3 characters in length, and no more than 63.
1735
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1736
+ # to the HTTP request.
1737
+ #
1738
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1739
+ #
1740
+ def begin_resume_async(resource_group_name, server_name, custom_headers:nil)
1741
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1742
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1743
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1744
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1745
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1746
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MaxLength': '63'" if !server_name.nil? && server_name.length > 63
1747
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'MinLength': '3'" if !server_name.nil? && server_name.length < 3
1748
+ fail ArgumentError, "'server_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !server_name.nil? && server_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1749
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1750
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1751
+
1752
+
1753
+ request_headers = {}
1754
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1755
+
1756
+ # Set Headers
1757
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1758
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1759
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/resume'
1760
+
1761
+ request_url = @base_url || @client.base_url
1762
+
1763
+ options = {
1764
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1765
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1766
+ query_params: {'api-version' => @client.api_version},
1767
+ headers: request_headers.merge(custom_headers || {}),
1768
+ base_url: request_url
1769
+ }
1770
+ promise = @client.make_request_async(:post, path_template, options)
1771
+
1772
+ promise = promise.then do |result|
1773
+ http_response = result.response
1774
+ status_code = http_response.status
1775
+ response_content = http_response.body
1776
+ unless status_code == 200 || status_code == 202
1777
+ error_model = JSON.load(response_content)
1778
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1779
+ end
1780
+
1781
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1782
+
1783
+ result
1784
+ end
1785
+
1786
+ promise.execute
1787
+ end
1788
+
1789
+ end
1790
+ end