azure_mgmt_kusto 0.19.3 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  3. data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  4. data/lib/2019-01-21/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  5. data/lib/2019-05-15/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  6. data/lib/2019-09-07/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  7. data/lib/2019-11-09/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  8. data/lib/2020-02-15/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  9. data/lib/2020-06-14/generated/azure_mgmt_kusto/kusto_management_client.rb +1 -1
  10. data/lib/2020-09-18/generated/azure_mgmt_kusto.rb +111 -0
  11. data/lib/2020-09-18/generated/azure_mgmt_kusto/attached_database_configurations.rb +558 -0
  12. data/lib/2020-09-18/generated/azure_mgmt_kusto/cluster_principal_assignments.rb +656 -0
  13. data/lib/2020-09-18/generated/azure_mgmt_kusto/clusters.rb +2087 -0
  14. data/lib/2020-09-18/generated/azure_mgmt_kusto/data_connections.rb +1033 -0
  15. data/lib/2020-09-18/generated/azure_mgmt_kusto/database_principal_assignments.rb +683 -0
  16. data/lib/2020-09-18/generated/azure_mgmt_kusto/databases.rb +1169 -0
  17. data/lib/2020-09-18/generated/azure_mgmt_kusto/kusto_management_client.rb +157 -0
  18. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/attached_database_configuration.rb +144 -0
  19. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/attached_database_configuration_list_result.rb +56 -0
  20. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_capacity.rb +80 -0
  21. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_entity_resource.rb +75 -0
  22. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_resource_sku.rb +70 -0
  23. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_scale_type.rb +17 -0
  24. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_sku.rb +78 -0
  25. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_sku_name.rb +36 -0
  26. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/azure_sku_tier.rb +16 -0
  27. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/blob_storage_event_type.rb +16 -0
  28. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/check_name_request.rb +61 -0
  29. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/check_name_result.rb +82 -0
  30. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster.rb +327 -0
  31. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_check_name_request.rb +60 -0
  32. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_list_result.rb +55 -0
  33. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_principal_assignment.rb +147 -0
  34. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_principal_assignment_check_name_request.rb +62 -0
  35. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_principal_assignment_list_result.rb +56 -0
  36. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_principal_role.rb +16 -0
  37. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/cluster_update.rb +314 -0
  38. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/compression.rb +16 -0
  39. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/data_connection.rb +82 -0
  40. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/data_connection_check_name_request.rb +61 -0
  41. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/data_connection_list_result.rb +57 -0
  42. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/data_connection_validation.rb +60 -0
  43. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/data_connection_validation_list_result.rb +56 -0
  44. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/data_connection_validation_result.rb +47 -0
  45. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database.rb +82 -0
  46. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_list_result.rb +57 -0
  47. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal.rb +117 -0
  48. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_assignment.rb +148 -0
  49. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_assignment_check_name_request.rb +62 -0
  50. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_assignment_list_result.rb +56 -0
  51. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_list_request.rb +56 -0
  52. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_list_result.rb +56 -0
  53. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_role.rb +20 -0
  54. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_principal_type.rb +17 -0
  55. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/database_statistics.rb +47 -0
  56. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/default_principals_modification_kind.rb +17 -0
  57. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/diagnose_virtual_network_result.rb +56 -0
  58. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/engine_type.rb +16 -0
  59. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/event_grid_data_connection.rb +198 -0
  60. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/event_grid_data_format.rb +30 -0
  61. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/event_hub_data_connection.rb +192 -0
  62. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/event_hub_data_format.rb +30 -0
  63. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/follower_database_definition.rb +72 -0
  64. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/follower_database_list_result.rb +56 -0
  65. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/identity.rb +97 -0
  66. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/identity_type.rb +18 -0
  67. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/identity_user_assigned_identities_value.rb +60 -0
  68. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/iot_hub_data_connection.rb +191 -0
  69. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/iot_hub_data_format.rb +30 -0
  70. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/key_vault_properties.rb +80 -0
  71. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/language_extension.rb +47 -0
  72. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/language_extension_name.rb +16 -0
  73. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/language_extensions_list.rb +55 -0
  74. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/list_resource_skus_result.rb +56 -0
  75. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/operation.rb +82 -0
  76. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/operation_display.rb +80 -0
  77. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/operation_list_result.rb +98 -0
  78. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/optimized_autoscale.rb +80 -0
  79. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/principal_type.rb +17 -0
  80. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/principals_modification_kind.rb +17 -0
  81. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/provisioning_state.rb +20 -0
  82. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/proxy_resource.rb +63 -0
  83. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/read_only_following_database.rb +174 -0
  84. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/read_write_database.rb +147 -0
  85. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/reason.rb +16 -0
  86. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/resource.rb +83 -0
  87. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/sku_description.rb +132 -0
  88. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/sku_description_list.rb +56 -0
  89. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/sku_location_info_item.rb +65 -0
  90. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/state.rb +23 -0
  91. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/tracked_resource.rb +92 -0
  92. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/trusted_external_tenant.rb +46 -0
  93. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/type.rb +16 -0
  94. data/lib/2020-09-18/generated/azure_mgmt_kusto/models/virtual_network_configuration.rb +69 -0
  95. data/lib/2020-09-18/generated/azure_mgmt_kusto/module_definition.rb +9 -0
  96. data/lib/2020-09-18/generated/azure_mgmt_kusto/operations.rb +221 -0
  97. data/lib/azure_mgmt_kusto.rb +4 -3
  98. data/lib/profiles/latest/modules/kusto_profile_module.rb +164 -160
  99. data/lib/version.rb +1 -1
  100. metadata +90 -3
@@ -0,0 +1,683 @@
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::V2020_09_18
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 DatabasePrincipalAssignments
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the DatabasePrincipalAssignments 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
+ # Checks that the database principal assignment is valid and is not already in
28
+ # use.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group containing
31
+ # the Kusto cluster.
32
+ # @param cluster_name [String] The name of the Kusto cluster.
33
+ # @param database_name [String] The name of the database in the Kusto cluster.
34
+ # @param principal_assignment_name
35
+ # [DatabasePrincipalAssignmentCheckNameRequest] The name of the resource.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [CheckNameResult] operation results.
40
+ #
41
+ def check_name_availability(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
42
+ response = check_name_availability_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Checks that the database principal assignment is valid and is not already in
48
+ # use.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group containing
51
+ # the Kusto cluster.
52
+ # @param cluster_name [String] The name of the Kusto cluster.
53
+ # @param database_name [String] The name of the database in the Kusto cluster.
54
+ # @param principal_assignment_name
55
+ # [DatabasePrincipalAssignmentCheckNameRequest] The name of the resource.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def check_name_availability_with_http_info(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
62
+ check_name_availability_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Checks that the database principal assignment is valid and is not already in
67
+ # use.
68
+ #
69
+ # @param resource_group_name [String] The name of the resource group containing
70
+ # the Kusto cluster.
71
+ # @param cluster_name [String] The name of the Kusto cluster.
72
+ # @param database_name [String] The name of the database in the Kusto cluster.
73
+ # @param principal_assignment_name
74
+ # [DatabasePrincipalAssignmentCheckNameRequest] The name of the resource.
75
+ # @param [Hash{String => String}] A hash of custom headers that will be added
76
+ # to the HTTP request.
77
+ #
78
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
79
+ #
80
+ def check_name_availability_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
81
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
82
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
83
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
84
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
85
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
+ fail ArgumentError, 'principal_assignment_name is nil' if principal_assignment_name.nil?
87
+
88
+
89
+ request_headers = {}
90
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
91
+
92
+ # Set Headers
93
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
95
+
96
+ # Serialize Request
97
+ request_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignmentCheckNameRequest.mapper()
98
+ request_content = @client.serialize(request_mapper, principal_assignment_name)
99
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
100
+
101
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'
102
+
103
+ request_url = @base_url || @client.base_url
104
+
105
+ options = {
106
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
107
+ path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
108
+ query_params: {'api-version' => @client.api_version},
109
+ body: request_content,
110
+ headers: request_headers.merge(custom_headers || {}),
111
+ base_url: request_url
112
+ }
113
+ promise = @client.make_request_async(:post, path_template, options)
114
+
115
+ promise = promise.then do |result|
116
+ http_response = result.response
117
+ status_code = http_response.status
118
+ response_content = http_response.body
119
+ unless status_code == 200
120
+ error_model = JSON.load(response_content)
121
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
122
+ end
123
+
124
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
125
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
126
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
127
+ # Deserialize Response
128
+ if status_code == 200
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::CheckNameResult.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+
138
+ result
139
+ end
140
+
141
+ promise.execute
142
+ end
143
+
144
+ #
145
+ # Gets a Kusto cluster database principalAssignment.
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group containing
148
+ # the Kusto cluster.
149
+ # @param cluster_name [String] The name of the Kusto cluster.
150
+ # @param database_name [String] The name of the database in the Kusto cluster.
151
+ # @param principal_assignment_name [String] The name of the Kusto
152
+ # principalAssignment.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [DatabasePrincipalAssignment] operation results.
157
+ #
158
+ def get(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
159
+ response = get_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
160
+ response.body unless response.nil?
161
+ end
162
+
163
+ #
164
+ # Gets a Kusto cluster database principalAssignment.
165
+ #
166
+ # @param resource_group_name [String] The name of the resource group containing
167
+ # the Kusto cluster.
168
+ # @param cluster_name [String] The name of the Kusto cluster.
169
+ # @param database_name [String] The name of the database in the Kusto cluster.
170
+ # @param principal_assignment_name [String] The name of the Kusto
171
+ # principalAssignment.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
176
+ #
177
+ def get_with_http_info(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
178
+ get_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
179
+ end
180
+
181
+ #
182
+ # Gets a Kusto cluster database principalAssignment.
183
+ #
184
+ # @param resource_group_name [String] The name of the resource group containing
185
+ # the Kusto cluster.
186
+ # @param cluster_name [String] The name of the Kusto cluster.
187
+ # @param database_name [String] The name of the database in the Kusto cluster.
188
+ # @param principal_assignment_name [String] The name of the Kusto
189
+ # principalAssignment.
190
+ # @param [Hash{String => String}] A hash of custom headers that will be added
191
+ # to the HTTP request.
192
+ #
193
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
194
+ #
195
+ def get_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
196
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
197
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
198
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
199
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
200
+ fail ArgumentError, 'principal_assignment_name is nil' if principal_assignment_name.nil?
201
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
202
+
203
+
204
+ request_headers = {}
205
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
206
+
207
+ # Set Headers
208
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
209
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
210
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'
211
+
212
+ request_url = @base_url || @client.base_url
213
+
214
+ options = {
215
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
216
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'principalAssignmentName' => principal_assignment_name},
217
+ query_params: {'api-version' => @client.api_version},
218
+ headers: request_headers.merge(custom_headers || {}),
219
+ base_url: request_url
220
+ }
221
+ promise = @client.make_request_async(:get, path_template, options)
222
+
223
+ promise = promise.then do |result|
224
+ http_response = result.response
225
+ status_code = http_response.status
226
+ response_content = http_response.body
227
+ unless status_code == 200
228
+ error_model = JSON.load(response_content)
229
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
230
+ end
231
+
232
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
233
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
234
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
235
+ # Deserialize Response
236
+ if status_code == 200
237
+ begin
238
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
239
+ result_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignment.mapper()
240
+ result.body = @client.deserialize(result_mapper, parsed_response)
241
+ rescue Exception => e
242
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
243
+ end
244
+ end
245
+
246
+ result
247
+ end
248
+
249
+ promise.execute
250
+ end
251
+
252
+ #
253
+ # Creates a Kusto cluster database principalAssignment.
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group containing
256
+ # the Kusto cluster.
257
+ # @param cluster_name [String] The name of the Kusto cluster.
258
+ # @param database_name [String] The name of the database in the Kusto cluster.
259
+ # @param principal_assignment_name [String] The name of the Kusto
260
+ # principalAssignment.
261
+ # @param parameters [DatabasePrincipalAssignment] The Kusto
262
+ # principalAssignments parameters supplied for the operation.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [DatabasePrincipalAssignment] operation results.
267
+ #
268
+ def create_or_update(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:nil)
269
+ response = create_or_update_async(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:custom_headers).value!
270
+ response.body unless response.nil?
271
+ end
272
+
273
+ #
274
+ # @param resource_group_name [String] The name of the resource group containing
275
+ # the Kusto cluster.
276
+ # @param cluster_name [String] The name of the Kusto cluster.
277
+ # @param database_name [String] The name of the database in the Kusto cluster.
278
+ # @param principal_assignment_name [String] The name of the Kusto
279
+ # principalAssignment.
280
+ # @param parameters [DatabasePrincipalAssignment] The Kusto
281
+ # principalAssignments parameters supplied for the operation.
282
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
283
+ # will be added to the HTTP request.
284
+ #
285
+ # @return [Concurrent::Promise] promise which provides async access to http
286
+ # response.
287
+ #
288
+ def create_or_update_async(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:nil)
289
+ # Send request
290
+ promise = begin_create_or_update_async(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:custom_headers)
291
+
292
+ promise = promise.then do |response|
293
+ # Defining deserialization method.
294
+ deserialize_method = lambda do |parsed_response|
295
+ result_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignment.mapper()
296
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
297
+ end
298
+
299
+ # Waiting for response.
300
+ @client.get_long_running_operation_result(response, deserialize_method)
301
+ end
302
+
303
+ promise
304
+ end
305
+
306
+ #
307
+ # Deletes a Kusto principalAssignment.
308
+ #
309
+ # @param resource_group_name [String] The name of the resource group containing
310
+ # the Kusto cluster.
311
+ # @param cluster_name [String] The name of the Kusto cluster.
312
+ # @param database_name [String] The name of the database in the Kusto cluster.
313
+ # @param principal_assignment_name [String] The name of the Kusto
314
+ # principalAssignment.
315
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
316
+ # will be added to the HTTP request.
317
+ #
318
+ def delete(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
319
+ response = delete_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
320
+ nil
321
+ end
322
+
323
+ #
324
+ # @param resource_group_name [String] The name of the resource group containing
325
+ # the Kusto cluster.
326
+ # @param cluster_name [String] The name of the Kusto cluster.
327
+ # @param database_name [String] The name of the database in the Kusto cluster.
328
+ # @param principal_assignment_name [String] The name of the Kusto
329
+ # principalAssignment.
330
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
331
+ # will be added to the HTTP request.
332
+ #
333
+ # @return [Concurrent::Promise] promise which provides async access to http
334
+ # response.
335
+ #
336
+ def delete_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
337
+ # Send request
338
+ promise = begin_delete_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers)
339
+
340
+ promise = promise.then do |response|
341
+ # Defining deserialization method.
342
+ deserialize_method = lambda do |parsed_response|
343
+ end
344
+
345
+ # Waiting for response.
346
+ @client.get_long_running_operation_result(response, deserialize_method)
347
+ end
348
+
349
+ promise
350
+ end
351
+
352
+ #
353
+ # Lists all Kusto cluster database principalAssignments.
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group containing
356
+ # the Kusto cluster.
357
+ # @param cluster_name [String] The name of the Kusto cluster.
358
+ # @param database_name [String] The name of the database in the Kusto cluster.
359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
360
+ # will be added to the HTTP request.
361
+ #
362
+ # @return [DatabasePrincipalAssignmentListResult] operation results.
363
+ #
364
+ def list(resource_group_name, cluster_name, database_name, custom_headers:nil)
365
+ response = list_async(resource_group_name, cluster_name, database_name, custom_headers:custom_headers).value!
366
+ response.body unless response.nil?
367
+ end
368
+
369
+ #
370
+ # Lists all Kusto cluster database principalAssignments.
371
+ #
372
+ # @param resource_group_name [String] The name of the resource group containing
373
+ # the Kusto cluster.
374
+ # @param cluster_name [String] The name of the Kusto cluster.
375
+ # @param database_name [String] The name of the database in the Kusto cluster.
376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
377
+ # will be added to the HTTP request.
378
+ #
379
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
380
+ #
381
+ def list_with_http_info(resource_group_name, cluster_name, database_name, custom_headers:nil)
382
+ list_async(resource_group_name, cluster_name, database_name, custom_headers:custom_headers).value!
383
+ end
384
+
385
+ #
386
+ # Lists all Kusto cluster database principalAssignments.
387
+ #
388
+ # @param resource_group_name [String] The name of the resource group containing
389
+ # the Kusto cluster.
390
+ # @param cluster_name [String] The name of the Kusto cluster.
391
+ # @param database_name [String] The name of the database in the Kusto cluster.
392
+ # @param [Hash{String => String}] A hash of custom headers that will be added
393
+ # to the HTTP request.
394
+ #
395
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
396
+ #
397
+ def list_async(resource_group_name, cluster_name, database_name, custom_headers:nil)
398
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
399
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
400
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
401
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
402
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
403
+
404
+
405
+ request_headers = {}
406
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
407
+
408
+ # Set Headers
409
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
410
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
411
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'
412
+
413
+ request_url = @base_url || @client.base_url
414
+
415
+ options = {
416
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
417
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name},
418
+ query_params: {'api-version' => @client.api_version},
419
+ headers: request_headers.merge(custom_headers || {}),
420
+ base_url: request_url
421
+ }
422
+ promise = @client.make_request_async(:get, path_template, options)
423
+
424
+ promise = promise.then do |result|
425
+ http_response = result.response
426
+ status_code = http_response.status
427
+ response_content = http_response.body
428
+ unless status_code == 200
429
+ error_model = JSON.load(response_content)
430
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
431
+ end
432
+
433
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
434
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
435
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
436
+ # Deserialize Response
437
+ if status_code == 200
438
+ begin
439
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
440
+ result_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignmentListResult.mapper()
441
+ result.body = @client.deserialize(result_mapper, parsed_response)
442
+ rescue Exception => e
443
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
444
+ end
445
+ end
446
+
447
+ result
448
+ end
449
+
450
+ promise.execute
451
+ end
452
+
453
+ #
454
+ # Creates a Kusto cluster database principalAssignment.
455
+ #
456
+ # @param resource_group_name [String] The name of the resource group containing
457
+ # the Kusto cluster.
458
+ # @param cluster_name [String] The name of the Kusto cluster.
459
+ # @param database_name [String] The name of the database in the Kusto cluster.
460
+ # @param principal_assignment_name [String] The name of the Kusto
461
+ # principalAssignment.
462
+ # @param parameters [DatabasePrincipalAssignment] The Kusto
463
+ # principalAssignments parameters supplied for the operation.
464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
465
+ # will be added to the HTTP request.
466
+ #
467
+ # @return [DatabasePrincipalAssignment] operation results.
468
+ #
469
+ def begin_create_or_update(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:nil)
470
+ response = begin_create_or_update_async(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:custom_headers).value!
471
+ response.body unless response.nil?
472
+ end
473
+
474
+ #
475
+ # Creates a Kusto cluster database principalAssignment.
476
+ #
477
+ # @param resource_group_name [String] The name of the resource group containing
478
+ # the Kusto cluster.
479
+ # @param cluster_name [String] The name of the Kusto cluster.
480
+ # @param database_name [String] The name of the database in the Kusto cluster.
481
+ # @param principal_assignment_name [String] The name of the Kusto
482
+ # principalAssignment.
483
+ # @param parameters [DatabasePrincipalAssignment] The Kusto
484
+ # principalAssignments parameters supplied for the operation.
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
489
+ #
490
+ def begin_create_or_update_with_http_info(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:nil)
491
+ begin_create_or_update_async(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:custom_headers).value!
492
+ end
493
+
494
+ #
495
+ # Creates a Kusto cluster database principalAssignment.
496
+ #
497
+ # @param resource_group_name [String] The name of the resource group containing
498
+ # the Kusto cluster.
499
+ # @param cluster_name [String] The name of the Kusto cluster.
500
+ # @param database_name [String] The name of the database in the Kusto cluster.
501
+ # @param principal_assignment_name [String] The name of the Kusto
502
+ # principalAssignment.
503
+ # @param parameters [DatabasePrincipalAssignment] The Kusto
504
+ # principalAssignments parameters supplied for the operation.
505
+ # @param [Hash{String => String}] A hash of custom headers that will be added
506
+ # to the HTTP request.
507
+ #
508
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
509
+ #
510
+ def begin_create_or_update_async(resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers:nil)
511
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
512
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
513
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
514
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
515
+ fail ArgumentError, 'principal_assignment_name is nil' if principal_assignment_name.nil?
516
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
517
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
518
+
519
+
520
+ request_headers = {}
521
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
522
+
523
+ # Set Headers
524
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
525
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
526
+
527
+ # Serialize Request
528
+ request_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignment.mapper()
529
+ request_content = @client.serialize(request_mapper, parameters)
530
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
531
+
532
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'
533
+
534
+ request_url = @base_url || @client.base_url
535
+
536
+ options = {
537
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
538
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'principalAssignmentName' => principal_assignment_name},
539
+ query_params: {'api-version' => @client.api_version},
540
+ body: request_content,
541
+ headers: request_headers.merge(custom_headers || {}),
542
+ base_url: request_url
543
+ }
544
+ promise = @client.make_request_async(:put, path_template, options)
545
+
546
+ promise = promise.then do |result|
547
+ http_response = result.response
548
+ status_code = http_response.status
549
+ response_content = http_response.body
550
+ unless status_code == 200 || status_code == 201
551
+ error_model = JSON.load(response_content)
552
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
553
+ end
554
+
555
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
556
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
557
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
558
+ # Deserialize Response
559
+ if status_code == 200
560
+ begin
561
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
562
+ result_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignment.mapper()
563
+ result.body = @client.deserialize(result_mapper, parsed_response)
564
+ rescue Exception => e
565
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
566
+ end
567
+ end
568
+ # Deserialize Response
569
+ if status_code == 201
570
+ begin
571
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
572
+ result_mapper = Azure::Kusto::Mgmt::V2020_09_18::Models::DatabasePrincipalAssignment.mapper()
573
+ result.body = @client.deserialize(result_mapper, parsed_response)
574
+ rescue Exception => e
575
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
576
+ end
577
+ end
578
+
579
+ result
580
+ end
581
+
582
+ promise.execute
583
+ end
584
+
585
+ #
586
+ # Deletes a Kusto principalAssignment.
587
+ #
588
+ # @param resource_group_name [String] The name of the resource group containing
589
+ # the Kusto cluster.
590
+ # @param cluster_name [String] The name of the Kusto cluster.
591
+ # @param database_name [String] The name of the database in the Kusto cluster.
592
+ # @param principal_assignment_name [String] The name of the Kusto
593
+ # principalAssignment.
594
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
595
+ # will be added to the HTTP request.
596
+ #
597
+ #
598
+ def begin_delete(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
599
+ response = begin_delete_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
600
+ nil
601
+ end
602
+
603
+ #
604
+ # Deletes a Kusto principalAssignment.
605
+ #
606
+ # @param resource_group_name [String] The name of the resource group containing
607
+ # the Kusto cluster.
608
+ # @param cluster_name [String] The name of the Kusto cluster.
609
+ # @param database_name [String] The name of the database in the Kusto cluster.
610
+ # @param principal_assignment_name [String] The name of the Kusto
611
+ # principalAssignment.
612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
613
+ # will be added to the HTTP request.
614
+ #
615
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
616
+ #
617
+ def begin_delete_with_http_info(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
618
+ begin_delete_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:custom_headers).value!
619
+ end
620
+
621
+ #
622
+ # Deletes a Kusto principalAssignment.
623
+ #
624
+ # @param resource_group_name [String] The name of the resource group containing
625
+ # the Kusto cluster.
626
+ # @param cluster_name [String] The name of the Kusto cluster.
627
+ # @param database_name [String] The name of the database in the Kusto cluster.
628
+ # @param principal_assignment_name [String] The name of the Kusto
629
+ # principalAssignment.
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 begin_delete_async(resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers:nil)
636
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
637
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
638
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
639
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
640
+ fail ArgumentError, 'principal_assignment_name is nil' if principal_assignment_name.nil?
641
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
642
+
643
+
644
+ request_headers = {}
645
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
646
+
647
+ # Set Headers
648
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
649
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
650
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'
651
+
652
+ request_url = @base_url || @client.base_url
653
+
654
+ options = {
655
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
656
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'principalAssignmentName' => principal_assignment_name},
657
+ query_params: {'api-version' => @client.api_version},
658
+ headers: request_headers.merge(custom_headers || {}),
659
+ base_url: request_url
660
+ }
661
+ promise = @client.make_request_async(:delete, path_template, options)
662
+
663
+ promise = promise.then do |result|
664
+ http_response = result.response
665
+ status_code = http_response.status
666
+ response_content = http_response.body
667
+ unless status_code == 200 || status_code == 202 || status_code == 204
668
+ error_model = JSON.load(response_content)
669
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
670
+ end
671
+
672
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
673
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
674
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
675
+
676
+ result
677
+ end
678
+
679
+ promise.execute
680
+ end
681
+
682
+ end
683
+ end