Class: Azure::Hdinsight::Mgmt::V2018_06_01_preview::Clusters

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb

Overview

HDInsight Management Client

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.



17
18
19
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientHDInsightManagementClient (readonly)

Returns reference to the HDInsightManagementClient.

Returns:



22
23
24
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 22

def client
  @client
end

Instance Method Details

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

Creates a new HDInsight cluster with the specified parameters.

request. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterCreateParametersExtended)

    The cluster create

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

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



799
800
801
802
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 799

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

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

Creates a new HDInsight cluster with the specified parameters.

request. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterCreateParametersExtended)

    The cluster create

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
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
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 832

def begin_create_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterCreateParametersExtended.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.HDInsight/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new HDInsight cluster with the specified parameters.

request. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterCreateParametersExtended)

    The cluster create

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



816
817
818
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 816

def begin_create_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_create_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 the specified HDInsight cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

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

    A hash of custom headers that



904
905
906
907
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 904

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 the specified HDInsight cluster.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    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.



933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 933

def begin_delete_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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?


  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.HDInsight/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 the specified HDInsight cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    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.



919
920
921
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 919

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_execute_script_actions(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Executes script actions on the specified HDInsight cluster.

executing script actions. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ExecuteScriptActionParameters)

    The parameters for

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

    A hash of custom headers that



1379
1380
1381
1382
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1379

def begin_execute_script_actions(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Executes script actions on the specified HDInsight cluster.

executing script actions. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ExecuteScriptActionParameters)

    The parameters for

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1412

def begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::ExecuteScriptActionParameters.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.HDInsight/clusters/{clusterName}/executeScriptActions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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_execute_script_actions_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Executes script actions on the specified HDInsight cluster.

executing script actions. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ExecuteScriptActionParameters)

    The parameters for

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1396
1397
1398
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1396

def begin_execute_script_actions_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

#begin_resize(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Resizes the specified HDInsight cluster to the specified size.

operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterResizeParameters)

    The parameters for the resize

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

    A hash of custom headers that



989
990
991
992
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 989

def begin_resize(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Resizes the specified HDInsight cluster to the specified size.

operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterResizeParameters)

    The parameters for the resize

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1022

def begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  role_name = 'workernode'
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterResizeParameters.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.HDInsight/clusters/{clusterName}/roles/{roleName}/resize'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'roleName' => role_name},
      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 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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_resize_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Resizes the specified HDInsight cluster to the specified size.

operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterResizeParameters)

    The parameters for the resize

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1006
1007
1008
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1006

def begin_resize_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

#begin_rotate_disk_encryption_key(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Rotate disk encryption key of the specified HDInsight cluster.

disk encryption operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterDiskEncryptionParameters)

    The parameters for the

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

    A hash of custom headers that



1185
1186
1187
1188
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1185

def begin_rotate_disk_encryption_key(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Rotate disk encryption key of the specified HDInsight cluster.

disk encryption operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterDiskEncryptionParameters)

    The parameters for the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1218

def begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterDiskEncryptionParameters.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.HDInsight/clusters/{clusterName}/rotatediskencryptionkey'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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_rotate_disk_encryption_key_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Rotate disk encryption key of the specified HDInsight cluster.

disk encryption operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterDiskEncryptionParameters)

    The parameters for the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1202
1203
1204
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1202

def begin_rotate_disk_encryption_key_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

#begin_update_auto_scale_configuration(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Updates the Autoscale Configuration for HDInsight cluster.

the update autoscale configuration operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (AutoscaleConfigurationUpdateParameter)

    The parameters for

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

    A hash of custom headers that



1087
1088
1089
1090
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1087

def begin_update_auto_scale_configuration(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_update_auto_scale_configuration_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Updates the Autoscale Configuration for HDInsight cluster.

the update autoscale configuration operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (AutoscaleConfigurationUpdateParameter)

    The parameters for

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1120

def begin_update_auto_scale_configuration_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
  role_name = 'workernode'
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::AutoscaleConfigurationUpdateParameter.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.HDInsight/clusters/{clusterName}/roles/{roleName}/autoscale'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'roleName' => role_name},
      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 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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_update_auto_scale_configuration_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the Autoscale Configuration for HDInsight cluster.

the update autoscale configuration operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (AutoscaleConfigurationUpdateParameter)

    The parameters for

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1104
1105
1106
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1104

def begin_update_auto_scale_configuration_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_update_auto_scale_configuration_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

#begin_update_gateway_settings(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Configures the gateway settings on the specified cluster.

configurations. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (UpdateGatewaySettingsParameters)

    The cluster

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

    A hash of custom headers that



1282
1283
1284
1285
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1282

def begin_update_gateway_settings(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = begin_update_gateway_settings_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Configures the gateway settings on the specified cluster.

configurations. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (UpdateGatewaySettingsParameters)

    The cluster

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1315

def begin_update_gateway_settings_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::UpdateGatewaySettingsParameters.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.HDInsight/clusters/{clusterName}/updateGatewaySettings'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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_update_gateway_settings_with_http_info(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Configures the gateway settings on the specified cluster.

configurations. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (UpdateGatewaySettingsParameters)

    The cluster

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1299
1300
1301
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1299

def begin_update_gateway_settings_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  begin_update_gateway_settings_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end

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

Creates a new HDInsight cluster with the specified parameters.

request. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterCreateParametersExtended)

    The cluster create

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

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



36
37
38
39
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 36

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

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

request. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterCreateParametersExtended)

    The cluster create

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 52

def create_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_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::Hdinsight::Mgmt::V2018_06_01_preview::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 the specified HDInsight cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

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

    A hash of custom headers that



183
184
185
186
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 183

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the 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



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 197

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

#execute_script_actions(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Executes script actions on the specified HDInsight cluster.

executing script actions. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ExecuteScriptActionParameters)

    The parameters for

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

    A hash of custom headers that



755
756
757
758
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 755

def execute_script_actions(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

executing script actions. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ExecuteScriptActionParameters)

    The parameters for

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 771

def execute_script_actions_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_execute_script_actions_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|
    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 the specified cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

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

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



223
224
225
226
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 223

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 the specified cluster.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    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.



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 252

def get_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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?


  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.HDInsight/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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 MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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_gateway_settings(resource_group_name, cluster_name, custom_headers: nil) ⇒ GatewaySettings

Gets the gateway settings for the specified cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

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

    A hash of custom headers that

Returns:

  • (GatewaySettings)

    operation results.



619
620
621
622
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 619

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

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

Gets the gateway settings for the specified cluster.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    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.



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
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 648

def get_gateway_settings_async(resource_group_name, cluster_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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?


  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.HDInsight/clusters/{clusterName}/getGatewaySettings'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::GatewaySettings.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_gateway_settings_with_http_info(resource_group_name, cluster_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the gateway settings for the specified cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    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.



634
635
636
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 634

def get_gateway_settings_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
  get_gateway_settings_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
end

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

Gets the specified cluster.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    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.



238
239
240
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 238

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) ⇒ Array<Cluster>

Lists all the HDInsight clusters under the subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<Cluster>)

    operation results.



489
490
491
492
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 489

def list(custom_headers:nil)
  first_page = list_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(custom_headers: nil) ⇒ ClusterListResult

Lists all the HDInsight clusters under the subscription.

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (ClusterListResult)

    which provide lazy access to pages of the



1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1675

def list_as_lazy(custom_headers:nil)
  response = list_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Lists all the HDInsight clusters under the 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.



514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 514

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.HDInsight/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 MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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) ⇒ Array<Cluster>

Lists the HDInsight clusters in a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (Array<Cluster>)

    operation results.



316
317
318
319
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 316

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ ClusterListResult

Lists the HDInsight clusters in a resource group.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (ClusterListResult)

    which provide lazy access to pages of the



1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1655

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Lists the HDInsight clusters in a resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 343

def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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.HDInsight/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,'resourceGroupName' => resource_group_name},
      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 MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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_next(next_page_link, custom_headers: nil) ⇒ ClusterListResult

Lists the HDInsight clusters in a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ClusterListResult)

    operation results.



1475
1476
1477
1478
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1475

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists the HDInsight clusters in a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1504

def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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 MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the HDInsight clusters in a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1490
1491
1492
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1490

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Lists the HDInsight clusters in a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



330
331
332
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 330

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_next(next_page_link, custom_headers: nil) ⇒ ClusterListResult

Lists all the HDInsight clusters under the subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ClusterListResult)

    operation results.



1565
1566
1567
1568
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1565

def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists all the HDInsight clusters under the subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1594

def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      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 MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the HDInsight clusters under the subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1580
1581
1582
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 1580

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Lists all the HDInsight clusters under the 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.



502
503
504
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 502

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

#resize(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Resizes the specified HDInsight cluster to the specified size.

operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterResizeParameters)

    The parameters for the resize

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

    A hash of custom headers that



407
408
409
410
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 407

def resize(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = resize_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterResizeParameters)

    The parameters for the resize

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 423

def resize_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_resize_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|
    end

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

  promise
end

#rotate_disk_encryption_key(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Rotate disk encryption key of the specified HDInsight cluster.

disk encryption operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterDiskEncryptionParameters)

    The parameters for the

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

    A hash of custom headers that



577
578
579
580
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 577

def rotate_disk_encryption_key(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

disk encryption operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterDiskEncryptionParameters)

    The parameters for 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



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 593

def rotate_disk_encryption_key_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_rotate_disk_encryption_key_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|
    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

Patch HDInsight cluster with the specified parameters.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterPatchParameters)

    The cluster patch request.

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

    A hash of custom headers that

Returns:

  • (Cluster)

    operation results.



81
82
83
84
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 81

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

Patch HDInsight cluster with the specified parameters.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterPatchParameters)

    The cluster patch request.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 112

def update_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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, 'parameters is nil' if parameters.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::Hdinsight::Mgmt::V2018_06_01_preview::Models::ClusterPatchParameters.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.HDInsight/clusters/{clusterName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
      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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::Hdinsight::Mgmt::V2018_06_01_preview::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

#update_auto_scale_configuration(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Updates the Autoscale Configuration for HDInsight cluster.

the update autoscale configuration operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (AutoscaleConfigurationUpdateParameter)

    The parameters for

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

    A hash of custom headers that



449
450
451
452
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 449

def update_auto_scale_configuration(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = update_auto_scale_configuration_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

the update autoscale configuration operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (AutoscaleConfigurationUpdateParameter)

    The parameters for

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 465

def update_auto_scale_configuration_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_update_auto_scale_configuration_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|
    end

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

  promise
end

#update_gateway_settings(resource_group_name, cluster_name, parameters, custom_headers: nil) ⇒ Object

Configures the gateway settings on the specified cluster.

configurations. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (UpdateGatewaySettingsParameters)

    The cluster

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

    A hash of custom headers that



713
714
715
716
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 713

def update_gateway_settings(resource_group_name, cluster_name, parameters, custom_headers:nil)
  response = update_gateway_settings_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

configurations. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (UpdateGatewaySettingsParameters)

    The 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



729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 729

def update_gateway_settings_async(resource_group_name, cluster_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_update_gateway_settings_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|
    end

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

  promise
end

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

Patch HDInsight cluster with the specified parameters.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • cluster_name (String)

    The name of the cluster.

  • parameters (ClusterPatchParameters)

    The cluster patch request.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



97
98
99
# File 'lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb', line 97

def update_with_http_info(resource_group_name, cluster_name, parameters, custom_headers:nil)
  update_async(resource_group_name, cluster_name, parameters, custom_headers:custom_headers).value!
end