azure_mgmt_hdinsight 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight.rb +106 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/applications.rb +601 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/clusters.rb +1292 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/configurations.rb +289 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/extension_operations.rb +653 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +161 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/locations.rb +201 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application.rb +104 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb +68 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb +87 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb +102 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb +210 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/async_operation_state.rb +17 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/capabilities_result.rb +148 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster.rb +121 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb +89 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb +132 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_definition.rb +88 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_disk_encryption_parameters.rb +70 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb +209 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb +101 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb +61 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb +68 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb +99 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb +70 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb +57 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb +59 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb +54 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb +46 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb +55 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb +79 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb +71 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/directory_type.rb +15 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb +95 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb +57 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/errors.rb +57 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb +67 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb +57 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb +46 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/hdinsight_cluster_provisioning_state.rb +19 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/json_web_key_encryption_algorithm.rb +17 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb +69 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb +57 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb +58 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation_display.rb +69 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb +101 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb +60 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb +47 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/ostype.rb +16 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/proxy_resource.rb +63 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/quota_capability.rb +56 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb +46 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/regional_quota_capability.rb +68 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/regions_capability.rb +54 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb +80 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/resource_identity_type.rb +18 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/role.rb +144 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb +100 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action_detail.rb +178 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb +68 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb +101 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb +60 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb +99 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb +100 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb +159 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb +55 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/ssh_public_key.rb +46 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb +93 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb +56 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/tier.rb +16 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/tracked_resource.rb +92 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb +81 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb +55 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/version_spec.rb +87 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/versions_capability.rb +55 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb +57 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/vm_size_compatibility_filter.rb +141 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/models/vm_sizes_capability.rb +54 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/module_definition.rb +9 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/operations.rb +215 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb +408 -0
- data/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/script_execution_history.rb +312 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight.rb +98 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/applications.rb +601 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb +1292 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/configurations.rb +289 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/extensions.rb +735 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb +161 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/locations.rb +113 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application.rb +104 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb +68 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb +87 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb +102 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb +210 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/async_operation_state.rb +17 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster.rb +121 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb +89 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb +132 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_definition.rb +88 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_disk_encryption_parameters.rb +70 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb +209 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb +101 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb +61 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb +68 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb +99 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb +70 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb +57 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb +59 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb +54 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb +46 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb +55 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb +79 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb +71 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/directory_type.rb +15 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb +95 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb +57 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/errors.rb +57 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb +67 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb +57 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb +46 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hdinsight_cluster_provisioning_state.rb +19 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/json_web_key_encryption_algorithm.rb +17 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb +69 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb +57 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb +58 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_display.rb +69 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb +101 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb +60 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb +47 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ostype.rb +16 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/proxy_resource.rb +63 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb +46 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb +80 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource_identity_type.rb +18 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/role.rb +144 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action_detail.rb +178 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb +68 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb +101 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb +60 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb +99 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb +159 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb +55 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_public_key.rb +46 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb +93 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb +56 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tier.rb +16 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tracked_resource.rb +92 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb +81 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb +55 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb +57 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/module_definition.rb +9 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/operations.rb +215 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb +408 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/script_execution_history.rb +312 -0
- data/lib/azure_mgmt_hdinsight.rb +7 -0
- data/lib/module_definition.rb +8 -0
- data/lib/profiles/latest/hdinsight_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/hdinsight_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/hdinsight_profile_module.rb +327 -0
- data/lib/version.rb +7 -0
- metadata +282 -0
@@ -0,0 +1,312 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Hdinsight::Mgmt::V2015_03_01_preview
|
7
|
+
#
|
8
|
+
# HDInsight Management Client
|
9
|
+
#
|
10
|
+
class ScriptExecutionHistory
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ScriptExecutionHistory class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [HDInsightManagementClient] reference to the HDInsightManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists all scripts' execution history for the specified cluster.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group.
|
28
|
+
# @param cluster_name [String] The name of the cluster.
|
29
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
30
|
+
# will be added to the HTTP request.
|
31
|
+
#
|
32
|
+
# @return [Array<RuntimeScriptActionDetail>] operation results.
|
33
|
+
#
|
34
|
+
def list(resource_group_name, cluster_name, custom_headers:nil)
|
35
|
+
first_page = list_as_lazy(resource_group_name, cluster_name, custom_headers:custom_headers)
|
36
|
+
first_page.get_all_items
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Lists all scripts' execution history for the specified cluster.
|
41
|
+
#
|
42
|
+
# @param resource_group_name [String] The name of the resource group.
|
43
|
+
# @param cluster_name [String] The name of the cluster.
|
44
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
|
+
# will be added to the HTTP request.
|
46
|
+
#
|
47
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
|
+
#
|
49
|
+
def list_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
|
50
|
+
list_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Lists all scripts' execution history for the specified cluster.
|
55
|
+
#
|
56
|
+
# @param resource_group_name [String] The name of the resource group.
|
57
|
+
# @param cluster_name [String] The name of the cluster.
|
58
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
59
|
+
# to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
62
|
+
#
|
63
|
+
def list_async(resource_group_name, cluster_name, custom_headers:nil)
|
64
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
65
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
66
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
67
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
68
|
+
|
69
|
+
|
70
|
+
request_headers = {}
|
71
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
72
|
+
|
73
|
+
# Set Headers
|
74
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
75
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
76
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory'
|
77
|
+
|
78
|
+
request_url = @base_url || @client.base_url
|
79
|
+
|
80
|
+
options = {
|
81
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
82
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
|
83
|
+
query_params: {'api-version' => @client.api_version},
|
84
|
+
headers: request_headers.merge(custom_headers || {}),
|
85
|
+
base_url: request_url
|
86
|
+
}
|
87
|
+
promise = @client.make_request_async(:get, path_template, options)
|
88
|
+
|
89
|
+
promise = promise.then do |result|
|
90
|
+
http_response = result.response
|
91
|
+
status_code = http_response.status
|
92
|
+
response_content = http_response.body
|
93
|
+
unless status_code == 200
|
94
|
+
error_model = JSON.load(response_content)
|
95
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
96
|
+
end
|
97
|
+
|
98
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
99
|
+
# Deserialize Response
|
100
|
+
if status_code == 200
|
101
|
+
begin
|
102
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
103
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2015_03_01_preview::Models::ScriptActionExecutionHistoryList.mapper()
|
104
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
105
|
+
rescue Exception => e
|
106
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
result
|
111
|
+
end
|
112
|
+
|
113
|
+
promise.execute
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Promotes the specified ad-hoc script execution to a persisted script.
|
118
|
+
#
|
119
|
+
# @param resource_group_name [String] The name of the resource group.
|
120
|
+
# @param cluster_name [String] The name of the cluster.
|
121
|
+
# @param script_execution_id [String] The script execution Id
|
122
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
123
|
+
# will be added to the HTTP request.
|
124
|
+
#
|
125
|
+
#
|
126
|
+
def promote(resource_group_name, cluster_name, script_execution_id, custom_headers:nil)
|
127
|
+
response = promote_async(resource_group_name, cluster_name, script_execution_id, custom_headers:custom_headers).value!
|
128
|
+
nil
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Promotes the specified ad-hoc script execution to a persisted script.
|
133
|
+
#
|
134
|
+
# @param resource_group_name [String] The name of the resource group.
|
135
|
+
# @param cluster_name [String] The name of the cluster.
|
136
|
+
# @param script_execution_id [String] The script execution Id
|
137
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
138
|
+
# will be added to the HTTP request.
|
139
|
+
#
|
140
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
141
|
+
#
|
142
|
+
def promote_with_http_info(resource_group_name, cluster_name, script_execution_id, custom_headers:nil)
|
143
|
+
promote_async(resource_group_name, cluster_name, script_execution_id, custom_headers:custom_headers).value!
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Promotes the specified ad-hoc script execution to a persisted script.
|
148
|
+
#
|
149
|
+
# @param resource_group_name [String] The name of the resource group.
|
150
|
+
# @param cluster_name [String] The name of the cluster.
|
151
|
+
# @param script_execution_id [String] The script execution Id
|
152
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
153
|
+
# to the HTTP request.
|
154
|
+
#
|
155
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
156
|
+
#
|
157
|
+
def promote_async(resource_group_name, cluster_name, script_execution_id, custom_headers:nil)
|
158
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
159
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
160
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
161
|
+
fail ArgumentError, 'script_execution_id is nil' if script_execution_id.nil?
|
162
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
163
|
+
|
164
|
+
|
165
|
+
request_headers = {}
|
166
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
167
|
+
|
168
|
+
# Set Headers
|
169
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
170
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
171
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote'
|
172
|
+
|
173
|
+
request_url = @base_url || @client.base_url
|
174
|
+
|
175
|
+
options = {
|
176
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
177
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'scriptExecutionId' => script_execution_id},
|
178
|
+
query_params: {'api-version' => @client.api_version},
|
179
|
+
headers: request_headers.merge(custom_headers || {}),
|
180
|
+
base_url: request_url
|
181
|
+
}
|
182
|
+
promise = @client.make_request_async(:post, path_template, options)
|
183
|
+
|
184
|
+
promise = promise.then do |result|
|
185
|
+
http_response = result.response
|
186
|
+
status_code = http_response.status
|
187
|
+
response_content = http_response.body
|
188
|
+
unless status_code == 200
|
189
|
+
error_model = JSON.load(response_content)
|
190
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
191
|
+
end
|
192
|
+
|
193
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
194
|
+
|
195
|
+
result
|
196
|
+
end
|
197
|
+
|
198
|
+
promise.execute
|
199
|
+
end
|
200
|
+
|
201
|
+
#
|
202
|
+
# Lists all scripts' execution history for the specified cluster.
|
203
|
+
#
|
204
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
205
|
+
# to List operation.
|
206
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
207
|
+
# will be added to the HTTP request.
|
208
|
+
#
|
209
|
+
# @return [ScriptActionExecutionHistoryList] operation results.
|
210
|
+
#
|
211
|
+
def list_next(next_page_link, custom_headers:nil)
|
212
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
213
|
+
response.body unless response.nil?
|
214
|
+
end
|
215
|
+
|
216
|
+
#
|
217
|
+
# Lists all scripts' execution history for the specified cluster.
|
218
|
+
#
|
219
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
220
|
+
# to List operation.
|
221
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
222
|
+
# will be added to the HTTP request.
|
223
|
+
#
|
224
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
225
|
+
#
|
226
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
227
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
228
|
+
end
|
229
|
+
|
230
|
+
#
|
231
|
+
# Lists all scripts' execution history for the specified cluster.
|
232
|
+
#
|
233
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
234
|
+
# to List operation.
|
235
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
236
|
+
# to the HTTP request.
|
237
|
+
#
|
238
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
239
|
+
#
|
240
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
241
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
242
|
+
|
243
|
+
|
244
|
+
request_headers = {}
|
245
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
246
|
+
|
247
|
+
# Set Headers
|
248
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
249
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
250
|
+
path_template = '{nextLink}'
|
251
|
+
|
252
|
+
request_url = @base_url || @client.base_url
|
253
|
+
|
254
|
+
options = {
|
255
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
256
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
257
|
+
headers: request_headers.merge(custom_headers || {}),
|
258
|
+
base_url: request_url
|
259
|
+
}
|
260
|
+
promise = @client.make_request_async(:get, path_template, options)
|
261
|
+
|
262
|
+
promise = promise.then do |result|
|
263
|
+
http_response = result.response
|
264
|
+
status_code = http_response.status
|
265
|
+
response_content = http_response.body
|
266
|
+
unless status_code == 200
|
267
|
+
error_model = JSON.load(response_content)
|
268
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
269
|
+
end
|
270
|
+
|
271
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
272
|
+
# Deserialize Response
|
273
|
+
if status_code == 200
|
274
|
+
begin
|
275
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
276
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2015_03_01_preview::Models::ScriptActionExecutionHistoryList.mapper()
|
277
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
278
|
+
rescue Exception => e
|
279
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
result
|
284
|
+
end
|
285
|
+
|
286
|
+
promise.execute
|
287
|
+
end
|
288
|
+
|
289
|
+
#
|
290
|
+
# Lists all scripts' execution history for the specified cluster.
|
291
|
+
#
|
292
|
+
# @param resource_group_name [String] The name of the resource group.
|
293
|
+
# @param cluster_name [String] The name of the cluster.
|
294
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
295
|
+
# will be added to the HTTP request.
|
296
|
+
#
|
297
|
+
# @return [ScriptActionExecutionHistoryList] which provide lazy access to pages
|
298
|
+
# of the response.
|
299
|
+
#
|
300
|
+
def list_as_lazy(resource_group_name, cluster_name, custom_headers:nil)
|
301
|
+
response = list_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
|
302
|
+
unless response.nil?
|
303
|
+
page = response.body
|
304
|
+
page.next_method = Proc.new do |next_page_link|
|
305
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
306
|
+
end
|
307
|
+
page
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
end
|
312
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2018-06-01-preview/generated/azure_mgmt_hdinsight/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Hdinsight::Mgmt::V2018_06_01_preview
|
23
|
+
autoload :Clusters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/clusters.rb'
|
24
|
+
autoload :Applications, '2018-06-01-preview/generated/azure_mgmt_hdinsight/applications.rb'
|
25
|
+
autoload :Locations, '2018-06-01-preview/generated/azure_mgmt_hdinsight/locations.rb'
|
26
|
+
autoload :Configurations, '2018-06-01-preview/generated/azure_mgmt_hdinsight/configurations.rb'
|
27
|
+
autoload :Extensions, '2018-06-01-preview/generated/azure_mgmt_hdinsight/extensions.rb'
|
28
|
+
autoload :ScriptActions, '2018-06-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb'
|
29
|
+
autoload :ScriptExecutionHistory, '2018-06-01-preview/generated/azure_mgmt_hdinsight/script_execution_history.rb'
|
30
|
+
autoload :Operations, '2018-06-01-preview/generated/azure_mgmt_hdinsight/operations.rb'
|
31
|
+
autoload :HDInsightManagementClient, '2018-06-01-preview/generated/azure_mgmt_hdinsight/hdinsight_management_client.rb'
|
32
|
+
|
33
|
+
module Models
|
34
|
+
autoload :ScriptActionExecutionSummary, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_summary.rb'
|
35
|
+
autoload :ClusterDefinition, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_definition.rb'
|
36
|
+
autoload :ClusterListPersistedScriptActionsResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_persisted_script_actions_result.rb'
|
37
|
+
autoload :HardwareProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hardware_profile.rb'
|
38
|
+
autoload :SecurityProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/security_profile.rb'
|
39
|
+
autoload :DataDisksGroups, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/data_disks_groups.rb'
|
40
|
+
autoload :SshProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_profile.rb'
|
41
|
+
autoload :ClusterListRuntimeScriptActionDetailResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_runtime_script_action_detail_result.rb'
|
42
|
+
autoload :OsProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/os_profile.rb'
|
43
|
+
autoload :ClusterListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_list_result.rb'
|
44
|
+
autoload :Role, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/role.rb'
|
45
|
+
autoload :ClusterResizeParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_resize_parameters.rb'
|
46
|
+
autoload :StorageAccount, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_account.rb'
|
47
|
+
autoload :ClusterDiskEncryptionParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_disk_encryption_parameters.rb'
|
48
|
+
autoload :DiskEncryptionProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/disk_encryption_properties.rb'
|
49
|
+
autoload :OperationResource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_resource.rb'
|
50
|
+
autoload :ClusterIdentityUserAssignedIdentitiesValue, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity_user_assigned_identities_value.rb'
|
51
|
+
autoload :Resource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource.rb'
|
52
|
+
autoload :ClusterCreateParametersExtended, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_parameters_extended.rb'
|
53
|
+
autoload :OperationListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_list_result.rb'
|
54
|
+
autoload :QuotaInfo, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/quota_info.rb'
|
55
|
+
autoload :Operation, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation.rb'
|
56
|
+
autoload :ConnectivityEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/connectivity_endpoint.rb'
|
57
|
+
autoload :ErrorResponse, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/error_response.rb'
|
58
|
+
autoload :ScriptActionsList, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_actions_list.rb'
|
59
|
+
autoload :RuntimeScriptAction, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action.rb'
|
60
|
+
autoload :ApplicationGetHttpsEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_https_endpoint.rb'
|
61
|
+
autoload :VirtualNetworkProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/virtual_network_profile.rb'
|
62
|
+
autoload :ApplicationGetEndpoint, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_get_endpoint.rb'
|
63
|
+
autoload :LinuxOperatingSystemProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/linux_operating_system_profile.rb'
|
64
|
+
autoload :ApplicationProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_properties.rb'
|
65
|
+
autoload :ComputeProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/compute_profile.rb'
|
66
|
+
autoload :OperationDisplay, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/operation_display.rb'
|
67
|
+
autoload :ClusterCreateProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_create_properties.rb'
|
68
|
+
autoload :ApplicationListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application_list_result.rb'
|
69
|
+
autoload :ClusterPatchParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_patch_parameters.rb'
|
70
|
+
autoload :LocalizedName, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/localized_name.rb'
|
71
|
+
autoload :ClusterGetProperties, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_get_properties.rb'
|
72
|
+
autoload :Usage, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usage.rb'
|
73
|
+
autoload :SshPublicKey, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ssh_public_key.rb'
|
74
|
+
autoload :UsagesListResult, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/usages_list_result.rb'
|
75
|
+
autoload :StorageProfile, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/storage_profile.rb'
|
76
|
+
autoload :Extension, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/extension.rb'
|
77
|
+
autoload :Errors, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/errors.rb'
|
78
|
+
autoload :ClusterMonitoringResponse, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_response.rb'
|
79
|
+
autoload :ScriptAction, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action.rb'
|
80
|
+
autoload :ClusterMonitoringRequest, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_monitoring_request.rb'
|
81
|
+
autoload :ExecuteScriptActionParameters, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/execute_script_action_parameters.rb'
|
82
|
+
autoload :ScriptActionExecutionHistoryList, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_execution_history_list.rb'
|
83
|
+
autoload :ClusterIdentity, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster_identity.rb'
|
84
|
+
autoload :ScriptActionPersistedGetResponseSpec, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/script_action_persisted_get_response_spec.rb'
|
85
|
+
autoload :Cluster, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/cluster.rb'
|
86
|
+
autoload :RuntimeScriptActionDetail, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/runtime_script_action_detail.rb'
|
87
|
+
autoload :TrackedResource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tracked_resource.rb'
|
88
|
+
autoload :ProxyResource, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/proxy_resource.rb'
|
89
|
+
autoload :Application, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/application.rb'
|
90
|
+
autoload :DirectoryType, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/directory_type.rb'
|
91
|
+
autoload :OSType, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/ostype.rb'
|
92
|
+
autoload :Tier, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/tier.rb'
|
93
|
+
autoload :JsonWebKeyEncryptionAlgorithm, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/json_web_key_encryption_algorithm.rb'
|
94
|
+
autoload :ResourceIdentityType, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/resource_identity_type.rb'
|
95
|
+
autoload :HDInsightClusterProvisioningState, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/hdinsight_cluster_provisioning_state.rb'
|
96
|
+
autoload :AsyncOperationState, '2018-06-01-preview/generated/azure_mgmt_hdinsight/models/async_operation_state.rb'
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,601 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Hdinsight::Mgmt::V2018_06_01_preview
|
7
|
+
#
|
8
|
+
# HDInsight Management Client
|
9
|
+
#
|
10
|
+
class Applications
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Applications class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [HDInsightManagementClient] reference to the HDInsightManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists all of the applications for the HDInsight cluster.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group.
|
28
|
+
# @param cluster_name [String] The name of the cluster.
|
29
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
30
|
+
# will be added to the HTTP request.
|
31
|
+
#
|
32
|
+
# @return [Array<Application>] operation results.
|
33
|
+
#
|
34
|
+
def list_by_cluster(resource_group_name, cluster_name, custom_headers:nil)
|
35
|
+
first_page = list_by_cluster_as_lazy(resource_group_name, cluster_name, custom_headers:custom_headers)
|
36
|
+
first_page.get_all_items
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Lists all of the applications for the HDInsight cluster.
|
41
|
+
#
|
42
|
+
# @param resource_group_name [String] The name of the resource group.
|
43
|
+
# @param cluster_name [String] The name of the cluster.
|
44
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
|
+
# will be added to the HTTP request.
|
46
|
+
#
|
47
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
|
+
#
|
49
|
+
def list_by_cluster_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
|
50
|
+
list_by_cluster_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Lists all of the applications for the HDInsight cluster.
|
55
|
+
#
|
56
|
+
# @param resource_group_name [String] The name of the resource group.
|
57
|
+
# @param cluster_name [String] The name of the cluster.
|
58
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
59
|
+
# to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
62
|
+
#
|
63
|
+
def list_by_cluster_async(resource_group_name, cluster_name, custom_headers:nil)
|
64
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
65
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
66
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
67
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
68
|
+
|
69
|
+
|
70
|
+
request_headers = {}
|
71
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
72
|
+
|
73
|
+
# Set Headers
|
74
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
75
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
76
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications'
|
77
|
+
|
78
|
+
request_url = @base_url || @client.base_url
|
79
|
+
|
80
|
+
options = {
|
81
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
82
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
|
83
|
+
query_params: {'api-version' => @client.api_version},
|
84
|
+
headers: request_headers.merge(custom_headers || {}),
|
85
|
+
base_url: request_url
|
86
|
+
}
|
87
|
+
promise = @client.make_request_async(:get, path_template, options)
|
88
|
+
|
89
|
+
promise = promise.then do |result|
|
90
|
+
http_response = result.response
|
91
|
+
status_code = http_response.status
|
92
|
+
response_content = http_response.body
|
93
|
+
unless status_code == 200
|
94
|
+
error_model = JSON.load(response_content)
|
95
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
96
|
+
end
|
97
|
+
|
98
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
99
|
+
# Deserialize Response
|
100
|
+
if status_code == 200
|
101
|
+
begin
|
102
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
103
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult.mapper()
|
104
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
105
|
+
rescue Exception => e
|
106
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
result
|
111
|
+
end
|
112
|
+
|
113
|
+
promise.execute
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Gets properties of the specified application.
|
118
|
+
#
|
119
|
+
# @param resource_group_name [String] The name of the resource group.
|
120
|
+
# @param cluster_name [String] The name of the cluster.
|
121
|
+
# @param application_name [String] The constant value for the application name.
|
122
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
123
|
+
# will be added to the HTTP request.
|
124
|
+
#
|
125
|
+
# @return [Application] operation results.
|
126
|
+
#
|
127
|
+
def get(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
128
|
+
response = get_async(resource_group_name, cluster_name, application_name, custom_headers:custom_headers).value!
|
129
|
+
response.body unless response.nil?
|
130
|
+
end
|
131
|
+
|
132
|
+
#
|
133
|
+
# Gets properties of the specified application.
|
134
|
+
#
|
135
|
+
# @param resource_group_name [String] The name of the resource group.
|
136
|
+
# @param cluster_name [String] The name of the cluster.
|
137
|
+
# @param application_name [String] The constant value for the application name.
|
138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
139
|
+
# will be added to the HTTP request.
|
140
|
+
#
|
141
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
142
|
+
#
|
143
|
+
def get_with_http_info(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
144
|
+
get_async(resource_group_name, cluster_name, application_name, custom_headers:custom_headers).value!
|
145
|
+
end
|
146
|
+
|
147
|
+
#
|
148
|
+
# Gets properties of the specified application.
|
149
|
+
#
|
150
|
+
# @param resource_group_name [String] The name of the resource group.
|
151
|
+
# @param cluster_name [String] The name of the cluster.
|
152
|
+
# @param application_name [String] The constant value for the application name.
|
153
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
154
|
+
# to the HTTP request.
|
155
|
+
#
|
156
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
157
|
+
#
|
158
|
+
def get_async(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
159
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
160
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
161
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
162
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
163
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
164
|
+
|
165
|
+
|
166
|
+
request_headers = {}
|
167
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
168
|
+
|
169
|
+
# Set Headers
|
170
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
171
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
172
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'
|
173
|
+
|
174
|
+
request_url = @base_url || @client.base_url
|
175
|
+
|
176
|
+
options = {
|
177
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
178
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
|
179
|
+
query_params: {'api-version' => @client.api_version},
|
180
|
+
headers: request_headers.merge(custom_headers || {}),
|
181
|
+
base_url: request_url
|
182
|
+
}
|
183
|
+
promise = @client.make_request_async(:get, path_template, options)
|
184
|
+
|
185
|
+
promise = promise.then do |result|
|
186
|
+
http_response = result.response
|
187
|
+
status_code = http_response.status
|
188
|
+
response_content = http_response.body
|
189
|
+
unless status_code == 200
|
190
|
+
error_model = JSON.load(response_content)
|
191
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
192
|
+
end
|
193
|
+
|
194
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
195
|
+
# Deserialize Response
|
196
|
+
if status_code == 200
|
197
|
+
begin
|
198
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
199
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Application.mapper()
|
200
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
201
|
+
rescue Exception => e
|
202
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
result
|
207
|
+
end
|
208
|
+
|
209
|
+
promise.execute
|
210
|
+
end
|
211
|
+
|
212
|
+
#
|
213
|
+
# Creates applications for the HDInsight cluster.
|
214
|
+
#
|
215
|
+
# @param resource_group_name [String] The name of the resource group.
|
216
|
+
# @param cluster_name [String] The name of the cluster.
|
217
|
+
# @param application_name [String] The constant value for the application name.
|
218
|
+
# @param parameters [Application] The application create request.
|
219
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
220
|
+
# will be added to the HTTP request.
|
221
|
+
#
|
222
|
+
# @return [Application] operation results.
|
223
|
+
#
|
224
|
+
def create(resource_group_name, cluster_name, application_name, parameters, custom_headers:nil)
|
225
|
+
response = create_async(resource_group_name, cluster_name, application_name, parameters, custom_headers:custom_headers).value!
|
226
|
+
response.body unless response.nil?
|
227
|
+
end
|
228
|
+
|
229
|
+
#
|
230
|
+
# @param resource_group_name [String] The name of the resource group.
|
231
|
+
# @param cluster_name [String] The name of the cluster.
|
232
|
+
# @param application_name [String] The constant value for the application name.
|
233
|
+
# @param parameters [Application] The application create request.
|
234
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
235
|
+
# will be added to the HTTP request.
|
236
|
+
#
|
237
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
238
|
+
# response.
|
239
|
+
#
|
240
|
+
def create_async(resource_group_name, cluster_name, application_name, parameters, custom_headers:nil)
|
241
|
+
# Send request
|
242
|
+
promise = begin_create_async(resource_group_name, cluster_name, application_name, parameters, custom_headers:custom_headers)
|
243
|
+
|
244
|
+
promise = promise.then do |response|
|
245
|
+
# Defining deserialization method.
|
246
|
+
deserialize_method = lambda do |parsed_response|
|
247
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Application.mapper()
|
248
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
249
|
+
end
|
250
|
+
|
251
|
+
# Waiting for response.
|
252
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
253
|
+
end
|
254
|
+
|
255
|
+
promise
|
256
|
+
end
|
257
|
+
|
258
|
+
#
|
259
|
+
# Deletes the specified application on the HDInsight cluster.
|
260
|
+
#
|
261
|
+
# @param resource_group_name [String] The name of the resource group.
|
262
|
+
# @param cluster_name [String] The name of the cluster.
|
263
|
+
# @param application_name [String] The constant value for the application name.
|
264
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
265
|
+
# will be added to the HTTP request.
|
266
|
+
#
|
267
|
+
def delete(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
268
|
+
response = delete_async(resource_group_name, cluster_name, application_name, custom_headers:custom_headers).value!
|
269
|
+
nil
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# @param resource_group_name [String] The name of the resource group.
|
274
|
+
# @param cluster_name [String] The name of the cluster.
|
275
|
+
# @param application_name [String] The constant value for the application name.
|
276
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
277
|
+
# will be added to the HTTP request.
|
278
|
+
#
|
279
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
280
|
+
# response.
|
281
|
+
#
|
282
|
+
def delete_async(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
283
|
+
# Send request
|
284
|
+
promise = begin_delete_async(resource_group_name, cluster_name, application_name, custom_headers:custom_headers)
|
285
|
+
|
286
|
+
promise = promise.then do |response|
|
287
|
+
# Defining deserialization method.
|
288
|
+
deserialize_method = lambda do |parsed_response|
|
289
|
+
end
|
290
|
+
|
291
|
+
# Waiting for response.
|
292
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
293
|
+
end
|
294
|
+
|
295
|
+
promise
|
296
|
+
end
|
297
|
+
|
298
|
+
#
|
299
|
+
# Creates applications for the HDInsight cluster.
|
300
|
+
#
|
301
|
+
# @param resource_group_name [String] The name of the resource group.
|
302
|
+
# @param cluster_name [String] The name of the cluster.
|
303
|
+
# @param application_name [String] The constant value for the application name.
|
304
|
+
# @param parameters [Application] The application create request.
|
305
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
306
|
+
# will be added to the HTTP request.
|
307
|
+
#
|
308
|
+
# @return [Application] operation results.
|
309
|
+
#
|
310
|
+
def begin_create(resource_group_name, cluster_name, application_name, parameters, custom_headers:nil)
|
311
|
+
response = begin_create_async(resource_group_name, cluster_name, application_name, parameters, custom_headers:custom_headers).value!
|
312
|
+
response.body unless response.nil?
|
313
|
+
end
|
314
|
+
|
315
|
+
#
|
316
|
+
# Creates applications for the HDInsight cluster.
|
317
|
+
#
|
318
|
+
# @param resource_group_name [String] The name of the resource group.
|
319
|
+
# @param cluster_name [String] The name of the cluster.
|
320
|
+
# @param application_name [String] The constant value for the application name.
|
321
|
+
# @param parameters [Application] The application create request.
|
322
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
323
|
+
# will be added to the HTTP request.
|
324
|
+
#
|
325
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
326
|
+
#
|
327
|
+
def begin_create_with_http_info(resource_group_name, cluster_name, application_name, parameters, custom_headers:nil)
|
328
|
+
begin_create_async(resource_group_name, cluster_name, application_name, parameters, custom_headers:custom_headers).value!
|
329
|
+
end
|
330
|
+
|
331
|
+
#
|
332
|
+
# Creates applications for the HDInsight cluster.
|
333
|
+
#
|
334
|
+
# @param resource_group_name [String] The name of the resource group.
|
335
|
+
# @param cluster_name [String] The name of the cluster.
|
336
|
+
# @param application_name [String] The constant value for the application name.
|
337
|
+
# @param parameters [Application] The application create request.
|
338
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
339
|
+
# to the HTTP request.
|
340
|
+
#
|
341
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
342
|
+
#
|
343
|
+
def begin_create_async(resource_group_name, cluster_name, application_name, parameters, custom_headers:nil)
|
344
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
345
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
346
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
347
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
348
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
349
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
350
|
+
|
351
|
+
|
352
|
+
request_headers = {}
|
353
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
354
|
+
|
355
|
+
# Set Headers
|
356
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
357
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
358
|
+
|
359
|
+
# Serialize Request
|
360
|
+
request_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Application.mapper()
|
361
|
+
request_content = @client.serialize(request_mapper, parameters)
|
362
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
363
|
+
|
364
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'
|
365
|
+
|
366
|
+
request_url = @base_url || @client.base_url
|
367
|
+
|
368
|
+
options = {
|
369
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
370
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
|
371
|
+
query_params: {'api-version' => @client.api_version},
|
372
|
+
body: request_content,
|
373
|
+
headers: request_headers.merge(custom_headers || {}),
|
374
|
+
base_url: request_url
|
375
|
+
}
|
376
|
+
promise = @client.make_request_async(:put, path_template, options)
|
377
|
+
|
378
|
+
promise = promise.then do |result|
|
379
|
+
http_response = result.response
|
380
|
+
status_code = http_response.status
|
381
|
+
response_content = http_response.body
|
382
|
+
unless status_code == 200
|
383
|
+
error_model = JSON.load(response_content)
|
384
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
385
|
+
end
|
386
|
+
|
387
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
388
|
+
# Deserialize Response
|
389
|
+
if status_code == 200
|
390
|
+
begin
|
391
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
392
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::Application.mapper()
|
393
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
394
|
+
rescue Exception => e
|
395
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
result
|
400
|
+
end
|
401
|
+
|
402
|
+
promise.execute
|
403
|
+
end
|
404
|
+
|
405
|
+
#
|
406
|
+
# Deletes the specified application on the HDInsight cluster.
|
407
|
+
#
|
408
|
+
# @param resource_group_name [String] The name of the resource group.
|
409
|
+
# @param cluster_name [String] The name of the cluster.
|
410
|
+
# @param application_name [String] The constant value for the application name.
|
411
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
412
|
+
# will be added to the HTTP request.
|
413
|
+
#
|
414
|
+
#
|
415
|
+
def begin_delete(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
416
|
+
response = begin_delete_async(resource_group_name, cluster_name, application_name, custom_headers:custom_headers).value!
|
417
|
+
nil
|
418
|
+
end
|
419
|
+
|
420
|
+
#
|
421
|
+
# Deletes the specified application on the HDInsight cluster.
|
422
|
+
#
|
423
|
+
# @param resource_group_name [String] The name of the resource group.
|
424
|
+
# @param cluster_name [String] The name of the cluster.
|
425
|
+
# @param application_name [String] The constant value for the application name.
|
426
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
427
|
+
# will be added to the HTTP request.
|
428
|
+
#
|
429
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
430
|
+
#
|
431
|
+
def begin_delete_with_http_info(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
432
|
+
begin_delete_async(resource_group_name, cluster_name, application_name, custom_headers:custom_headers).value!
|
433
|
+
end
|
434
|
+
|
435
|
+
#
|
436
|
+
# Deletes the specified application on the HDInsight cluster.
|
437
|
+
#
|
438
|
+
# @param resource_group_name [String] The name of the resource group.
|
439
|
+
# @param cluster_name [String] The name of the cluster.
|
440
|
+
# @param application_name [String] The constant value for the application name.
|
441
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
442
|
+
# to the HTTP request.
|
443
|
+
#
|
444
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
445
|
+
#
|
446
|
+
def begin_delete_async(resource_group_name, cluster_name, application_name, custom_headers:nil)
|
447
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
448
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
449
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
450
|
+
fail ArgumentError, 'application_name is nil' if application_name.nil?
|
451
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
452
|
+
|
453
|
+
|
454
|
+
request_headers = {}
|
455
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
456
|
+
|
457
|
+
# Set Headers
|
458
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
459
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
460
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'
|
461
|
+
|
462
|
+
request_url = @base_url || @client.base_url
|
463
|
+
|
464
|
+
options = {
|
465
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
466
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
|
467
|
+
query_params: {'api-version' => @client.api_version},
|
468
|
+
headers: request_headers.merge(custom_headers || {}),
|
469
|
+
base_url: request_url
|
470
|
+
}
|
471
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
472
|
+
|
473
|
+
promise = promise.then do |result|
|
474
|
+
http_response = result.response
|
475
|
+
status_code = http_response.status
|
476
|
+
response_content = http_response.body
|
477
|
+
unless status_code == 200 || status_code == 202
|
478
|
+
error_model = JSON.load(response_content)
|
479
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
480
|
+
end
|
481
|
+
|
482
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
483
|
+
|
484
|
+
result
|
485
|
+
end
|
486
|
+
|
487
|
+
promise.execute
|
488
|
+
end
|
489
|
+
|
490
|
+
#
|
491
|
+
# Lists all of the applications for the HDInsight cluster.
|
492
|
+
#
|
493
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
494
|
+
# to List operation.
|
495
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
496
|
+
# will be added to the HTTP request.
|
497
|
+
#
|
498
|
+
# @return [ApplicationListResult] operation results.
|
499
|
+
#
|
500
|
+
def list_by_cluster_next(next_page_link, custom_headers:nil)
|
501
|
+
response = list_by_cluster_next_async(next_page_link, custom_headers:custom_headers).value!
|
502
|
+
response.body unless response.nil?
|
503
|
+
end
|
504
|
+
|
505
|
+
#
|
506
|
+
# Lists all of the applications for the HDInsight cluster.
|
507
|
+
#
|
508
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
509
|
+
# to List operation.
|
510
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
511
|
+
# will be added to the HTTP request.
|
512
|
+
#
|
513
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
514
|
+
#
|
515
|
+
def list_by_cluster_next_with_http_info(next_page_link, custom_headers:nil)
|
516
|
+
list_by_cluster_next_async(next_page_link, custom_headers:custom_headers).value!
|
517
|
+
end
|
518
|
+
|
519
|
+
#
|
520
|
+
# Lists all of the applications for the HDInsight cluster.
|
521
|
+
#
|
522
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
523
|
+
# to List operation.
|
524
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
525
|
+
# to the HTTP request.
|
526
|
+
#
|
527
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
528
|
+
#
|
529
|
+
def list_by_cluster_next_async(next_page_link, custom_headers:nil)
|
530
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
531
|
+
|
532
|
+
|
533
|
+
request_headers = {}
|
534
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
535
|
+
|
536
|
+
# Set Headers
|
537
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
538
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
539
|
+
path_template = '{nextLink}'
|
540
|
+
|
541
|
+
request_url = @base_url || @client.base_url
|
542
|
+
|
543
|
+
options = {
|
544
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
545
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
546
|
+
headers: request_headers.merge(custom_headers || {}),
|
547
|
+
base_url: request_url
|
548
|
+
}
|
549
|
+
promise = @client.make_request_async(:get, path_template, options)
|
550
|
+
|
551
|
+
promise = promise.then do |result|
|
552
|
+
http_response = result.response
|
553
|
+
status_code = http_response.status
|
554
|
+
response_content = http_response.body
|
555
|
+
unless status_code == 200
|
556
|
+
error_model = JSON.load(response_content)
|
557
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
558
|
+
end
|
559
|
+
|
560
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
561
|
+
# Deserialize Response
|
562
|
+
if status_code == 200
|
563
|
+
begin
|
564
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
565
|
+
result_mapper = Azure::Hdinsight::Mgmt::V2018_06_01_preview::Models::ApplicationListResult.mapper()
|
566
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
567
|
+
rescue Exception => e
|
568
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
569
|
+
end
|
570
|
+
end
|
571
|
+
|
572
|
+
result
|
573
|
+
end
|
574
|
+
|
575
|
+
promise.execute
|
576
|
+
end
|
577
|
+
|
578
|
+
#
|
579
|
+
# Lists all of the applications for the HDInsight cluster.
|
580
|
+
#
|
581
|
+
# @param resource_group_name [String] The name of the resource group.
|
582
|
+
# @param cluster_name [String] The name of the cluster.
|
583
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
584
|
+
# will be added to the HTTP request.
|
585
|
+
#
|
586
|
+
# @return [ApplicationListResult] which provide lazy access to pages of the
|
587
|
+
# response.
|
588
|
+
#
|
589
|
+
def list_by_cluster_as_lazy(resource_group_name, cluster_name, custom_headers:nil)
|
590
|
+
response = list_by_cluster_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
|
591
|
+
unless response.nil?
|
592
|
+
page = response.body
|
593
|
+
page.next_method = Proc.new do |next_page_link|
|
594
|
+
list_by_cluster_next_async(next_page_link, custom_headers:custom_headers)
|
595
|
+
end
|
596
|
+
page
|
597
|
+
end
|
598
|
+
end
|
599
|
+
|
600
|
+
end
|
601
|
+
end
|