azure_mgmt_kusto 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto.rb +70 -0
  4. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/clusters.rb +1281 -0
  5. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/databases.rb +1131 -0
  6. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/event_hub_connections.rb +854 -0
  7. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/kusto_management_client.rb +145 -0
  8. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_capacity.rb +81 -0
  9. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_entity_resource.rb +75 -0
  10. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_resource_sku.rb +71 -0
  11. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_scale_type.rb +17 -0
  12. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_sku.rb +72 -0
  13. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_sku_name.rb +22 -0
  14. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/check_name_result.rb +71 -0
  15. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster.rb +183 -0
  16. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster_check_name_request.rb +61 -0
  17. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster_list_result.rb +55 -0
  18. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster_update.rb +188 -0
  19. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/data_format.rb +17 -0
  20. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database.rb +148 -0
  21. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_check_name_request.rb +62 -0
  22. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_list_result.rb +55 -0
  23. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal.rb +106 -0
  24. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_list_request.rb +56 -0
  25. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_list_result.rb +56 -0
  26. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_role.rb +20 -0
  27. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_type.rb +17 -0
  28. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_statistics.rb +48 -0
  29. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_update.rb +135 -0
  30. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection.rb +133 -0
  31. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_list_result.rb +56 -0
  32. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_update.rb +133 -0
  33. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_validation.rb +106 -0
  34. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_list_result.rb +56 -0
  35. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_result.rb +48 -0
  36. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/list_resource_skus_result.rb +56 -0
  37. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/list_skus_result.rb +56 -0
  38. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/operation.rb +82 -0
  39. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/operation_display.rb +80 -0
  40. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/operation_list_result.rb +98 -0
  41. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/provisioning_state.rb +19 -0
  42. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/proxy_resource.rb +63 -0
  43. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/resource.rb +83 -0
  44. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/state.rb +22 -0
  45. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/tracked_resource.rb +92 -0
  46. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/trusted_external_tenant.rb +47 -0
  47. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/module_definition.rb +9 -0
  48. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/operations.rb +217 -0
  49. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto.rb +70 -0
  50. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/clusters.rb +1281 -0
  51. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/databases.rb +1131 -0
  52. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/event_hub_connections.rb +854 -0
  53. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/kusto_management_client.rb +145 -0
  54. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_capacity.rb +81 -0
  55. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_entity_resource.rb +75 -0
  56. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_resource_sku.rb +71 -0
  57. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_scale_type.rb +17 -0
  58. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_sku.rb +72 -0
  59. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_sku_name.rb +22 -0
  60. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/check_name_result.rb +71 -0
  61. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster.rb +183 -0
  62. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_check_name_request.rb +61 -0
  63. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_list_result.rb +55 -0
  64. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_update.rb +188 -0
  65. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/data_format.rb +17 -0
  66. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database.rb +148 -0
  67. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_check_name_request.rb +62 -0
  68. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_list_result.rb +55 -0
  69. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal.rb +106 -0
  70. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_list_request.rb +56 -0
  71. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_list_result.rb +56 -0
  72. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_role.rb +20 -0
  73. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_type.rb +17 -0
  74. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_statistics.rb +48 -0
  75. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_update.rb +135 -0
  76. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection.rb +133 -0
  77. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_list_result.rb +56 -0
  78. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_update.rb +133 -0
  79. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation.rb +106 -0
  80. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_list_result.rb +56 -0
  81. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_result.rb +48 -0
  82. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/list_resource_skus_result.rb +56 -0
  83. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/list_skus_result.rb +56 -0
  84. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/operation.rb +82 -0
  85. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/operation_display.rb +80 -0
  86. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/operation_list_result.rb +98 -0
  87. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/provisioning_state.rb +19 -0
  88. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/proxy_resource.rb +63 -0
  89. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/resource.rb +83 -0
  90. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/state.rb +22 -0
  91. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/tracked_resource.rb +92 -0
  92. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/trusted_external_tenant.rb +47 -0
  93. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/module_definition.rb +9 -0
  94. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/operations.rb +217 -0
  95. data/lib/azure_mgmt_kusto.rb +7 -0
  96. data/lib/module_definition.rb +8 -0
  97. data/lib/profiles/latest/kusto_latest_profile_client.rb +40 -0
  98. data/lib/profiles/latest/kusto_module_definition.rb +8 -0
  99. data/lib/profiles/latest/modules/kusto_profile_module.rb +223 -0
  100. data/lib/version.rb +7 -0
  101. metadata +218 -0
@@ -0,0 +1,92 @@
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::Kusto::Mgmt::V2018_09_07_privatepreview
7
+ module Models
8
+ #
9
+ # The resource model definition for a ARM tracked top level resource
10
+ #
11
+ class TrackedResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] Resource tags.
16
+ attr_accessor :tags
17
+
18
+ # @return [String] The geo-location where the resource lives
19
+ attr_accessor :location
20
+
21
+
22
+ #
23
+ # Mapper for TrackedResource class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'TrackedResource',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'TrackedResource',
34
+ model_properties: {
35
+ id: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'id',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ name: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'name',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ },
53
+ type: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'type',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ tags: {
63
+ client_side_validation: true,
64
+ required: false,
65
+ serialized_name: 'tags',
66
+ type: {
67
+ name: 'Dictionary',
68
+ value: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'StringElementType',
72
+ type: {
73
+ name: 'String'
74
+ }
75
+ }
76
+ }
77
+ },
78
+ location: {
79
+ client_side_validation: true,
80
+ required: true,
81
+ serialized_name: 'location',
82
+ type: {
83
+ name: 'String'
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Kusto::Mgmt::V2018_09_07_privatepreview
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class TrustedExternalTenant
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] GUID representing an external tenant.
17
+ attr_accessor :value
18
+
19
+
20
+ #
21
+ # Mapper for TrustedExternalTenant class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'TrustedExternalTenant',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'TrustedExternalTenant',
32
+ model_properties: {
33
+ value: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'value',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ end
45
+ end
46
+ end
47
+ 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::Kusto end
8
+ module Azure::Kusto::Mgmt end
9
+ module Azure::Kusto::Mgmt::V2018_09_07_privatepreview 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::Kusto::Mgmt::V2018_09_07_privatepreview
7
+ #
8
+ # The Azure Kusto management API provides a RESTful set of web services that
9
+ # interact with Azure Kusto services to manage your clusters and databases.
10
+ # The API enables you to create, update, and delete clusters and databases.
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 [KustoManagementClient] reference to the KustoManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Lists available operations for the Microsoft.Kusto provider.
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 available operations for the Microsoft.Kusto provider.
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 available operations for the Microsoft.Kusto provider.
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.Kusto/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 MsRestAzure::AzureOperationError.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::Kusto::Mgmt::V2018_09_07_privatepreview::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 available operations for the Microsoft.Kusto provider.
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 available operations for the Microsoft.Kusto provider.
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 available operations for the Microsoft.Kusto provider.
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 MsRestAzure::AzureOperationError.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::Kusto::Mgmt::V2018_09_07_privatepreview::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 available operations for the Microsoft.Kusto provider.
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,70 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2018-09-07-preview/generated/azure_mgmt_kusto/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Kusto::Mgmt::V2018_09_07_preview
23
+ autoload :Clusters, '2018-09-07-preview/generated/azure_mgmt_kusto/clusters.rb'
24
+ autoload :Databases, '2018-09-07-preview/generated/azure_mgmt_kusto/databases.rb'
25
+ autoload :EventHubConnections, '2018-09-07-preview/generated/azure_mgmt_kusto/event_hub_connections.rb'
26
+ autoload :Operations, '2018-09-07-preview/generated/azure_mgmt_kusto/operations.rb'
27
+ autoload :KustoManagementClient, '2018-09-07-preview/generated/azure_mgmt_kusto/kusto_management_client.rb'
28
+
29
+ module Models
30
+ autoload :DatabasePrincipalListResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_list_result.rb'
31
+ autoload :DatabasePrincipalListRequest, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_list_request.rb'
32
+ autoload :AzureSku, '2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_sku.rb'
33
+ autoload :EventHubConnectionValidationListResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_list_result.rb'
34
+ autoload :AzureResourceSku, '2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_resource_sku.rb'
35
+ autoload :EventHubConnectionListResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_list_result.rb'
36
+ autoload :EventHubConnectionValidation, '2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation.rb'
37
+ autoload :TrustedExternalTenant, '2018-09-07-preview/generated/azure_mgmt_kusto/models/trusted_external_tenant.rb'
38
+ autoload :AzureCapacity, '2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_capacity.rb'
39
+ autoload :OperationListResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/operation_list_result.rb'
40
+ autoload :DatabaseStatistics, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_statistics.rb'
41
+ autoload :Operation, '2018-09-07-preview/generated/azure_mgmt_kusto/models/operation.rb'
42
+ autoload :OperationDisplay, '2018-09-07-preview/generated/azure_mgmt_kusto/models/operation_display.rb'
43
+ autoload :ListResourceSkusResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/list_resource_skus_result.rb'
44
+ autoload :ClusterListResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_list_result.rb'
45
+ autoload :ListSkusResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/list_skus_result.rb'
46
+ autoload :Resource, '2018-09-07-preview/generated/azure_mgmt_kusto/models/resource.rb'
47
+ autoload :EventHubConnectionValidationResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_result.rb'
48
+ autoload :ClusterCheckNameRequest, '2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_check_name_request.rb'
49
+ autoload :DatabasePrincipal, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal.rb'
50
+ autoload :DatabaseCheckNameRequest, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_check_name_request.rb'
51
+ autoload :DatabaseListResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_list_result.rb'
52
+ autoload :CheckNameResult, '2018-09-07-preview/generated/azure_mgmt_kusto/models/check_name_result.rb'
53
+ autoload :Cluster, '2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster.rb'
54
+ autoload :ClusterUpdate, '2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_update.rb'
55
+ autoload :Database, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database.rb'
56
+ autoload :DatabaseUpdate, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_update.rb'
57
+ autoload :EventHubConnectionUpdate, '2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_update.rb'
58
+ autoload :EventHubConnection, '2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection.rb'
59
+ autoload :TrackedResource, '2018-09-07-preview/generated/azure_mgmt_kusto/models/tracked_resource.rb'
60
+ autoload :AzureEntityResource, '2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_entity_resource.rb'
61
+ autoload :ProxyResource, '2018-09-07-preview/generated/azure_mgmt_kusto/models/proxy_resource.rb'
62
+ autoload :State, '2018-09-07-preview/generated/azure_mgmt_kusto/models/state.rb'
63
+ autoload :ProvisioningState, '2018-09-07-preview/generated/azure_mgmt_kusto/models/provisioning_state.rb'
64
+ autoload :AzureSkuName, '2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_sku_name.rb'
65
+ autoload :AzureScaleType, '2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_scale_type.rb'
66
+ autoload :DataFormat, '2018-09-07-preview/generated/azure_mgmt_kusto/models/data_format.rb'
67
+ autoload :DatabasePrincipalRole, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_role.rb'
68
+ autoload :DatabasePrincipalType, '2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_type.rb'
69
+ end
70
+ end
@@ -0,0 +1,1281 @@
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::Kusto::Mgmt::V2018_09_07_preview
7
+ #
8
+ # The Azure Kusto management API provides a RESTful set of web services that
9
+ # interact with Azure Kusto services to manage your clusters and databases.
10
+ # The API enables you to create, update, and delete clusters and databases.
11
+ #
12
+ class Clusters
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the Clusters class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [KustoManagementClient] reference to the KustoManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Gets a Kusto cluster.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group containing
30
+ # the Kusto cluster.
31
+ # @param cluster_name [String] The name of the Kusto cluster.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Cluster] operation results.
36
+ #
37
+ def get(resource_group_name, cluster_name, custom_headers:nil)
38
+ response = get_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Gets a Kusto cluster.
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group containing
46
+ # the Kusto cluster.
47
+ # @param cluster_name [String] The name of the Kusto cluster.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def get_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
54
+ get_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets a Kusto cluster.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group containing
61
+ # the Kusto cluster.
62
+ # @param cluster_name [String] The name of the Kusto cluster.
63
+ # @param [Hash{String => String}] A hash of custom headers that will be added
64
+ # to the HTTP request.
65
+ #
66
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
67
+ #
68
+ def get_async(resource_group_name, cluster_name, custom_headers:nil)
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
71
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+
74
+
75
+ request_headers = {}
76
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
77
+
78
+ # Set Headers
79
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
80
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
81
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
88
+ query_params: {'api-version' => @client.api_version},
89
+ headers: request_headers.merge(custom_headers || {}),
90
+ base_url: request_url
91
+ }
92
+ promise = @client.make_request_async(:get, path_template, options)
93
+
94
+ promise = promise.then do |result|
95
+ http_response = result.response
96
+ status_code = http_response.status
97
+ response_content = http_response.body
98
+ unless status_code == 200
99
+ error_model = JSON.load(response_content)
100
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
101
+ end
102
+
103
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
104
+ # Deserialize Response
105
+ if status_code == 200
106
+ begin
107
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
108
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
109
+ result.body = @client.deserialize(result_mapper, parsed_response)
110
+ rescue Exception => e
111
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
112
+ end
113
+ end
114
+
115
+ result
116
+ end
117
+
118
+ promise.execute
119
+ end
120
+
121
+ #
122
+ # Create or update a Kusto cluster.
123
+ #
124
+ # @param resource_group_name [String] The name of the resource group containing
125
+ # the Kusto cluster.
126
+ # @param cluster_name [String] The name of the Kusto cluster.
127
+ # @param parameters [Cluster] The Kusto cluster parameters supplied to the
128
+ # CreateOrUpdate operation.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [Cluster] operation results.
133
+ #
134
+ def create_or_update(resource_group_name, cluster_name, parameters, custom_headers:nil)
135
+ response = create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
136
+ response.body unless response.nil?
137
+ end
138
+
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group containing
141
+ # the Kusto cluster.
142
+ # @param cluster_name [String] The name of the Kusto cluster.
143
+ # @param parameters [Cluster] The Kusto cluster parameters supplied to the
144
+ # CreateOrUpdate operation.
145
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
146
+ # will be added to the HTTP request.
147
+ #
148
+ # @return [Concurrent::Promise] promise which provides async access to http
149
+ # response.
150
+ #
151
+ def create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
152
+ # Send request
153
+ promise = begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
154
+
155
+ promise = promise.then do |response|
156
+ # Defining deserialization method.
157
+ deserialize_method = lambda do |parsed_response|
158
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
159
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
160
+ end
161
+
162
+ # Waiting for response.
163
+ @client.get_long_running_operation_result(response, deserialize_method)
164
+ end
165
+
166
+ promise
167
+ end
168
+
169
+ #
170
+ # Update a Kusto cluster.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group containing
173
+ # the Kusto cluster.
174
+ # @param cluster_name [String] The name of the Kusto cluster.
175
+ # @param parameters [ClusterUpdate] The Kusto cluster parameters supplied to
176
+ # the Update operation.
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ # @return [Cluster] operation results.
181
+ #
182
+ def update(resource_group_name, cluster_name, parameters, custom_headers:nil)
183
+ response = update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
184
+ response.body unless response.nil?
185
+ end
186
+
187
+ #
188
+ # @param resource_group_name [String] The name of the resource group containing
189
+ # the Kusto cluster.
190
+ # @param cluster_name [String] The name of the Kusto cluster.
191
+ # @param parameters [ClusterUpdate] The Kusto cluster parameters supplied to
192
+ # the Update operation.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [Concurrent::Promise] promise which provides async access to http
197
+ # response.
198
+ #
199
+ def update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
200
+ # Send request
201
+ promise = begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)
202
+
203
+ promise = promise.then do |response|
204
+ # Defining deserialization method.
205
+ deserialize_method = lambda do |parsed_response|
206
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
207
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
208
+ end
209
+
210
+ # Waiting for response.
211
+ @client.get_long_running_operation_result(response, deserialize_method)
212
+ end
213
+
214
+ promise
215
+ end
216
+
217
+ #
218
+ # Deletes a Kusto cluster.
219
+ #
220
+ # @param resource_group_name [String] The name of the resource group containing
221
+ # the Kusto cluster.
222
+ # @param cluster_name [String] The name of the Kusto cluster.
223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
+ # will be added to the HTTP request.
225
+ #
226
+ def delete(resource_group_name, cluster_name, custom_headers:nil)
227
+ response = delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
228
+ nil
229
+ end
230
+
231
+ #
232
+ # @param resource_group_name [String] The name of the resource group containing
233
+ # the Kusto cluster.
234
+ # @param cluster_name [String] The name of the Kusto cluster.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [Concurrent::Promise] promise which provides async access to http
239
+ # response.
240
+ #
241
+ def delete_async(resource_group_name, cluster_name, custom_headers:nil)
242
+ # Send request
243
+ promise = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers)
244
+
245
+ promise = promise.then do |response|
246
+ # Defining deserialization method.
247
+ deserialize_method = lambda do |parsed_response|
248
+ end
249
+
250
+ # Waiting for response.
251
+ @client.get_long_running_operation_result(response, deserialize_method)
252
+ end
253
+
254
+ promise
255
+ end
256
+
257
+ #
258
+ # Stops a Kusto cluster.
259
+ #
260
+ # @param resource_group_name [String] The name of the resource group containing
261
+ # the Kusto cluster.
262
+ # @param cluster_name [String] The name of the Kusto cluster.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ def stop(resource_group_name, cluster_name, custom_headers:nil)
267
+ response = stop_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
268
+ nil
269
+ end
270
+
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group containing
273
+ # the Kusto cluster.
274
+ # @param cluster_name [String] The name of the Kusto cluster.
275
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
276
+ # will be added to the HTTP request.
277
+ #
278
+ # @return [Concurrent::Promise] promise which provides async access to http
279
+ # response.
280
+ #
281
+ def stop_async(resource_group_name, cluster_name, custom_headers:nil)
282
+ # Send request
283
+ promise = begin_stop_async(resource_group_name, cluster_name, custom_headers:custom_headers)
284
+
285
+ promise = promise.then do |response|
286
+ # Defining deserialization method.
287
+ deserialize_method = lambda do |parsed_response|
288
+ end
289
+
290
+ # Waiting for response.
291
+ @client.get_long_running_operation_result(response, deserialize_method)
292
+ end
293
+
294
+ promise
295
+ end
296
+
297
+ #
298
+ # Starts a Kusto cluster.
299
+ #
300
+ # @param resource_group_name [String] The name of the resource group containing
301
+ # the Kusto cluster.
302
+ # @param cluster_name [String] The name of the Kusto cluster.
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ def start(resource_group_name, cluster_name, custom_headers:nil)
307
+ response = start_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
308
+ nil
309
+ end
310
+
311
+ #
312
+ # @param resource_group_name [String] The name of the resource group containing
313
+ # the Kusto cluster.
314
+ # @param cluster_name [String] The name of the Kusto cluster.
315
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
316
+ # will be added to the HTTP request.
317
+ #
318
+ # @return [Concurrent::Promise] promise which provides async access to http
319
+ # response.
320
+ #
321
+ def start_async(resource_group_name, cluster_name, custom_headers:nil)
322
+ # Send request
323
+ promise = begin_start_async(resource_group_name, cluster_name, custom_headers:custom_headers)
324
+
325
+ promise = promise.then do |response|
326
+ # Defining deserialization method.
327
+ deserialize_method = lambda do |parsed_response|
328
+ end
329
+
330
+ # Waiting for response.
331
+ @client.get_long_running_operation_result(response, deserialize_method)
332
+ end
333
+
334
+ promise
335
+ end
336
+
337
+ #
338
+ # Lists all Kusto clusters within a resource group.
339
+ #
340
+ # @param resource_group_name [String] The name of the resource group containing
341
+ # the Kusto cluster.
342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
343
+ # will be added to the HTTP request.
344
+ #
345
+ # @return [ClusterListResult] operation results.
346
+ #
347
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
348
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
349
+ response.body unless response.nil?
350
+ end
351
+
352
+ #
353
+ # Lists all Kusto clusters within a resource group.
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group containing
356
+ # the Kusto cluster.
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
361
+ #
362
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
363
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
364
+ end
365
+
366
+ #
367
+ # Lists all Kusto clusters within a resource group.
368
+ #
369
+ # @param resource_group_name [String] The name of the resource group containing
370
+ # the Kusto cluster.
371
+ # @param [Hash{String => String}] A hash of custom headers that will be added
372
+ # to the HTTP request.
373
+ #
374
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
375
+ #
376
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
377
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
378
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
379
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
380
+
381
+
382
+ request_headers = {}
383
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
384
+
385
+ # Set Headers
386
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
387
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
388
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'
389
+
390
+ request_url = @base_url || @client.base_url
391
+
392
+ options = {
393
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
394
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
395
+ query_params: {'api-version' => @client.api_version},
396
+ headers: request_headers.merge(custom_headers || {}),
397
+ base_url: request_url
398
+ }
399
+ promise = @client.make_request_async(:get, path_template, options)
400
+
401
+ promise = promise.then do |result|
402
+ http_response = result.response
403
+ status_code = http_response.status
404
+ response_content = http_response.body
405
+ unless status_code == 200
406
+ error_model = JSON.load(response_content)
407
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
408
+ end
409
+
410
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
411
+ # Deserialize Response
412
+ if status_code == 200
413
+ begin
414
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
415
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::ClusterListResult.mapper()
416
+ result.body = @client.deserialize(result_mapper, parsed_response)
417
+ rescue Exception => e
418
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
419
+ end
420
+ end
421
+
422
+ result
423
+ end
424
+
425
+ promise.execute
426
+ end
427
+
428
+ #
429
+ # Lists all Kusto clusters within a subscription.
430
+ #
431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
+ # will be added to the HTTP request.
433
+ #
434
+ # @return [ClusterListResult] operation results.
435
+ #
436
+ def list(custom_headers:nil)
437
+ response = list_async(custom_headers:custom_headers).value!
438
+ response.body unless response.nil?
439
+ end
440
+
441
+ #
442
+ # Lists all Kusto clusters within a subscription.
443
+ #
444
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
445
+ # will be added to the HTTP request.
446
+ #
447
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
448
+ #
449
+ def list_with_http_info(custom_headers:nil)
450
+ list_async(custom_headers:custom_headers).value!
451
+ end
452
+
453
+ #
454
+ # Lists all Kusto clusters within a subscription.
455
+ #
456
+ # @param [Hash{String => String}] A hash of custom headers that will be added
457
+ # to the HTTP request.
458
+ #
459
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
460
+ #
461
+ def list_async(custom_headers:nil)
462
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
463
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
464
+
465
+
466
+ request_headers = {}
467
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
468
+
469
+ # Set Headers
470
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
471
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
472
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'
473
+
474
+ request_url = @base_url || @client.base_url
475
+
476
+ options = {
477
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
478
+ path_params: {'subscriptionId' => @client.subscription_id},
479
+ query_params: {'api-version' => @client.api_version},
480
+ headers: request_headers.merge(custom_headers || {}),
481
+ base_url: request_url
482
+ }
483
+ promise = @client.make_request_async(:get, path_template, options)
484
+
485
+ promise = promise.then do |result|
486
+ http_response = result.response
487
+ status_code = http_response.status
488
+ response_content = http_response.body
489
+ unless status_code == 200
490
+ error_model = JSON.load(response_content)
491
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
492
+ end
493
+
494
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
495
+ # Deserialize Response
496
+ if status_code == 200
497
+ begin
498
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
499
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::ClusterListResult.mapper()
500
+ result.body = @client.deserialize(result_mapper, parsed_response)
501
+ rescue Exception => e
502
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
503
+ end
504
+ end
505
+
506
+ result
507
+ end
508
+
509
+ promise.execute
510
+ end
511
+
512
+ #
513
+ # Lists eligible SKUs for Kusto resource provider.
514
+ #
515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
516
+ # will be added to the HTTP request.
517
+ #
518
+ # @return [ListSkusResult] operation results.
519
+ #
520
+ def list_skus(custom_headers:nil)
521
+ response = list_skus_async(custom_headers:custom_headers).value!
522
+ response.body unless response.nil?
523
+ end
524
+
525
+ #
526
+ # Lists eligible SKUs for Kusto resource provider.
527
+ #
528
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
529
+ # will be added to the HTTP request.
530
+ #
531
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
532
+ #
533
+ def list_skus_with_http_info(custom_headers:nil)
534
+ list_skus_async(custom_headers:custom_headers).value!
535
+ end
536
+
537
+ #
538
+ # Lists eligible SKUs for Kusto resource provider.
539
+ #
540
+ # @param [Hash{String => String}] A hash of custom headers that will be added
541
+ # to the HTTP request.
542
+ #
543
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
544
+ #
545
+ def list_skus_async(custom_headers:nil)
546
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
547
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
548
+
549
+
550
+ request_headers = {}
551
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
552
+
553
+ # Set Headers
554
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
555
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
556
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'
557
+
558
+ request_url = @base_url || @client.base_url
559
+
560
+ options = {
561
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
562
+ path_params: {'subscriptionId' => @client.subscription_id},
563
+ query_params: {'api-version' => @client.api_version},
564
+ headers: request_headers.merge(custom_headers || {}),
565
+ base_url: request_url
566
+ }
567
+ promise = @client.make_request_async(:get, path_template, options)
568
+
569
+ promise = promise.then do |result|
570
+ http_response = result.response
571
+ status_code = http_response.status
572
+ response_content = http_response.body
573
+ unless status_code == 200
574
+ error_model = JSON.load(response_content)
575
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
576
+ end
577
+
578
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
579
+ # Deserialize Response
580
+ if status_code == 200
581
+ begin
582
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
583
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::ListSkusResult.mapper()
584
+ result.body = @client.deserialize(result_mapper, parsed_response)
585
+ rescue Exception => e
586
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
587
+ end
588
+ end
589
+
590
+ result
591
+ end
592
+
593
+ promise.execute
594
+ end
595
+
596
+ #
597
+ # Checks that the cluster name is valid and is not already in use.
598
+ #
599
+ # @param location [String] Azure location.
600
+ # @param cluster_name [ClusterCheckNameRequest] The name of the cluster.
601
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
602
+ # will be added to the HTTP request.
603
+ #
604
+ # @return [CheckNameResult] operation results.
605
+ #
606
+ def check_name_availability(location, cluster_name, custom_headers:nil)
607
+ response = check_name_availability_async(location, cluster_name, custom_headers:custom_headers).value!
608
+ response.body unless response.nil?
609
+ end
610
+
611
+ #
612
+ # Checks that the cluster name is valid and is not already in use.
613
+ #
614
+ # @param location [String] Azure location.
615
+ # @param cluster_name [ClusterCheckNameRequest] The name of the cluster.
616
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
617
+ # will be added to the HTTP request.
618
+ #
619
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
620
+ #
621
+ def check_name_availability_with_http_info(location, cluster_name, custom_headers:nil)
622
+ check_name_availability_async(location, cluster_name, custom_headers:custom_headers).value!
623
+ end
624
+
625
+ #
626
+ # Checks that the cluster name is valid and is not already in use.
627
+ #
628
+ # @param location [String] Azure location.
629
+ # @param cluster_name [ClusterCheckNameRequest] The name of the cluster.
630
+ # @param [Hash{String => String}] A hash of custom headers that will be added
631
+ # to the HTTP request.
632
+ #
633
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
634
+ #
635
+ def check_name_availability_async(location, cluster_name, custom_headers:nil)
636
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
637
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
638
+ fail ArgumentError, 'location is nil' if location.nil?
639
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
640
+
641
+
642
+ request_headers = {}
643
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
644
+
645
+ # Set Headers
646
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
647
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
648
+
649
+ # Serialize Request
650
+ request_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::ClusterCheckNameRequest.mapper()
651
+ request_content = @client.serialize(request_mapper, cluster_name)
652
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
653
+
654
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'
655
+
656
+ request_url = @base_url || @client.base_url
657
+
658
+ options = {
659
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
660
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
661
+ query_params: {'api-version' => @client.api_version},
662
+ body: request_content,
663
+ headers: request_headers.merge(custom_headers || {}),
664
+ base_url: request_url
665
+ }
666
+ promise = @client.make_request_async(:post, path_template, options)
667
+
668
+ promise = promise.then do |result|
669
+ http_response = result.response
670
+ status_code = http_response.status
671
+ response_content = http_response.body
672
+ unless status_code == 200
673
+ error_model = JSON.load(response_content)
674
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
675
+ end
676
+
677
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
678
+ # Deserialize Response
679
+ if status_code == 200
680
+ begin
681
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
682
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::CheckNameResult.mapper()
683
+ result.body = @client.deserialize(result_mapper, parsed_response)
684
+ rescue Exception => e
685
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
686
+ end
687
+ end
688
+
689
+ result
690
+ end
691
+
692
+ promise.execute
693
+ end
694
+
695
+ #
696
+ # Returns the SKUs available for the provided resource.
697
+ #
698
+ # @param resource_group_name [String] The name of the resource group containing
699
+ # the Kusto cluster.
700
+ # @param cluster_name [String] The name of the Kusto cluster.
701
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
702
+ # will be added to the HTTP request.
703
+ #
704
+ # @return [ListResourceSkusResult] operation results.
705
+ #
706
+ def list_skus_by_resource(resource_group_name, cluster_name, custom_headers:nil)
707
+ response = list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
708
+ response.body unless response.nil?
709
+ end
710
+
711
+ #
712
+ # Returns the SKUs available for the provided resource.
713
+ #
714
+ # @param resource_group_name [String] The name of the resource group containing
715
+ # the Kusto cluster.
716
+ # @param cluster_name [String] The name of the Kusto cluster.
717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
718
+ # will be added to the HTTP request.
719
+ #
720
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
721
+ #
722
+ def list_skus_by_resource_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
723
+ list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
724
+ end
725
+
726
+ #
727
+ # Returns the SKUs available for the provided resource.
728
+ #
729
+ # @param resource_group_name [String] The name of the resource group containing
730
+ # the Kusto cluster.
731
+ # @param cluster_name [String] The name of the Kusto cluster.
732
+ # @param [Hash{String => String}] A hash of custom headers that will be added
733
+ # to the HTTP request.
734
+ #
735
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
736
+ #
737
+ def list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:nil)
738
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
739
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
740
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
741
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
742
+
743
+
744
+ request_headers = {}
745
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
746
+
747
+ # Set Headers
748
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
749
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
750
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'
751
+
752
+ request_url = @base_url || @client.base_url
753
+
754
+ options = {
755
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
756
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
757
+ query_params: {'api-version' => @client.api_version},
758
+ headers: request_headers.merge(custom_headers || {}),
759
+ base_url: request_url
760
+ }
761
+ promise = @client.make_request_async(:get, path_template, options)
762
+
763
+ promise = promise.then do |result|
764
+ http_response = result.response
765
+ status_code = http_response.status
766
+ response_content = http_response.body
767
+ unless status_code == 200
768
+ error_model = JSON.load(response_content)
769
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
770
+ end
771
+
772
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
773
+ # Deserialize Response
774
+ if status_code == 200
775
+ begin
776
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
777
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::ListResourceSkusResult.mapper()
778
+ result.body = @client.deserialize(result_mapper, parsed_response)
779
+ rescue Exception => e
780
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
781
+ end
782
+ end
783
+
784
+ result
785
+ end
786
+
787
+ promise.execute
788
+ end
789
+
790
+ #
791
+ # Create or update a Kusto cluster.
792
+ #
793
+ # @param resource_group_name [String] The name of the resource group containing
794
+ # the Kusto cluster.
795
+ # @param cluster_name [String] The name of the Kusto cluster.
796
+ # @param parameters [Cluster] The Kusto cluster parameters supplied to the
797
+ # CreateOrUpdate operation.
798
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
799
+ # will be added to the HTTP request.
800
+ #
801
+ # @return [Cluster] operation results.
802
+ #
803
+ def begin_create_or_update(resource_group_name, cluster_name, parameters, custom_headers:nil)
804
+ response = begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
805
+ response.body unless response.nil?
806
+ end
807
+
808
+ #
809
+ # Create or update a Kusto cluster.
810
+ #
811
+ # @param resource_group_name [String] The name of the resource group containing
812
+ # the Kusto cluster.
813
+ # @param cluster_name [String] The name of the Kusto cluster.
814
+ # @param parameters [Cluster] The Kusto cluster parameters supplied to the
815
+ # CreateOrUpdate operation.
816
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
817
+ # will be added to the HTTP request.
818
+ #
819
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
820
+ #
821
+ def begin_create_or_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
822
+ begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
823
+ end
824
+
825
+ #
826
+ # Create or update a Kusto cluster.
827
+ #
828
+ # @param resource_group_name [String] The name of the resource group containing
829
+ # the Kusto cluster.
830
+ # @param cluster_name [String] The name of the Kusto cluster.
831
+ # @param parameters [Cluster] The Kusto cluster parameters supplied to the
832
+ # CreateOrUpdate operation.
833
+ # @param [Hash{String => String}] A hash of custom headers that will be added
834
+ # to the HTTP request.
835
+ #
836
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
837
+ #
838
+ def begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
839
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
840
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
841
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
842
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
843
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
844
+
845
+
846
+ request_headers = {}
847
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
848
+
849
+ # Set Headers
850
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
851
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
852
+
853
+ # Serialize Request
854
+ request_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
855
+ request_content = @client.serialize(request_mapper, parameters)
856
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
857
+
858
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'
859
+
860
+ request_url = @base_url || @client.base_url
861
+
862
+ options = {
863
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
864
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
865
+ query_params: {'api-version' => @client.api_version},
866
+ body: request_content,
867
+ headers: request_headers.merge(custom_headers || {}),
868
+ base_url: request_url
869
+ }
870
+ promise = @client.make_request_async(:put, path_template, options)
871
+
872
+ promise = promise.then do |result|
873
+ http_response = result.response
874
+ status_code = http_response.status
875
+ response_content = http_response.body
876
+ unless status_code == 200 || status_code == 201
877
+ error_model = JSON.load(response_content)
878
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
879
+ end
880
+
881
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
882
+ # Deserialize Response
883
+ if status_code == 200
884
+ begin
885
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
886
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
887
+ result.body = @client.deserialize(result_mapper, parsed_response)
888
+ rescue Exception => e
889
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
890
+ end
891
+ end
892
+ # Deserialize Response
893
+ if status_code == 201
894
+ begin
895
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
896
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
897
+ result.body = @client.deserialize(result_mapper, parsed_response)
898
+ rescue Exception => e
899
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
900
+ end
901
+ end
902
+
903
+ result
904
+ end
905
+
906
+ promise.execute
907
+ end
908
+
909
+ #
910
+ # Update a Kusto cluster.
911
+ #
912
+ # @param resource_group_name [String] The name of the resource group containing
913
+ # the Kusto cluster.
914
+ # @param cluster_name [String] The name of the Kusto cluster.
915
+ # @param parameters [ClusterUpdate] The Kusto cluster parameters supplied to
916
+ # the Update operation.
917
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
918
+ # will be added to the HTTP request.
919
+ #
920
+ # @return [Cluster] operation results.
921
+ #
922
+ def begin_update(resource_group_name, cluster_name, parameters, custom_headers:nil)
923
+ response = begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
924
+ response.body unless response.nil?
925
+ end
926
+
927
+ #
928
+ # Update a Kusto cluster.
929
+ #
930
+ # @param resource_group_name [String] The name of the resource group containing
931
+ # the Kusto cluster.
932
+ # @param cluster_name [String] The name of the Kusto cluster.
933
+ # @param parameters [ClusterUpdate] The Kusto cluster parameters supplied to
934
+ # the Update operation.
935
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
936
+ # will be added to the HTTP request.
937
+ #
938
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
939
+ #
940
+ def begin_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
941
+ begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
942
+ end
943
+
944
+ #
945
+ # Update a Kusto cluster.
946
+ #
947
+ # @param resource_group_name [String] The name of the resource group containing
948
+ # the Kusto cluster.
949
+ # @param cluster_name [String] The name of the Kusto cluster.
950
+ # @param parameters [ClusterUpdate] The Kusto cluster parameters supplied to
951
+ # the Update operation.
952
+ # @param [Hash{String => String}] A hash of custom headers that will be added
953
+ # to the HTTP request.
954
+ #
955
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
956
+ #
957
+ def begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
958
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
959
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
960
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
961
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
962
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
963
+
964
+
965
+ request_headers = {}
966
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
967
+
968
+ # Set Headers
969
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
970
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
971
+
972
+ # Serialize Request
973
+ request_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::ClusterUpdate.mapper()
974
+ request_content = @client.serialize(request_mapper, parameters)
975
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
976
+
977
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'
978
+
979
+ request_url = @base_url || @client.base_url
980
+
981
+ options = {
982
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
983
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
984
+ query_params: {'api-version' => @client.api_version},
985
+ body: request_content,
986
+ headers: request_headers.merge(custom_headers || {}),
987
+ base_url: request_url
988
+ }
989
+ promise = @client.make_request_async(:patch, path_template, options)
990
+
991
+ promise = promise.then do |result|
992
+ http_response = result.response
993
+ status_code = http_response.status
994
+ response_content = http_response.body
995
+ unless status_code == 200 || status_code == 201
996
+ error_model = JSON.load(response_content)
997
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
998
+ end
999
+
1000
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1001
+ # Deserialize Response
1002
+ if status_code == 200
1003
+ begin
1004
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1005
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
1006
+ result.body = @client.deserialize(result_mapper, parsed_response)
1007
+ rescue Exception => e
1008
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1009
+ end
1010
+ end
1011
+ # Deserialize Response
1012
+ if status_code == 201
1013
+ begin
1014
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1015
+ result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::Cluster.mapper()
1016
+ result.body = @client.deserialize(result_mapper, parsed_response)
1017
+ rescue Exception => e
1018
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1019
+ end
1020
+ end
1021
+
1022
+ result
1023
+ end
1024
+
1025
+ promise.execute
1026
+ end
1027
+
1028
+ #
1029
+ # Deletes a Kusto cluster.
1030
+ #
1031
+ # @param resource_group_name [String] The name of the resource group containing
1032
+ # the Kusto cluster.
1033
+ # @param cluster_name [String] The name of the Kusto cluster.
1034
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1035
+ # will be added to the HTTP request.
1036
+ #
1037
+ #
1038
+ def begin_delete(resource_group_name, cluster_name, custom_headers:nil)
1039
+ response = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
1040
+ nil
1041
+ end
1042
+
1043
+ #
1044
+ # Deletes a Kusto cluster.
1045
+ #
1046
+ # @param resource_group_name [String] The name of the resource group containing
1047
+ # the Kusto cluster.
1048
+ # @param cluster_name [String] The name of the Kusto cluster.
1049
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1050
+ # will be added to the HTTP request.
1051
+ #
1052
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1053
+ #
1054
+ def begin_delete_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
1055
+ begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
1056
+ end
1057
+
1058
+ #
1059
+ # Deletes a Kusto cluster.
1060
+ #
1061
+ # @param resource_group_name [String] The name of the resource group containing
1062
+ # the Kusto cluster.
1063
+ # @param cluster_name [String] The name of the Kusto cluster.
1064
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1065
+ # to the HTTP request.
1066
+ #
1067
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1068
+ #
1069
+ def begin_delete_async(resource_group_name, cluster_name, custom_headers:nil)
1070
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1071
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
1072
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1073
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1074
+
1075
+
1076
+ request_headers = {}
1077
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1078
+
1079
+ # Set Headers
1080
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1081
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1082
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'
1083
+
1084
+ request_url = @base_url || @client.base_url
1085
+
1086
+ options = {
1087
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1088
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
1089
+ query_params: {'api-version' => @client.api_version},
1090
+ headers: request_headers.merge(custom_headers || {}),
1091
+ base_url: request_url
1092
+ }
1093
+ promise = @client.make_request_async(:delete, path_template, options)
1094
+
1095
+ promise = promise.then do |result|
1096
+ http_response = result.response
1097
+ status_code = http_response.status
1098
+ response_content = http_response.body
1099
+ unless status_code == 200 || status_code == 202 || status_code == 204
1100
+ error_model = JSON.load(response_content)
1101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1102
+ end
1103
+
1104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1105
+
1106
+ result
1107
+ end
1108
+
1109
+ promise.execute
1110
+ end
1111
+
1112
+ #
1113
+ # Stops a Kusto cluster.
1114
+ #
1115
+ # @param resource_group_name [String] The name of the resource group containing
1116
+ # the Kusto cluster.
1117
+ # @param cluster_name [String] The name of the Kusto cluster.
1118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1119
+ # will be added to the HTTP request.
1120
+ #
1121
+ #
1122
+ def begin_stop(resource_group_name, cluster_name, custom_headers:nil)
1123
+ response = begin_stop_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
1124
+ nil
1125
+ end
1126
+
1127
+ #
1128
+ # Stops a Kusto cluster.
1129
+ #
1130
+ # @param resource_group_name [String] The name of the resource group containing
1131
+ # the Kusto cluster.
1132
+ # @param cluster_name [String] The name of the Kusto cluster.
1133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1134
+ # will be added to the HTTP request.
1135
+ #
1136
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1137
+ #
1138
+ def begin_stop_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
1139
+ begin_stop_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
1140
+ end
1141
+
1142
+ #
1143
+ # Stops a Kusto cluster.
1144
+ #
1145
+ # @param resource_group_name [String] The name of the resource group containing
1146
+ # the Kusto cluster.
1147
+ # @param cluster_name [String] The name of the Kusto cluster.
1148
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1149
+ # to the HTTP request.
1150
+ #
1151
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1152
+ #
1153
+ def begin_stop_async(resource_group_name, cluster_name, custom_headers:nil)
1154
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1155
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
1156
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1157
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1158
+
1159
+
1160
+ request_headers = {}
1161
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1162
+
1163
+ # Set Headers
1164
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1165
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1166
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'
1167
+
1168
+ request_url = @base_url || @client.base_url
1169
+
1170
+ options = {
1171
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1172
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
1173
+ query_params: {'api-version' => @client.api_version},
1174
+ headers: request_headers.merge(custom_headers || {}),
1175
+ base_url: request_url
1176
+ }
1177
+ promise = @client.make_request_async(:post, path_template, options)
1178
+
1179
+ promise = promise.then do |result|
1180
+ http_response = result.response
1181
+ status_code = http_response.status
1182
+ response_content = http_response.body
1183
+ unless status_code == 200 || status_code == 202
1184
+ error_model = JSON.load(response_content)
1185
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1186
+ end
1187
+
1188
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1189
+
1190
+ result
1191
+ end
1192
+
1193
+ promise.execute
1194
+ end
1195
+
1196
+ #
1197
+ # Starts a Kusto cluster.
1198
+ #
1199
+ # @param resource_group_name [String] The name of the resource group containing
1200
+ # the Kusto cluster.
1201
+ # @param cluster_name [String] The name of the Kusto cluster.
1202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1203
+ # will be added to the HTTP request.
1204
+ #
1205
+ #
1206
+ def begin_start(resource_group_name, cluster_name, custom_headers:nil)
1207
+ response = begin_start_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
1208
+ nil
1209
+ end
1210
+
1211
+ #
1212
+ # Starts a Kusto cluster.
1213
+ #
1214
+ # @param resource_group_name [String] The name of the resource group containing
1215
+ # the Kusto cluster.
1216
+ # @param cluster_name [String] The name of the Kusto cluster.
1217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1218
+ # will be added to the HTTP request.
1219
+ #
1220
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1221
+ #
1222
+ def begin_start_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
1223
+ begin_start_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
1224
+ end
1225
+
1226
+ #
1227
+ # Starts a Kusto cluster.
1228
+ #
1229
+ # @param resource_group_name [String] The name of the resource group containing
1230
+ # the Kusto cluster.
1231
+ # @param cluster_name [String] The name of the Kusto cluster.
1232
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1233
+ # to the HTTP request.
1234
+ #
1235
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1236
+ #
1237
+ def begin_start_async(resource_group_name, cluster_name, custom_headers:nil)
1238
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1239
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
1240
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1241
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1242
+
1243
+
1244
+ request_headers = {}
1245
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1246
+
1247
+ # Set Headers
1248
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1249
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1250
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'
1251
+
1252
+ request_url = @base_url || @client.base_url
1253
+
1254
+ options = {
1255
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1256
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
1257
+ query_params: {'api-version' => @client.api_version},
1258
+ headers: request_headers.merge(custom_headers || {}),
1259
+ base_url: request_url
1260
+ }
1261
+ promise = @client.make_request_async(:post, path_template, options)
1262
+
1263
+ promise = promise.then do |result|
1264
+ http_response = result.response
1265
+ status_code = http_response.status
1266
+ response_content = http_response.body
1267
+ unless status_code == 200 || status_code == 202
1268
+ error_model = JSON.load(response_content)
1269
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1270
+ end
1271
+
1272
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1273
+
1274
+ result
1275
+ end
1276
+
1277
+ promise.execute
1278
+ end
1279
+
1280
+ end
1281
+ end