Class: Azure::Kusto::Mgmt::V2019_05_15::Clusters

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb

Overview

The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Clusters

Creates and initializes a new instance of the Clusters class.

Parameters:

  • client

    service class for accessing basic functionality.



19
20
21
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 19

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientKustoManagementClient (readonly)

Returns reference to the KustoManagementClient.

Returns:



24
25
26
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 24

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Cluster

Create or update a Kusto cluster.

the Kusto cluster. CreateOrUpdate operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (Cluster)

    The Kusto cluster parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



815
816
817
818
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 815

def begin_create_or_update(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a Kusto cluster.

the Kusto cluster. CreateOrUpdate operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (Cluster)

    The Kusto cluster parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 850

def begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a Kusto cluster.

the Kusto cluster. CreateOrUpdate operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (Cluster)

    The Kusto cluster parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



833
834
835
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 833

def begin_create_or_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, cluster_name, custom_headers: nil) ⇒ Object

Deletes a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1054
1055
1056
1057
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1054

def begin_delete(resource_group_name, cluster_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a Kusto cluster.

the Kusto cluster. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1085

def begin_delete_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1070
1071
1072
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1070

def begin_delete_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
  begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
end

#begin_start(resource_group_name, cluster_name, custom_headers: nil) ⇒ Object

Starts a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1226
1227
1228
1229
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1226

def begin_start(resource_group_name, cluster_name, custom_headers:nil)
  response = begin_start_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  nil
end

#begin_start_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

Starts a Kusto cluster.

the Kusto cluster. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1257

def begin_start_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_start_with_http_info(resource_group_name, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Starts a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1242
1243
1244
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1242

def begin_start_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
  begin_start_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
end

#begin_stop(resource_group_name, cluster_name, custom_headers: nil) ⇒ Object

Stops a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1140
1141
1142
1143
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1140

def begin_stop(resource_group_name, cluster_name, custom_headers:nil)
  response = begin_stop_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  nil
end

#begin_stop_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

Stops a Kusto cluster.

the Kusto cluster. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1171

def begin_stop_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_stop_with_http_info(resource_group_name, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Stops a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1156
1157
1158
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 1156

def begin_stop_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
  begin_stop_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Cluster

Update a Kusto cluster.

the Kusto cluster. the Update operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (ClusterUpdate)

    The Kusto cluster parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



936
937
938
939
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 936

def begin_update(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update a Kusto cluster.

the Kusto cluster. the Update operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (ClusterUpdate)

    The Kusto cluster parameters supplied to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 971

def begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::ClusterUpdate.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update a Kusto cluster.

the Kusto cluster. the Update operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (ClusterUpdate)

    The Kusto cluster parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



954
955
956
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 954

def begin_update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

#check_name_availability(location, cluster_name, custom_headers: nil) ⇒ CheckNameResult

Checks that the cluster name is valid and is not already in use.

will be added to the HTTP request.

Parameters:

  • location (String)

    Azure location.

  • cluster_name (ClusterCheckNameRequest)

    The name of the cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (CheckNameResult)

    operation results.



614
615
616
617
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 614

def check_name_availability(location, cluster_name, custom_headers:nil)
  response = check_name_availability_async(location, cluster_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(location, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks that the cluster name is valid and is not already in use.

to the HTTP request.

Parameters:

  • location (String)

    Azure location.

  • cluster_name (ClusterCheckNameRequest)

    The name of the cluster.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 643

def check_name_availability_async(location, cluster_name, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::ClusterCheckNameRequest.mapper()
  request_content = @client.serialize(request_mapper,  cluster_name)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::CheckNameResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#check_name_availability_with_http_info(location, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks that the cluster name is valid and is not already in use.

will be added to the HTTP request.

Parameters:

  • location (String)

    Azure location.

  • cluster_name (ClusterCheckNameRequest)

    The name of the cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



629
630
631
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 629

def check_name_availability_with_http_info(location, cluster_name, custom_headers:nil)
  check_name_availability_async(location, cluster_name, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Cluster

Create or update a Kusto cluster.

the Kusto cluster. CreateOrUpdate operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (Cluster)

    The Kusto cluster parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



136
137
138
139
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 136

def create_or_update(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

the Kusto cluster. CreateOrUpdate operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (Cluster)

    The Kusto cluster parameters supplied to the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 153

def create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, cluster_name, custom_headers: nil) ⇒ Object

Deletes a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



228
229
230
231
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 228

def delete(resource_group_name, cluster_name, custom_headers:nil)
  response = delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

the Kusto cluster. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 243

def delete_async(resource_group_name, cluster_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get(resource_group_name, cluster_name, custom_headers: nil) ⇒ Cluster

Gets a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



37
38
39
40
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 37

def get(resource_group_name, cluster_name, custom_headers:nil)
  response = get_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets a Kusto cluster.

the Kusto cluster. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 68

def get_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_with_http_info(resource_group_name, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



53
54
55
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 53

def get_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
  get_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
end

#list(custom_headers: nil) ⇒ ClusterListResult

Lists all Kusto clusters within a subscription.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ClusterListResult)

    operation results.



440
441
442
443
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 440

def list(custom_headers:nil)
  response = list_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_async(custom_headers: nil) ⇒ Concurrent::Promise

Lists all Kusto clusters within a subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 465

def list_async(custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::ClusterListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group(resource_group_name, custom_headers: nil) ⇒ ClusterListResult

Lists all Kusto clusters within a resource group.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ClusterListResult)

    operation results.



349
350
351
352
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 349

def list_by_resource_group(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists all Kusto clusters within a resource group.

the Kusto cluster. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 378

def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::ClusterListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all Kusto clusters within a resource group.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



364
365
366
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 364

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_skus(custom_headers: nil) ⇒ SkuDescriptionList

Lists eligible SKUs for Kusto resource provider.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SkuDescriptionList)

    operation results.



526
527
528
529
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 526

def list_skus(custom_headers:nil)
  response = list_skus_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_skus_async(custom_headers: nil) ⇒ Concurrent::Promise

Lists eligible SKUs for Kusto resource provider.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 551

def list_skus_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::SkuDescriptionList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_skus_by_resource(resource_group_name, cluster_name, custom_headers: nil) ⇒ ListResourceSkusResult

Returns the SKUs available for the provided resource.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ListResourceSkusResult)

    operation results.



716
717
718
719
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 716

def list_skus_by_resource(resource_group_name, cluster_name, custom_headers:nil)
  response = list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

Returns the SKUs available for the provided resource.

the Kusto cluster. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 747

def list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::ListResourceSkusResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_skus_by_resource_with_http_info(resource_group_name, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns the SKUs available for the provided resource.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



732
733
734
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 732

def list_skus_by_resource_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
  list_skus_by_resource_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
end

#list_skus_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists eligible SKUs for Kusto resource provider.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



539
540
541
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 539

def list_skus_with_http_info(custom_headers:nil)
  list_skus_async(custom_headers:custom_headers).value!
end

#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all Kusto clusters within a subscription.

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



453
454
455
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 453

def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end

#start(resource_group_name, cluster_name, custom_headers: nil) ⇒ Object

Starts a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



308
309
310
311
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 308

def start(resource_group_name, cluster_name, custom_headers:nil)
  response = start_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  nil
end

#start_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

the Kusto cluster. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 323

def start_async(resource_group_name, cluster_name, custom_headers:nil)
  # Send request
  promise = begin_start_async(resource_group_name, cluster_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#stop(resource_group_name, cluster_name, custom_headers: nil) ⇒ Object

Stops a Kusto cluster.

the Kusto cluster. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



268
269
270
271
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 268

def stop(resource_group_name, cluster_name, custom_headers:nil)
  response = stop_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
  nil
end

#stop_async(resource_group_name, cluster_name, custom_headers: nil) ⇒ Concurrent::Promise

the Kusto cluster. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 283

def stop_async(resource_group_name, cluster_name, custom_headers:nil)
  # Send request
  promise = begin_stop_async(resource_group_name, cluster_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#update(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Cluster

Update a Kusto cluster.

the Kusto cluster. the Update operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (ClusterUpdate)

    The Kusto cluster parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



184
185
186
187
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 184

def update(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

the Kusto cluster. the Update operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group containing

  • cluster_name (String)

    The name of the Kusto cluster.

  • parameters (ClusterUpdate)

    The Kusto cluster parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/2019-05-15/generated/azure_mgmt_kusto/clusters.rb', line 201

def update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Kusto::Mgmt::V2019_05_15::Models::Cluster.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end