azure_mgmt_kusto 0.17.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.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto.rb +70 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/clusters.rb +1281 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/databases.rb +1131 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/event_hub_connections.rb +854 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/kusto_management_client.rb +145 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_capacity.rb +81 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_entity_resource.rb +75 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_resource_sku.rb +71 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_scale_type.rb +17 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_sku.rb +72 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/azure_sku_name.rb +22 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/check_name_result.rb +71 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster.rb +183 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster_check_name_request.rb +61 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster_list_result.rb +55 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/cluster_update.rb +188 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/data_format.rb +17 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database.rb +148 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_check_name_request.rb +62 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_list_result.rb +55 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal.rb +106 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_list_request.rb +56 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_list_result.rb +56 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_role.rb +20 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_principal_type.rb +17 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_statistics.rb +48 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/database_update.rb +135 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection.rb +133 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_list_result.rb +56 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_update.rb +133 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_validation.rb +106 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_list_result.rb +56 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_result.rb +48 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/list_resource_skus_result.rb +56 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/list_skus_result.rb +56 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/operation.rb +82 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/operation_display.rb +80 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/operation_list_result.rb +98 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/provisioning_state.rb +19 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/proxy_resource.rb +63 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/resource.rb +83 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/state.rb +22 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/tracked_resource.rb +92 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/models/trusted_external_tenant.rb +47 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/module_definition.rb +9 -0
- data/lib/2017-09-07-privatepreview/generated/azure_mgmt_kusto/operations.rb +217 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto.rb +70 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/clusters.rb +1281 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/databases.rb +1131 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/event_hub_connections.rb +854 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/kusto_management_client.rb +145 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_capacity.rb +81 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_entity_resource.rb +75 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_resource_sku.rb +71 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_scale_type.rb +17 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_sku.rb +72 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/azure_sku_name.rb +22 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/check_name_result.rb +71 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster.rb +183 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_check_name_request.rb +61 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_list_result.rb +55 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/cluster_update.rb +188 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/data_format.rb +17 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database.rb +148 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_check_name_request.rb +62 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_list_result.rb +55 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal.rb +106 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_list_request.rb +56 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_list_result.rb +56 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_role.rb +20 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_principal_type.rb +17 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_statistics.rb +48 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/database_update.rb +135 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection.rb +133 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_list_result.rb +56 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_update.rb +133 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation.rb +106 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_list_result.rb +56 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/event_hub_connection_validation_result.rb +48 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/list_resource_skus_result.rb +56 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/list_skus_result.rb +56 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/operation.rb +82 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/operation_display.rb +80 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/operation_list_result.rb +98 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/provisioning_state.rb +19 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/proxy_resource.rb +63 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/resource.rb +83 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/state.rb +22 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/tracked_resource.rb +92 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/models/trusted_external_tenant.rb +47 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/module_definition.rb +9 -0
- data/lib/2018-09-07-preview/generated/azure_mgmt_kusto/operations.rb +217 -0
- data/lib/azure_mgmt_kusto.rb +7 -0
- data/lib/module_definition.rb +8 -0
- data/lib/profiles/latest/kusto_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/kusto_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/kusto_profile_module.rb +223 -0
- data/lib/version.rb +7 -0
- metadata +218 -0
|
@@ -0,0 +1,854 @@
|
|
|
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 EventHubConnections
|
|
13
|
+
include MsRestAzure
|
|
14
|
+
|
|
15
|
+
#
|
|
16
|
+
# Creates and initializes a new instance of the EventHubConnections 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
|
+
# Returns the list of Event Hub connections of the given Kusto database.
|
|
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 database_name [String] The name of the database in the Kusto cluster.
|
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
34
|
+
# will be added to the HTTP request.
|
|
35
|
+
#
|
|
36
|
+
# @return [EventHubConnectionListResult] operation results.
|
|
37
|
+
#
|
|
38
|
+
def list_by_database(resource_group_name, cluster_name, database_name, custom_headers:nil)
|
|
39
|
+
response = list_by_database_async(resource_group_name, cluster_name, database_name, custom_headers:custom_headers).value!
|
|
40
|
+
response.body unless response.nil?
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
#
|
|
44
|
+
# Returns the list of Event Hub connections of the given Kusto database.
|
|
45
|
+
#
|
|
46
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
47
|
+
# the Kusto cluster.
|
|
48
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
49
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
51
|
+
# will be added to the HTTP request.
|
|
52
|
+
#
|
|
53
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
54
|
+
#
|
|
55
|
+
def list_by_database_with_http_info(resource_group_name, cluster_name, database_name, custom_headers:nil)
|
|
56
|
+
list_by_database_async(resource_group_name, cluster_name, database_name, custom_headers:custom_headers).value!
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
#
|
|
60
|
+
# Returns the list of Event Hub connections of the given Kusto database.
|
|
61
|
+
#
|
|
62
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
63
|
+
# the Kusto cluster.
|
|
64
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
65
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
66
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
67
|
+
# to the HTTP request.
|
|
68
|
+
#
|
|
69
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
70
|
+
#
|
|
71
|
+
def list_by_database_async(resource_group_name, cluster_name, database_name, custom_headers:nil)
|
|
72
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
73
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
|
74
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
75
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
76
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
request_headers = {}
|
|
80
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
81
|
+
|
|
82
|
+
# Set Headers
|
|
83
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
84
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
85
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections'
|
|
86
|
+
|
|
87
|
+
request_url = @base_url || @client.base_url
|
|
88
|
+
|
|
89
|
+
options = {
|
|
90
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
91
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
|
|
92
|
+
query_params: {'api-version' => @client.api_version},
|
|
93
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
94
|
+
base_url: request_url
|
|
95
|
+
}
|
|
96
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
97
|
+
|
|
98
|
+
promise = promise.then do |result|
|
|
99
|
+
http_response = result.response
|
|
100
|
+
status_code = http_response.status
|
|
101
|
+
response_content = http_response.body
|
|
102
|
+
unless status_code == 200
|
|
103
|
+
error_model = JSON.load(response_content)
|
|
104
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
108
|
+
# Deserialize Response
|
|
109
|
+
if status_code == 200
|
|
110
|
+
begin
|
|
111
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
112
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnectionListResult.mapper()
|
|
113
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
114
|
+
rescue Exception => e
|
|
115
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
result
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
promise.execute
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
#
|
|
126
|
+
# Checks that the Event Hub data connection parameters are valid.
|
|
127
|
+
#
|
|
128
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
129
|
+
# the Kusto cluster.
|
|
130
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
131
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
132
|
+
# @param parameters [EventHubConnectionValidation] The Event Hub connection
|
|
133
|
+
# parameters supplied to the CreateOrUpdate operation.
|
|
134
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
135
|
+
# will be added to the HTTP request.
|
|
136
|
+
#
|
|
137
|
+
# @return [EventHubConnectionValidationListResult] operation results.
|
|
138
|
+
#
|
|
139
|
+
def eventhub_connection_validation(resource_group_name, cluster_name, database_name, parameters, custom_headers:nil)
|
|
140
|
+
response = eventhub_connection_validation_async(resource_group_name, cluster_name, database_name, parameters, custom_headers:custom_headers).value!
|
|
141
|
+
response.body unless response.nil?
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
#
|
|
145
|
+
# Checks that the Event Hub data connection parameters are valid.
|
|
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 parameters [EventHubConnectionValidation] The Event Hub connection
|
|
152
|
+
# parameters supplied to the CreateOrUpdate operation.
|
|
153
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
154
|
+
# will be added to the HTTP request.
|
|
155
|
+
#
|
|
156
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
157
|
+
#
|
|
158
|
+
def eventhub_connection_validation_with_http_info(resource_group_name, cluster_name, database_name, parameters, custom_headers:nil)
|
|
159
|
+
eventhub_connection_validation_async(resource_group_name, cluster_name, database_name, parameters, custom_headers:custom_headers).value!
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
#
|
|
163
|
+
# Checks that the Event Hub data connection parameters are valid.
|
|
164
|
+
#
|
|
165
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
166
|
+
# the Kusto cluster.
|
|
167
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
168
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
169
|
+
# @param parameters [EventHubConnectionValidation] The Event Hub connection
|
|
170
|
+
# parameters supplied to the CreateOrUpdate operation.
|
|
171
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
172
|
+
# to the HTTP request.
|
|
173
|
+
#
|
|
174
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
175
|
+
#
|
|
176
|
+
def eventhub_connection_validation_async(resource_group_name, cluster_name, database_name, parameters, custom_headers:nil)
|
|
177
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
178
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
|
179
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
180
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
181
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
182
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
request_headers = {}
|
|
186
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
187
|
+
|
|
188
|
+
# Set Headers
|
|
189
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
190
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
191
|
+
|
|
192
|
+
# Serialize Request
|
|
193
|
+
request_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnectionValidation.mapper()
|
|
194
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
195
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
196
|
+
|
|
197
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubConnectionValidation'
|
|
198
|
+
|
|
199
|
+
request_url = @base_url || @client.base_url
|
|
200
|
+
|
|
201
|
+
options = {
|
|
202
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
203
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
|
|
204
|
+
query_params: {'api-version' => @client.api_version},
|
|
205
|
+
body: request_content,
|
|
206
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
207
|
+
base_url: request_url
|
|
208
|
+
}
|
|
209
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
210
|
+
|
|
211
|
+
promise = promise.then do |result|
|
|
212
|
+
http_response = result.response
|
|
213
|
+
status_code = http_response.status
|
|
214
|
+
response_content = http_response.body
|
|
215
|
+
unless status_code == 200
|
|
216
|
+
error_model = JSON.load(response_content)
|
|
217
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
221
|
+
# Deserialize Response
|
|
222
|
+
if status_code == 200
|
|
223
|
+
begin
|
|
224
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
225
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnectionValidationListResult.mapper()
|
|
226
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
227
|
+
rescue Exception => e
|
|
228
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
result
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
promise.execute
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
#
|
|
239
|
+
# Returns an Event Hub connection.
|
|
240
|
+
#
|
|
241
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
242
|
+
# the Kusto cluster.
|
|
243
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
244
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
245
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
246
|
+
# connection.
|
|
247
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
248
|
+
# will be added to the HTTP request.
|
|
249
|
+
#
|
|
250
|
+
# @return [EventHubConnection] operation results.
|
|
251
|
+
#
|
|
252
|
+
def get(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
253
|
+
response = get_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
|
|
254
|
+
response.body unless response.nil?
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
#
|
|
258
|
+
# Returns an Event Hub connection.
|
|
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 database_name [String] The name of the database in the Kusto cluster.
|
|
264
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
265
|
+
# connection.
|
|
266
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
267
|
+
# will be added to the HTTP request.
|
|
268
|
+
#
|
|
269
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
270
|
+
#
|
|
271
|
+
def get_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
272
|
+
get_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
#
|
|
276
|
+
# Returns an Event Hub connection.
|
|
277
|
+
#
|
|
278
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
279
|
+
# the Kusto cluster.
|
|
280
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
281
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
282
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
283
|
+
# connection.
|
|
284
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
285
|
+
# to the HTTP request.
|
|
286
|
+
#
|
|
287
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
288
|
+
#
|
|
289
|
+
def get_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
290
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
291
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
|
292
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
293
|
+
fail ArgumentError, 'event_hub_connection_name is nil' if event_hub_connection_name.nil?
|
|
294
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
295
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
request_headers = {}
|
|
299
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
300
|
+
|
|
301
|
+
# Set Headers
|
|
302
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
303
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
304
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'
|
|
305
|
+
|
|
306
|
+
request_url = @base_url || @client.base_url
|
|
307
|
+
|
|
308
|
+
options = {
|
|
309
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
310
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'eventHubConnectionName' => event_hub_connection_name,'subscriptionId' => @client.subscription_id},
|
|
311
|
+
query_params: {'api-version' => @client.api_version},
|
|
312
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
313
|
+
base_url: request_url
|
|
314
|
+
}
|
|
315
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
316
|
+
|
|
317
|
+
promise = promise.then do |result|
|
|
318
|
+
http_response = result.response
|
|
319
|
+
status_code = http_response.status
|
|
320
|
+
response_content = http_response.body
|
|
321
|
+
unless status_code == 200
|
|
322
|
+
error_model = JSON.load(response_content)
|
|
323
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
327
|
+
# Deserialize Response
|
|
328
|
+
if status_code == 200
|
|
329
|
+
begin
|
|
330
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
331
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
332
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
333
|
+
rescue Exception => e
|
|
334
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
result
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
promise.execute
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
#
|
|
345
|
+
# Creates or updates a Event Hub connection.
|
|
346
|
+
#
|
|
347
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
348
|
+
# the Kusto cluster.
|
|
349
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
350
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
351
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
352
|
+
# connection.
|
|
353
|
+
# @param parameters [EventHubConnection] The Event Hub connection parameters
|
|
354
|
+
# supplied to the CreateOrUpdate operation.
|
|
355
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
356
|
+
# will be added to the HTTP request.
|
|
357
|
+
#
|
|
358
|
+
# @return [EventHubConnection] operation results.
|
|
359
|
+
#
|
|
360
|
+
def create_or_update(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
361
|
+
response = create_or_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers).value!
|
|
362
|
+
response.body unless response.nil?
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
#
|
|
366
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
367
|
+
# the Kusto cluster.
|
|
368
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
369
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
370
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
371
|
+
# connection.
|
|
372
|
+
# @param parameters [EventHubConnection] The Event Hub connection parameters
|
|
373
|
+
# supplied to the CreateOrUpdate operation.
|
|
374
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
375
|
+
# will be added to the HTTP request.
|
|
376
|
+
#
|
|
377
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
378
|
+
# response.
|
|
379
|
+
#
|
|
380
|
+
def create_or_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
381
|
+
# Send request
|
|
382
|
+
promise = begin_create_or_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers)
|
|
383
|
+
|
|
384
|
+
promise = promise.then do |response|
|
|
385
|
+
# Defining deserialization method.
|
|
386
|
+
deserialize_method = lambda do |parsed_response|
|
|
387
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
388
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# Waiting for response.
|
|
392
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
promise
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
#
|
|
399
|
+
# Updates a Event Hub connection.
|
|
400
|
+
#
|
|
401
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
402
|
+
# the Kusto cluster.
|
|
403
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
404
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
405
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
406
|
+
# connection.
|
|
407
|
+
# @param parameters [EventHubConnectionUpdate] The Event Hub connection
|
|
408
|
+
# parameters supplied to the Update operation.
|
|
409
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
410
|
+
# will be added to the HTTP request.
|
|
411
|
+
#
|
|
412
|
+
# @return [EventHubConnection] operation results.
|
|
413
|
+
#
|
|
414
|
+
def update(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
415
|
+
response = update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers).value!
|
|
416
|
+
response.body unless response.nil?
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
#
|
|
420
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
421
|
+
# the Kusto cluster.
|
|
422
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
423
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
424
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
425
|
+
# connection.
|
|
426
|
+
# @param parameters [EventHubConnectionUpdate] The Event Hub connection
|
|
427
|
+
# parameters supplied to the Update operation.
|
|
428
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
429
|
+
# will be added to the HTTP request.
|
|
430
|
+
#
|
|
431
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
432
|
+
# response.
|
|
433
|
+
#
|
|
434
|
+
def update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
435
|
+
# Send request
|
|
436
|
+
promise = begin_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers)
|
|
437
|
+
|
|
438
|
+
promise = promise.then do |response|
|
|
439
|
+
# Defining deserialization method.
|
|
440
|
+
deserialize_method = lambda do |parsed_response|
|
|
441
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
442
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
# Waiting for response.
|
|
446
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
promise
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
#
|
|
453
|
+
# Deletes the Event Hub connection with the given name.
|
|
454
|
+
#
|
|
455
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
456
|
+
# the Kusto cluster.
|
|
457
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
458
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
459
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
460
|
+
# connection.
|
|
461
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
462
|
+
# will be added to the HTTP request.
|
|
463
|
+
#
|
|
464
|
+
def delete(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
465
|
+
response = delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
|
|
466
|
+
nil
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
#
|
|
470
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
471
|
+
# the Kusto cluster.
|
|
472
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
473
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
474
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
475
|
+
# connection.
|
|
476
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
477
|
+
# will be added to the HTTP request.
|
|
478
|
+
#
|
|
479
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
480
|
+
# response.
|
|
481
|
+
#
|
|
482
|
+
def delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
483
|
+
# Send request
|
|
484
|
+
promise = begin_delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers)
|
|
485
|
+
|
|
486
|
+
promise = promise.then do |response|
|
|
487
|
+
# Defining deserialization method.
|
|
488
|
+
deserialize_method = lambda do |parsed_response|
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# Waiting for response.
|
|
492
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
promise
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
#
|
|
499
|
+
# Creates or updates a Event Hub connection.
|
|
500
|
+
#
|
|
501
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
502
|
+
# the Kusto cluster.
|
|
503
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
504
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
505
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
506
|
+
# connection.
|
|
507
|
+
# @param parameters [EventHubConnection] The Event Hub connection parameters
|
|
508
|
+
# supplied to the CreateOrUpdate operation.
|
|
509
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
510
|
+
# will be added to the HTTP request.
|
|
511
|
+
#
|
|
512
|
+
# @return [EventHubConnection] operation results.
|
|
513
|
+
#
|
|
514
|
+
def begin_create_or_update(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
515
|
+
response = begin_create_or_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers).value!
|
|
516
|
+
response.body unless response.nil?
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
#
|
|
520
|
+
# Creates or updates a Event Hub connection.
|
|
521
|
+
#
|
|
522
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
523
|
+
# the Kusto cluster.
|
|
524
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
525
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
526
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
527
|
+
# connection.
|
|
528
|
+
# @param parameters [EventHubConnection] The Event Hub connection parameters
|
|
529
|
+
# supplied to the CreateOrUpdate operation.
|
|
530
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
531
|
+
# will be added to the HTTP request.
|
|
532
|
+
#
|
|
533
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
534
|
+
#
|
|
535
|
+
def begin_create_or_update_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
536
|
+
begin_create_or_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers).value!
|
|
537
|
+
end
|
|
538
|
+
|
|
539
|
+
#
|
|
540
|
+
# Creates or updates a Event Hub connection.
|
|
541
|
+
#
|
|
542
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
543
|
+
# the Kusto cluster.
|
|
544
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
545
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
546
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
547
|
+
# connection.
|
|
548
|
+
# @param parameters [EventHubConnection] The Event Hub connection parameters
|
|
549
|
+
# supplied to the CreateOrUpdate operation.
|
|
550
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
551
|
+
# to the HTTP request.
|
|
552
|
+
#
|
|
553
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
554
|
+
#
|
|
555
|
+
def begin_create_or_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
556
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
557
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
|
558
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
559
|
+
fail ArgumentError, 'event_hub_connection_name is nil' if event_hub_connection_name.nil?
|
|
560
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
561
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
562
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
request_headers = {}
|
|
566
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
567
|
+
|
|
568
|
+
# Set Headers
|
|
569
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
570
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
571
|
+
|
|
572
|
+
# Serialize Request
|
|
573
|
+
request_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
574
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
575
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
576
|
+
|
|
577
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'
|
|
578
|
+
|
|
579
|
+
request_url = @base_url || @client.base_url
|
|
580
|
+
|
|
581
|
+
options = {
|
|
582
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
583
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'eventHubConnectionName' => event_hub_connection_name,'subscriptionId' => @client.subscription_id},
|
|
584
|
+
query_params: {'api-version' => @client.api_version},
|
|
585
|
+
body: request_content,
|
|
586
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
587
|
+
base_url: request_url
|
|
588
|
+
}
|
|
589
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
590
|
+
|
|
591
|
+
promise = promise.then do |result|
|
|
592
|
+
http_response = result.response
|
|
593
|
+
status_code = http_response.status
|
|
594
|
+
response_content = http_response.body
|
|
595
|
+
unless status_code == 200 || status_code == 201 || status_code == 202
|
|
596
|
+
error_model = JSON.load(response_content)
|
|
597
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
601
|
+
# Deserialize Response
|
|
602
|
+
if status_code == 200
|
|
603
|
+
begin
|
|
604
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
605
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
606
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
607
|
+
rescue Exception => e
|
|
608
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
609
|
+
end
|
|
610
|
+
end
|
|
611
|
+
# Deserialize Response
|
|
612
|
+
if status_code == 201
|
|
613
|
+
begin
|
|
614
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
615
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
616
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
617
|
+
rescue Exception => e
|
|
618
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
619
|
+
end
|
|
620
|
+
end
|
|
621
|
+
|
|
622
|
+
result
|
|
623
|
+
end
|
|
624
|
+
|
|
625
|
+
promise.execute
|
|
626
|
+
end
|
|
627
|
+
|
|
628
|
+
#
|
|
629
|
+
# Updates a Event Hub connection.
|
|
630
|
+
#
|
|
631
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
632
|
+
# the Kusto cluster.
|
|
633
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
634
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
635
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
636
|
+
# connection.
|
|
637
|
+
# @param parameters [EventHubConnectionUpdate] The Event Hub connection
|
|
638
|
+
# parameters supplied to the Update operation.
|
|
639
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
640
|
+
# will be added to the HTTP request.
|
|
641
|
+
#
|
|
642
|
+
# @return [EventHubConnection] operation results.
|
|
643
|
+
#
|
|
644
|
+
def begin_update(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
645
|
+
response = begin_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers).value!
|
|
646
|
+
response.body unless response.nil?
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
#
|
|
650
|
+
# Updates a Event Hub connection.
|
|
651
|
+
#
|
|
652
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
653
|
+
# the Kusto cluster.
|
|
654
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
655
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
656
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
657
|
+
# connection.
|
|
658
|
+
# @param parameters [EventHubConnectionUpdate] The Event Hub connection
|
|
659
|
+
# parameters supplied to the Update operation.
|
|
660
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
661
|
+
# will be added to the HTTP request.
|
|
662
|
+
#
|
|
663
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
664
|
+
#
|
|
665
|
+
def begin_update_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
666
|
+
begin_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:custom_headers).value!
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
#
|
|
670
|
+
# Updates a Event Hub connection.
|
|
671
|
+
#
|
|
672
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
673
|
+
# the Kusto cluster.
|
|
674
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
675
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
676
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
677
|
+
# connection.
|
|
678
|
+
# @param parameters [EventHubConnectionUpdate] The Event Hub connection
|
|
679
|
+
# parameters supplied to the Update operation.
|
|
680
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
681
|
+
# to the HTTP request.
|
|
682
|
+
#
|
|
683
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
684
|
+
#
|
|
685
|
+
def begin_update_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, parameters, custom_headers:nil)
|
|
686
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
687
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
|
688
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
689
|
+
fail ArgumentError, 'event_hub_connection_name is nil' if event_hub_connection_name.nil?
|
|
690
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
691
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
692
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
request_headers = {}
|
|
696
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
697
|
+
|
|
698
|
+
# Set Headers
|
|
699
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
700
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
701
|
+
|
|
702
|
+
# Serialize Request
|
|
703
|
+
request_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnectionUpdate.mapper()
|
|
704
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
705
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
706
|
+
|
|
707
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'
|
|
708
|
+
|
|
709
|
+
request_url = @base_url || @client.base_url
|
|
710
|
+
|
|
711
|
+
options = {
|
|
712
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
713
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'eventHubConnectionName' => event_hub_connection_name,'subscriptionId' => @client.subscription_id},
|
|
714
|
+
query_params: {'api-version' => @client.api_version},
|
|
715
|
+
body: request_content,
|
|
716
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
717
|
+
base_url: request_url
|
|
718
|
+
}
|
|
719
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
|
720
|
+
|
|
721
|
+
promise = promise.then do |result|
|
|
722
|
+
http_response = result.response
|
|
723
|
+
status_code = http_response.status
|
|
724
|
+
response_content = http_response.body
|
|
725
|
+
unless status_code == 200 || status_code == 201 || status_code == 202
|
|
726
|
+
error_model = JSON.load(response_content)
|
|
727
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
731
|
+
# Deserialize Response
|
|
732
|
+
if status_code == 200
|
|
733
|
+
begin
|
|
734
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
735
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
736
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
737
|
+
rescue Exception => e
|
|
738
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
739
|
+
end
|
|
740
|
+
end
|
|
741
|
+
# Deserialize Response
|
|
742
|
+
if status_code == 201
|
|
743
|
+
begin
|
|
744
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
745
|
+
result_mapper = Azure::Kusto::Mgmt::V2018_09_07_preview::Models::EventHubConnection.mapper()
|
|
746
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
747
|
+
rescue Exception => e
|
|
748
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
749
|
+
end
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
result
|
|
753
|
+
end
|
|
754
|
+
|
|
755
|
+
promise.execute
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
#
|
|
759
|
+
# Deletes the Event Hub connection with the given name.
|
|
760
|
+
#
|
|
761
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
762
|
+
# the Kusto cluster.
|
|
763
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
764
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
765
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
766
|
+
# connection.
|
|
767
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
768
|
+
# will be added to the HTTP request.
|
|
769
|
+
#
|
|
770
|
+
#
|
|
771
|
+
def begin_delete(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
772
|
+
response = begin_delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
|
|
773
|
+
nil
|
|
774
|
+
end
|
|
775
|
+
|
|
776
|
+
#
|
|
777
|
+
# Deletes the Event Hub connection with the given name.
|
|
778
|
+
#
|
|
779
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
780
|
+
# the Kusto cluster.
|
|
781
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
782
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
783
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
784
|
+
# connection.
|
|
785
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
786
|
+
# will be added to the HTTP request.
|
|
787
|
+
#
|
|
788
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
789
|
+
#
|
|
790
|
+
def begin_delete_with_http_info(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
791
|
+
begin_delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:custom_headers).value!
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
#
|
|
795
|
+
# Deletes the Event Hub connection with the given name.
|
|
796
|
+
#
|
|
797
|
+
# @param resource_group_name [String] The name of the resource group containing
|
|
798
|
+
# the Kusto cluster.
|
|
799
|
+
# @param cluster_name [String] The name of the Kusto cluster.
|
|
800
|
+
# @param database_name [String] The name of the database in the Kusto cluster.
|
|
801
|
+
# @param event_hub_connection_name [String] The name of the event hub
|
|
802
|
+
# connection.
|
|
803
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
804
|
+
# to the HTTP request.
|
|
805
|
+
#
|
|
806
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
807
|
+
#
|
|
808
|
+
def begin_delete_async(resource_group_name, cluster_name, database_name, event_hub_connection_name, custom_headers:nil)
|
|
809
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
810
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
|
811
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
812
|
+
fail ArgumentError, 'event_hub_connection_name is nil' if event_hub_connection_name.nil?
|
|
813
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
814
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
request_headers = {}
|
|
818
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
819
|
+
|
|
820
|
+
# Set Headers
|
|
821
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
822
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
823
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/eventhubconnections/{eventHubConnectionName}'
|
|
824
|
+
|
|
825
|
+
request_url = @base_url || @client.base_url
|
|
826
|
+
|
|
827
|
+
options = {
|
|
828
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
829
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'databaseName' => database_name,'eventHubConnectionName' => event_hub_connection_name,'subscriptionId' => @client.subscription_id},
|
|
830
|
+
query_params: {'api-version' => @client.api_version},
|
|
831
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
832
|
+
base_url: request_url
|
|
833
|
+
}
|
|
834
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
|
835
|
+
|
|
836
|
+
promise = promise.then do |result|
|
|
837
|
+
http_response = result.response
|
|
838
|
+
status_code = http_response.status
|
|
839
|
+
response_content = http_response.body
|
|
840
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
|
841
|
+
error_model = JSON.load(response_content)
|
|
842
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
843
|
+
end
|
|
844
|
+
|
|
845
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
846
|
+
|
|
847
|
+
result
|
|
848
|
+
end
|
|
849
|
+
|
|
850
|
+
promise.execute
|
|
851
|
+
end
|
|
852
|
+
|
|
853
|
+
end
|
|
854
|
+
end
|