azure_mgmt_automation 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/azure_mgmt_automation.rb +6 -0
- data/lib/generated/azure_mgmt_automation.rb +183 -0
- data/lib/generated/azure_mgmt_automation/activity_operations.rb +332 -0
- data/lib/generated/azure_mgmt_automation/agent_registration_information.rb +223 -0
- data/lib/generated/azure_mgmt_automation/automation_account_operations.rb +822 -0
- data/lib/generated/azure_mgmt_automation/automation_client.rb +245 -0
- data/lib/generated/azure_mgmt_automation/certificate_operations.rb +642 -0
- data/lib/generated/azure_mgmt_automation/connection_operations.rb +653 -0
- data/lib/generated/azure_mgmt_automation/connection_type_operations.rb +528 -0
- data/lib/generated/azure_mgmt_automation/credential_operations.rb +642 -0
- data/lib/generated/azure_mgmt_automation/dsc_compilation_job_operations.rb +534 -0
- data/lib/generated/azure_mgmt_automation/dsc_configuration_operations.rb +629 -0
- data/lib/generated/azure_mgmt_automation/dsc_node_configuration_operations.rb +532 -0
- data/lib/generated/azure_mgmt_automation/dsc_node_operations.rb +530 -0
- data/lib/generated/azure_mgmt_automation/fields.rb +124 -0
- data/lib/generated/azure_mgmt_automation/hybrid_runbook_worker_group_operations.rb +524 -0
- data/lib/generated/azure_mgmt_automation/job_operations.rb +888 -0
- data/lib/generated/azure_mgmt_automation/job_schedule_operations.rb +515 -0
- data/lib/generated/azure_mgmt_automation/job_stream_operations.rb +333 -0
- data/lib/generated/azure_mgmt_automation/models/activity.rb +133 -0
- data/lib/generated/azure_mgmt_automation/models/activity_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/activity_output_type.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/activity_parameter.rb +129 -0
- data/lib/generated/azure_mgmt_automation/models/activity_parameter_set.rb +63 -0
- data/lib/generated/azure_mgmt_automation/models/advanced_schedule.rb +89 -0
- data/lib/generated/azure_mgmt_automation/models/advanced_schedule_monthly_occurrence.rb +58 -0
- data/lib/generated/azure_mgmt_automation/models/agent_registration.rb +76 -0
- data/lib/generated/azure_mgmt_automation/models/agent_registration_key_name.rb +16 -0
- data/lib/generated/azure_mgmt_automation/models/agent_registration_keys.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/agent_registration_regenerate_key_parameter.rb +84 -0
- data/lib/generated/azure_mgmt_automation/models/automation_account.rb +154 -0
- data/lib/generated/azure_mgmt_automation/models/automation_account_create_or_update_parameters.rb +85 -0
- data/lib/generated/azure_mgmt_automation/models/automation_account_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/automation_account_state.rb +17 -0
- data/lib/generated/azure_mgmt_automation/models/automation_account_update_parameters.rb +83 -0
- data/lib/generated/azure_mgmt_automation/models/certificate.rb +121 -0
- data/lib/generated/azure_mgmt_automation/models/certificate_create_or_update_parameters.rb +87 -0
- data/lib/generated/azure_mgmt_automation/models/certificate_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/certificate_update_parameters.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/connection.rb +119 -0
- data/lib/generated/azure_mgmt_automation/models/connection_create_or_update_parameters.rb +84 -0
- data/lib/generated/azure_mgmt_automation/models/connection_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/connection_type.rb +118 -0
- data/lib/generated/azure_mgmt_automation/models/connection_type_association_property.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/connection_type_create_or_update_parameters.rb +75 -0
- data/lib/generated/azure_mgmt_automation/models/connection_type_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/connection_update_parameters.rb +72 -0
- data/lib/generated/azure_mgmt_automation/models/content_hash.rb +55 -0
- data/lib/generated/azure_mgmt_automation/models/content_link.rb +65 -0
- data/lib/generated/azure_mgmt_automation/models/content_source.rb +77 -0
- data/lib/generated/azure_mgmt_automation/models/content_source_type.rb +16 -0
- data/lib/generated/azure_mgmt_automation/models/credential.rb +98 -0
- data/lib/generated/azure_mgmt_automation/models/credential_create_or_update_parameters.rb +74 -0
- data/lib/generated/azure_mgmt_automation/models/credential_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/credential_update_parameters.rb +74 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job.rb +186 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job_create_parameters.rb +102 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration.rb +193 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration_association_property.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration_create_or_update_parameters.rb +132 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration_parameter.rb +75 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration_provisioning_state.rb +15 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_configuration_state.rb +17 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_meta_configuration.rb +111 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node.rb +161 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration.rb +86 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_association_property.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_create_or_update_parameters.rb +69 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_report.rb +265 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_report_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_node_update_parameters.rb +56 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_report_error.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_report_resource.rb +143 -0
- data/lib/generated/azure_mgmt_automation/models/dsc_report_resource_navigation.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/error_response.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/field_definition.rb +67 -0
- data/lib/generated/azure_mgmt_automation/models/http_status_code.rb +61 -0
- data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker.rb +65 -0
- data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group.rb +85 -0
- data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group_update_parameters.rb +46 -0
- data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_groups_list_result.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/job.rb +188 -0
- data/lib/generated/azure_mgmt_automation/models/job_create_parameters.rb +112 -0
- data/lib/generated/azure_mgmt_automation/models/job_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/job_schedule.rb +105 -0
- data/lib/generated/azure_mgmt_automation/models/job_schedule_create_parameters.rb +84 -0
- data/lib/generated/azure_mgmt_automation/models/job_schedule_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/job_status.rb +27 -0
- data/lib/generated/azure_mgmt_automation/models/job_stream.rb +113 -0
- data/lib/generated/azure_mgmt_automation/models/job_stream_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/job_stream_type.rb +21 -0
- data/lib/generated/azure_mgmt_automation/models/module_create_or_update_parameters.rb +83 -0
- data/lib/generated/azure_mgmt_automation/models/module_error_info.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/module_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/module_model.rb +198 -0
- data/lib/generated/azure_mgmt_automation/models/module_provisioning_state.rb +30 -0
- data/lib/generated/azure_mgmt_automation/models/module_update_parameters.rb +83 -0
- data/lib/generated/azure_mgmt_automation/models/operation.rb +55 -0
- data/lib/generated/azure_mgmt_automation/models/operation_display.rb +65 -0
- data/lib/generated/azure_mgmt_automation/models/operation_list_result.rb +53 -0
- data/lib/generated/azure_mgmt_automation/models/resource.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/run_as_credential_association_property.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/runbook.rb +263 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_association_property.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_draft_parameters.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_draft_properties.rb +99 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_parameters.rb +147 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_draft.rb +112 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_draft_undo_edit_result.rb +68 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_parameter.rb +75 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_provisioning_state.rb +15 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_state.rb +17 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_type_enum.rb +20 -0
- data/lib/generated/azure_mgmt_automation/models/runbook_update_parameters.rb +113 -0
- data/lib/generated/azure_mgmt_automation/models/schedule.rb +199 -0
- data/lib/generated/azure_mgmt_automation/models/schedule_association_property.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/schedule_create_or_update_parameters.rb +116 -0
- data/lib/generated/azure_mgmt_automation/models/schedule_day.rb +21 -0
- data/lib/generated/azure_mgmt_automation/models/schedule_frequency.rb +19 -0
- data/lib/generated/azure_mgmt_automation/models/schedule_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/schedule_update_parameters.rb +65 -0
- data/lib/generated/azure_mgmt_automation/models/sku.rb +65 -0
- data/lib/generated/azure_mgmt_automation/models/sku_name_enum.rb +16 -0
- data/lib/generated/azure_mgmt_automation/models/statistics.rb +89 -0
- data/lib/generated/azure_mgmt_automation/models/statistics_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_automation/models/sub_resource.rb +44 -0
- data/lib/generated/azure_mgmt_automation/models/test_job.rb +144 -0
- data/lib/generated/azure_mgmt_automation/models/test_job_create_parameters.rb +73 -0
- data/lib/generated/azure_mgmt_automation/models/type_field.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/type_field_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_automation/models/usage.rb +95 -0
- data/lib/generated/azure_mgmt_automation/models/usage_counter_name.rb +54 -0
- data/lib/generated/azure_mgmt_automation/models/usage_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_automation/models/variable.rb +104 -0
- data/lib/generated/azure_mgmt_automation/models/variable_create_or_update_parameters.rb +74 -0
- data/lib/generated/azure_mgmt_automation/models/variable_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/variable_update_parameters.rb +64 -0
- data/lib/generated/azure_mgmt_automation/models/webhook.rb +168 -0
- data/lib/generated/azure_mgmt_automation/models/webhook_create_or_update_parameters.rb +115 -0
- data/lib/generated/azure_mgmt_automation/models/webhook_list_result.rb +94 -0
- data/lib/generated/azure_mgmt_automation/models/webhook_update_parameters.rb +94 -0
- data/lib/generated/azure_mgmt_automation/module_definition.rb +8 -0
- data/lib/generated/azure_mgmt_automation/module_model_operations.rb +633 -0
- data/lib/generated/azure_mgmt_automation/node_reports.rb +438 -0
- data/lib/generated/azure_mgmt_automation/object_data_types.rb +219 -0
- data/lib/generated/azure_mgmt_automation/operations.rb +106 -0
- data/lib/generated/azure_mgmt_automation/runbook_draft_operations.rb +605 -0
- data/lib/generated/azure_mgmt_automation/runbook_operations.rb +719 -0
- data/lib/generated/azure_mgmt_automation/schedule_operations.rb +626 -0
- data/lib/generated/azure_mgmt_automation/statistics_operations.rb +119 -0
- data/lib/generated/azure_mgmt_automation/test_job_streams.rb +333 -0
- data/lib/generated/azure_mgmt_automation/test_jobs.rb +486 -0
- data/lib/generated/azure_mgmt_automation/usages.rb +116 -0
- data/lib/generated/azure_mgmt_automation/variable_operations.rb +636 -0
- data/lib/generated/azure_mgmt_automation/version.rb +8 -0
- data/lib/generated/azure_mgmt_automation/webhook_operations.rb +737 -0
- metadata +275 -0
|
@@ -0,0 +1,888 @@
|
|
|
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::ARM::Automation
|
|
7
|
+
#
|
|
8
|
+
# Automation Client
|
|
9
|
+
#
|
|
10
|
+
class JobOperations
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the JobOperations class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [AutomationClient] reference to the AutomationClient
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Retrieve the job output identified by job id.
|
|
26
|
+
#
|
|
27
|
+
# @param resource_group_name [String] The resource group name.
|
|
28
|
+
# @param automation_account_name [String] The automation account name.
|
|
29
|
+
# @param job_id [String] The job id.
|
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
31
|
+
# will be added to the HTTP request.
|
|
32
|
+
#
|
|
33
|
+
# @return [NOT_IMPLEMENTED] operation results.
|
|
34
|
+
#
|
|
35
|
+
def get_output(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
36
|
+
response = get_output_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
37
|
+
response.body unless response.nil?
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
#
|
|
41
|
+
# Retrieve the job output identified by job id.
|
|
42
|
+
#
|
|
43
|
+
# @param resource_group_name [String] The resource group name.
|
|
44
|
+
# @param automation_account_name [String] The automation account name.
|
|
45
|
+
# @param job_id [String] The job id.
|
|
46
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
47
|
+
# will be added to the HTTP request.
|
|
48
|
+
#
|
|
49
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
50
|
+
#
|
|
51
|
+
def get_output_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
52
|
+
get_output_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
#
|
|
56
|
+
# Retrieve the job output identified by job id.
|
|
57
|
+
#
|
|
58
|
+
# @param resource_group_name [String] The resource group name.
|
|
59
|
+
# @param automation_account_name [String] The automation account name.
|
|
60
|
+
# @param job_id [String] The job id.
|
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
62
|
+
# to the HTTP request.
|
|
63
|
+
#
|
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
65
|
+
#
|
|
66
|
+
def get_output_async(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
67
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
68
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
69
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
70
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
71
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
request_headers = {}
|
|
75
|
+
|
|
76
|
+
# Set Headers
|
|
77
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
78
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
79
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/output'
|
|
80
|
+
|
|
81
|
+
request_url = @base_url || @client.base_url
|
|
82
|
+
|
|
83
|
+
options = {
|
|
84
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
85
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
86
|
+
query_params: {'api-version' => @client.api_version},
|
|
87
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
88
|
+
base_url: request_url
|
|
89
|
+
}
|
|
90
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
91
|
+
|
|
92
|
+
promise = promise.then do |result|
|
|
93
|
+
http_response = result.response
|
|
94
|
+
status_code = http_response.status
|
|
95
|
+
response_content = http_response.body
|
|
96
|
+
unless status_code == 200
|
|
97
|
+
error_model = JSON.load(response_content)
|
|
98
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
102
|
+
# Deserialize Response
|
|
103
|
+
if status_code == 200
|
|
104
|
+
begin
|
|
105
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
106
|
+
result_mapper = {
|
|
107
|
+
required: false,
|
|
108
|
+
serialized_name: 'parsed_response',
|
|
109
|
+
type: {
|
|
110
|
+
name: 'Stream'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
114
|
+
rescue Exception => e
|
|
115
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
result
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
promise.execute
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
#
|
|
126
|
+
# Retrieve the runbook content of the job identified by job id.
|
|
127
|
+
#
|
|
128
|
+
# @param resource_group_name [String] The resource group name.
|
|
129
|
+
# @param automation_account_name [String] The automation account name.
|
|
130
|
+
# @param job_id [String] The job id.
|
|
131
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
132
|
+
# will be added to the HTTP request.
|
|
133
|
+
#
|
|
134
|
+
# @return [NOT_IMPLEMENTED] operation results.
|
|
135
|
+
#
|
|
136
|
+
def get_runbook_content(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
137
|
+
response = get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
138
|
+
response.body unless response.nil?
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
#
|
|
142
|
+
# Retrieve the runbook content of the job identified by job id.
|
|
143
|
+
#
|
|
144
|
+
# @param resource_group_name [String] The resource group name.
|
|
145
|
+
# @param automation_account_name [String] The automation account name.
|
|
146
|
+
# @param job_id [String] The job id.
|
|
147
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
148
|
+
# will be added to the HTTP request.
|
|
149
|
+
#
|
|
150
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
151
|
+
#
|
|
152
|
+
def get_runbook_content_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
153
|
+
get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
#
|
|
157
|
+
# Retrieve the runbook content of the job identified by job id.
|
|
158
|
+
#
|
|
159
|
+
# @param resource_group_name [String] The resource group name.
|
|
160
|
+
# @param automation_account_name [String] The automation account name.
|
|
161
|
+
# @param job_id [String] The job id.
|
|
162
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
163
|
+
# to the HTTP request.
|
|
164
|
+
#
|
|
165
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
166
|
+
#
|
|
167
|
+
def get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
168
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
169
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
170
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
171
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
172
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
request_headers = {}
|
|
176
|
+
|
|
177
|
+
# Set Headers
|
|
178
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
179
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
180
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/runbookContent'
|
|
181
|
+
|
|
182
|
+
request_url = @base_url || @client.base_url
|
|
183
|
+
|
|
184
|
+
options = {
|
|
185
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
186
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
187
|
+
query_params: {'api-version' => @client.api_version},
|
|
188
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
189
|
+
base_url: request_url
|
|
190
|
+
}
|
|
191
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
192
|
+
|
|
193
|
+
promise = promise.then do |result|
|
|
194
|
+
http_response = result.response
|
|
195
|
+
status_code = http_response.status
|
|
196
|
+
response_content = http_response.body
|
|
197
|
+
unless status_code == 200
|
|
198
|
+
error_model = JSON.load(response_content)
|
|
199
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
203
|
+
# Deserialize Response
|
|
204
|
+
if status_code == 200
|
|
205
|
+
begin
|
|
206
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
207
|
+
result_mapper = {
|
|
208
|
+
required: false,
|
|
209
|
+
serialized_name: 'parsed_response',
|
|
210
|
+
type: {
|
|
211
|
+
name: 'Stream'
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
215
|
+
rescue Exception => e
|
|
216
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
result
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
promise.execute
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
#
|
|
227
|
+
# Suspend the job identified by jobId.
|
|
228
|
+
#
|
|
229
|
+
# @param resource_group_name [String] The resource group name.
|
|
230
|
+
# @param automation_account_name [String] The automation account name.
|
|
231
|
+
# @param job_id The job id.
|
|
232
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
233
|
+
# will be added to the HTTP request.
|
|
234
|
+
#
|
|
235
|
+
#
|
|
236
|
+
def suspend(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
237
|
+
response = suspend_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
238
|
+
nil
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
#
|
|
242
|
+
# Suspend the job identified by jobId.
|
|
243
|
+
#
|
|
244
|
+
# @param resource_group_name [String] The resource group name.
|
|
245
|
+
# @param automation_account_name [String] The automation account name.
|
|
246
|
+
# @param job_id The job id.
|
|
247
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
248
|
+
# will be added to the HTTP request.
|
|
249
|
+
#
|
|
250
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
251
|
+
#
|
|
252
|
+
def suspend_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
253
|
+
suspend_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
#
|
|
257
|
+
# Suspend the job identified by jobId.
|
|
258
|
+
#
|
|
259
|
+
# @param resource_group_name [String] The resource group name.
|
|
260
|
+
# @param automation_account_name [String] The automation account name.
|
|
261
|
+
# @param job_id The job id.
|
|
262
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
263
|
+
# to the HTTP request.
|
|
264
|
+
#
|
|
265
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
266
|
+
#
|
|
267
|
+
def suspend_async(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
268
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
269
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
270
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
271
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
272
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
request_headers = {}
|
|
276
|
+
|
|
277
|
+
# Set Headers
|
|
278
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
279
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
280
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/suspend'
|
|
281
|
+
|
|
282
|
+
request_url = @base_url || @client.base_url
|
|
283
|
+
|
|
284
|
+
options = {
|
|
285
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
286
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
287
|
+
query_params: {'api-version' => @client.api_version},
|
|
288
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
289
|
+
base_url: request_url
|
|
290
|
+
}
|
|
291
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
292
|
+
|
|
293
|
+
promise = promise.then do |result|
|
|
294
|
+
http_response = result.response
|
|
295
|
+
status_code = http_response.status
|
|
296
|
+
response_content = http_response.body
|
|
297
|
+
unless status_code == 200
|
|
298
|
+
error_model = JSON.load(response_content)
|
|
299
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
303
|
+
|
|
304
|
+
result
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
promise.execute
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
#
|
|
311
|
+
# Stop the job identified by jobId.
|
|
312
|
+
#
|
|
313
|
+
# @param resource_group_name [String] The resource group name.
|
|
314
|
+
# @param automation_account_name [String] The automation account name.
|
|
315
|
+
# @param job_id The job id.
|
|
316
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
317
|
+
# will be added to the HTTP request.
|
|
318
|
+
#
|
|
319
|
+
#
|
|
320
|
+
def stop(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
321
|
+
response = stop_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
322
|
+
nil
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
#
|
|
326
|
+
# Stop the job identified by jobId.
|
|
327
|
+
#
|
|
328
|
+
# @param resource_group_name [String] The resource group name.
|
|
329
|
+
# @param automation_account_name [String] The automation account name.
|
|
330
|
+
# @param job_id The job id.
|
|
331
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
332
|
+
# will be added to the HTTP request.
|
|
333
|
+
#
|
|
334
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
335
|
+
#
|
|
336
|
+
def stop_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
337
|
+
stop_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
#
|
|
341
|
+
# Stop the job identified by jobId.
|
|
342
|
+
#
|
|
343
|
+
# @param resource_group_name [String] The resource group name.
|
|
344
|
+
# @param automation_account_name [String] The automation account name.
|
|
345
|
+
# @param job_id The job id.
|
|
346
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
347
|
+
# to the HTTP request.
|
|
348
|
+
#
|
|
349
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
350
|
+
#
|
|
351
|
+
def stop_async(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
352
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
353
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
354
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
355
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
356
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
request_headers = {}
|
|
360
|
+
|
|
361
|
+
# Set Headers
|
|
362
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
363
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
364
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/stop'
|
|
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: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
371
|
+
query_params: {'api-version' => @client.api_version},
|
|
372
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
373
|
+
base_url: request_url
|
|
374
|
+
}
|
|
375
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
376
|
+
|
|
377
|
+
promise = promise.then do |result|
|
|
378
|
+
http_response = result.response
|
|
379
|
+
status_code = http_response.status
|
|
380
|
+
response_content = http_response.body
|
|
381
|
+
unless status_code == 200
|
|
382
|
+
error_model = JSON.load(response_content)
|
|
383
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
387
|
+
|
|
388
|
+
result
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
promise.execute
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
#
|
|
395
|
+
# Retrieve the job identified by job id.
|
|
396
|
+
#
|
|
397
|
+
# @param resource_group_name [String] The resource group name.
|
|
398
|
+
# @param automation_account_name [String] The automation account name.
|
|
399
|
+
# @param job_id The job id.
|
|
400
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
401
|
+
# will be added to the HTTP request.
|
|
402
|
+
#
|
|
403
|
+
# @return [Job] operation results.
|
|
404
|
+
#
|
|
405
|
+
def get(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
406
|
+
response = get_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
407
|
+
response.body unless response.nil?
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
#
|
|
411
|
+
# Retrieve the job identified by job id.
|
|
412
|
+
#
|
|
413
|
+
# @param resource_group_name [String] The resource group name.
|
|
414
|
+
# @param automation_account_name [String] The automation account name.
|
|
415
|
+
# @param job_id The job id.
|
|
416
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
417
|
+
# will be added to the HTTP request.
|
|
418
|
+
#
|
|
419
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
420
|
+
#
|
|
421
|
+
def get_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
422
|
+
get_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
#
|
|
426
|
+
# Retrieve the job identified by job id.
|
|
427
|
+
#
|
|
428
|
+
# @param resource_group_name [String] The resource group name.
|
|
429
|
+
# @param automation_account_name [String] The automation account name.
|
|
430
|
+
# @param job_id The job id.
|
|
431
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
432
|
+
# to the HTTP request.
|
|
433
|
+
#
|
|
434
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
435
|
+
#
|
|
436
|
+
def get_async(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
437
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
438
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
439
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
440
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
441
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
request_headers = {}
|
|
445
|
+
|
|
446
|
+
# Set Headers
|
|
447
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
448
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
449
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}'
|
|
450
|
+
|
|
451
|
+
request_url = @base_url || @client.base_url
|
|
452
|
+
|
|
453
|
+
options = {
|
|
454
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
455
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
456
|
+
query_params: {'api-version' => @client.api_version},
|
|
457
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
458
|
+
base_url: request_url
|
|
459
|
+
}
|
|
460
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
461
|
+
|
|
462
|
+
promise = promise.then do |result|
|
|
463
|
+
http_response = result.response
|
|
464
|
+
status_code = http_response.status
|
|
465
|
+
response_content = http_response.body
|
|
466
|
+
unless status_code == 200
|
|
467
|
+
error_model = JSON.load(response_content)
|
|
468
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
472
|
+
# Deserialize Response
|
|
473
|
+
if status_code == 200
|
|
474
|
+
begin
|
|
475
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
476
|
+
result_mapper = Azure::ARM::Automation::Models::Job.mapper()
|
|
477
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
478
|
+
rescue Exception => e
|
|
479
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
480
|
+
end
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
result
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
promise.execute
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
#
|
|
490
|
+
# Create a job of the runbook.
|
|
491
|
+
#
|
|
492
|
+
# @param resource_group_name [String] The resource group name.
|
|
493
|
+
# @param automation_account_name [String] The automation account name.
|
|
494
|
+
# @param job_id The job id.
|
|
495
|
+
# @param parameters [JobCreateParameters] The parameters supplied to the create
|
|
496
|
+
# job operation.
|
|
497
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
498
|
+
# will be added to the HTTP request.
|
|
499
|
+
#
|
|
500
|
+
# @return [Job] operation results.
|
|
501
|
+
#
|
|
502
|
+
def create(resource_group_name, automation_account_name, job_id, parameters, custom_headers = nil)
|
|
503
|
+
response = create_async(resource_group_name, automation_account_name, job_id, parameters, custom_headers).value!
|
|
504
|
+
response.body unless response.nil?
|
|
505
|
+
end
|
|
506
|
+
|
|
507
|
+
#
|
|
508
|
+
# Create a job of the runbook.
|
|
509
|
+
#
|
|
510
|
+
# @param resource_group_name [String] The resource group name.
|
|
511
|
+
# @param automation_account_name [String] The automation account name.
|
|
512
|
+
# @param job_id The job id.
|
|
513
|
+
# @param parameters [JobCreateParameters] The parameters supplied to the create
|
|
514
|
+
# job operation.
|
|
515
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
516
|
+
# will be added to the HTTP request.
|
|
517
|
+
#
|
|
518
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
519
|
+
#
|
|
520
|
+
def create_with_http_info(resource_group_name, automation_account_name, job_id, parameters, custom_headers = nil)
|
|
521
|
+
create_async(resource_group_name, automation_account_name, job_id, parameters, custom_headers).value!
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
#
|
|
525
|
+
# Create a job of the runbook.
|
|
526
|
+
#
|
|
527
|
+
# @param resource_group_name [String] The resource group name.
|
|
528
|
+
# @param automation_account_name [String] The automation account name.
|
|
529
|
+
# @param job_id The job id.
|
|
530
|
+
# @param parameters [JobCreateParameters] The parameters supplied to the create
|
|
531
|
+
# job operation.
|
|
532
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
533
|
+
# to the HTTP request.
|
|
534
|
+
#
|
|
535
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
536
|
+
#
|
|
537
|
+
def create_async(resource_group_name, automation_account_name, job_id, parameters, custom_headers = nil)
|
|
538
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
539
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
540
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
541
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
542
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
543
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
request_headers = {}
|
|
547
|
+
|
|
548
|
+
# Set Headers
|
|
549
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
550
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
551
|
+
|
|
552
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
553
|
+
|
|
554
|
+
# Serialize Request
|
|
555
|
+
request_mapper = Azure::ARM::Automation::Models::JobCreateParameters.mapper()
|
|
556
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
557
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
558
|
+
|
|
559
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}'
|
|
560
|
+
|
|
561
|
+
request_url = @base_url || @client.base_url
|
|
562
|
+
|
|
563
|
+
options = {
|
|
564
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
565
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
566
|
+
query_params: {'api-version' => @client.api_version},
|
|
567
|
+
body: request_content,
|
|
568
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
569
|
+
base_url: request_url
|
|
570
|
+
}
|
|
571
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
572
|
+
|
|
573
|
+
promise = promise.then do |result|
|
|
574
|
+
http_response = result.response
|
|
575
|
+
status_code = http_response.status
|
|
576
|
+
response_content = http_response.body
|
|
577
|
+
unless status_code == 201
|
|
578
|
+
error_model = JSON.load(response_content)
|
|
579
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
583
|
+
# Deserialize Response
|
|
584
|
+
if status_code == 201
|
|
585
|
+
begin
|
|
586
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
587
|
+
result_mapper = Azure::ARM::Automation::Models::Job.mapper()
|
|
588
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
589
|
+
rescue Exception => e
|
|
590
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
591
|
+
end
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
result
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
promise.execute
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
#
|
|
601
|
+
# Retrieve a list of jobs.
|
|
602
|
+
#
|
|
603
|
+
# @param resource_group_name [String] The resource group name.
|
|
604
|
+
# @param automation_account_name [String] The automation account name.
|
|
605
|
+
# @param filter [String] The filter to apply on the operation.
|
|
606
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
607
|
+
# will be added to the HTTP request.
|
|
608
|
+
#
|
|
609
|
+
# @return [Array<Job>] operation results.
|
|
610
|
+
#
|
|
611
|
+
def list_by_automation_account(resource_group_name, automation_account_name, filter = nil, custom_headers = nil)
|
|
612
|
+
first_page = list_by_automation_account_as_lazy(resource_group_name, automation_account_name, filter, custom_headers)
|
|
613
|
+
first_page.get_all_items
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
#
|
|
617
|
+
# Retrieve a list of jobs.
|
|
618
|
+
#
|
|
619
|
+
# @param resource_group_name [String] The resource group name.
|
|
620
|
+
# @param automation_account_name [String] The automation account name.
|
|
621
|
+
# @param filter [String] The filter to apply on the operation.
|
|
622
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
623
|
+
# will be added to the HTTP request.
|
|
624
|
+
#
|
|
625
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
626
|
+
#
|
|
627
|
+
def list_by_automation_account_with_http_info(resource_group_name, automation_account_name, filter = nil, custom_headers = nil)
|
|
628
|
+
list_by_automation_account_async(resource_group_name, automation_account_name, filter, custom_headers).value!
|
|
629
|
+
end
|
|
630
|
+
|
|
631
|
+
#
|
|
632
|
+
# Retrieve a list of jobs.
|
|
633
|
+
#
|
|
634
|
+
# @param resource_group_name [String] The resource group name.
|
|
635
|
+
# @param automation_account_name [String] The automation account name.
|
|
636
|
+
# @param filter [String] The filter to apply on the operation.
|
|
637
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
638
|
+
# to the HTTP request.
|
|
639
|
+
#
|
|
640
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
641
|
+
#
|
|
642
|
+
def list_by_automation_account_async(resource_group_name, automation_account_name, filter = nil, custom_headers = nil)
|
|
643
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
644
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
645
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
646
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
request_headers = {}
|
|
650
|
+
|
|
651
|
+
# Set Headers
|
|
652
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
653
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
654
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs'
|
|
655
|
+
|
|
656
|
+
request_url = @base_url || @client.base_url
|
|
657
|
+
|
|
658
|
+
options = {
|
|
659
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
660
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'subscriptionId' => @client.subscription_id},
|
|
661
|
+
query_params: {'$filter' => filter,'api-version' => @client.api_version},
|
|
662
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
663
|
+
base_url: request_url
|
|
664
|
+
}
|
|
665
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
666
|
+
|
|
667
|
+
promise = promise.then do |result|
|
|
668
|
+
http_response = result.response
|
|
669
|
+
status_code = http_response.status
|
|
670
|
+
response_content = http_response.body
|
|
671
|
+
unless status_code == 200
|
|
672
|
+
error_model = JSON.load(response_content)
|
|
673
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
674
|
+
end
|
|
675
|
+
|
|
676
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
677
|
+
# Deserialize Response
|
|
678
|
+
if status_code == 200
|
|
679
|
+
begin
|
|
680
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
681
|
+
result_mapper = Azure::ARM::Automation::Models::JobListResult.mapper()
|
|
682
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
683
|
+
rescue Exception => e
|
|
684
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
685
|
+
end
|
|
686
|
+
end
|
|
687
|
+
|
|
688
|
+
result
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
promise.execute
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
#
|
|
695
|
+
# Resume the job identified by jobId.
|
|
696
|
+
#
|
|
697
|
+
# @param resource_group_name [String] The resource group name.
|
|
698
|
+
# @param automation_account_name [String] The automation account name.
|
|
699
|
+
# @param job_id The job id.
|
|
700
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
701
|
+
# will be added to the HTTP request.
|
|
702
|
+
#
|
|
703
|
+
#
|
|
704
|
+
def resume(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
705
|
+
response = resume_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
706
|
+
nil
|
|
707
|
+
end
|
|
708
|
+
|
|
709
|
+
#
|
|
710
|
+
# Resume the job identified by jobId.
|
|
711
|
+
#
|
|
712
|
+
# @param resource_group_name [String] The resource group name.
|
|
713
|
+
# @param automation_account_name [String] The automation account name.
|
|
714
|
+
# @param job_id The job id.
|
|
715
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
716
|
+
# will be added to the HTTP request.
|
|
717
|
+
#
|
|
718
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
719
|
+
#
|
|
720
|
+
def resume_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
721
|
+
resume_async(resource_group_name, automation_account_name, job_id, custom_headers).value!
|
|
722
|
+
end
|
|
723
|
+
|
|
724
|
+
#
|
|
725
|
+
# Resume the job identified by jobId.
|
|
726
|
+
#
|
|
727
|
+
# @param resource_group_name [String] The resource group name.
|
|
728
|
+
# @param automation_account_name [String] The automation account name.
|
|
729
|
+
# @param job_id The job id.
|
|
730
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
731
|
+
# to the HTTP request.
|
|
732
|
+
#
|
|
733
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
734
|
+
#
|
|
735
|
+
def resume_async(resource_group_name, automation_account_name, job_id, custom_headers = nil)
|
|
736
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
737
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
738
|
+
fail ArgumentError, 'job_id is nil' if job_id.nil?
|
|
739
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
740
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
request_headers = {}
|
|
744
|
+
|
|
745
|
+
# Set Headers
|
|
746
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
747
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
748
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/resume'
|
|
749
|
+
|
|
750
|
+
request_url = @base_url || @client.base_url
|
|
751
|
+
|
|
752
|
+
options = {
|
|
753
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
754
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'jobId' => job_id,'subscriptionId' => @client.subscription_id},
|
|
755
|
+
query_params: {'api-version' => @client.api_version},
|
|
756
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
757
|
+
base_url: request_url
|
|
758
|
+
}
|
|
759
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
760
|
+
|
|
761
|
+
promise = promise.then do |result|
|
|
762
|
+
http_response = result.response
|
|
763
|
+
status_code = http_response.status
|
|
764
|
+
response_content = http_response.body
|
|
765
|
+
unless status_code == 200
|
|
766
|
+
error_model = JSON.load(response_content)
|
|
767
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
768
|
+
end
|
|
769
|
+
|
|
770
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
771
|
+
|
|
772
|
+
result
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
promise.execute
|
|
776
|
+
end
|
|
777
|
+
|
|
778
|
+
#
|
|
779
|
+
# Retrieve a list of jobs.
|
|
780
|
+
#
|
|
781
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
782
|
+
# to List operation.
|
|
783
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
784
|
+
# will be added to the HTTP request.
|
|
785
|
+
#
|
|
786
|
+
# @return [JobListResult] operation results.
|
|
787
|
+
#
|
|
788
|
+
def list_by_automation_account_next(next_page_link, custom_headers = nil)
|
|
789
|
+
response = list_by_automation_account_next_async(next_page_link, custom_headers).value!
|
|
790
|
+
response.body unless response.nil?
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
#
|
|
794
|
+
# Retrieve a list of jobs.
|
|
795
|
+
#
|
|
796
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
797
|
+
# to List operation.
|
|
798
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
799
|
+
# will be added to the HTTP request.
|
|
800
|
+
#
|
|
801
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
802
|
+
#
|
|
803
|
+
def list_by_automation_account_next_with_http_info(next_page_link, custom_headers = nil)
|
|
804
|
+
list_by_automation_account_next_async(next_page_link, custom_headers).value!
|
|
805
|
+
end
|
|
806
|
+
|
|
807
|
+
#
|
|
808
|
+
# Retrieve a list of jobs.
|
|
809
|
+
#
|
|
810
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
811
|
+
# to List operation.
|
|
812
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
813
|
+
# to the HTTP request.
|
|
814
|
+
#
|
|
815
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
816
|
+
#
|
|
817
|
+
def list_by_automation_account_next_async(next_page_link, custom_headers = nil)
|
|
818
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
request_headers = {}
|
|
822
|
+
|
|
823
|
+
# Set Headers
|
|
824
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
825
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
826
|
+
path_template = '{nextLink}'
|
|
827
|
+
|
|
828
|
+
request_url = @base_url || @client.base_url
|
|
829
|
+
|
|
830
|
+
options = {
|
|
831
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
832
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
833
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
834
|
+
base_url: request_url
|
|
835
|
+
}
|
|
836
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
837
|
+
|
|
838
|
+
promise = promise.then do |result|
|
|
839
|
+
http_response = result.response
|
|
840
|
+
status_code = http_response.status
|
|
841
|
+
response_content = http_response.body
|
|
842
|
+
unless status_code == 200
|
|
843
|
+
error_model = JSON.load(response_content)
|
|
844
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
845
|
+
end
|
|
846
|
+
|
|
847
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
848
|
+
# Deserialize Response
|
|
849
|
+
if status_code == 200
|
|
850
|
+
begin
|
|
851
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
852
|
+
result_mapper = Azure::ARM::Automation::Models::JobListResult.mapper()
|
|
853
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
854
|
+
rescue Exception => e
|
|
855
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
856
|
+
end
|
|
857
|
+
end
|
|
858
|
+
|
|
859
|
+
result
|
|
860
|
+
end
|
|
861
|
+
|
|
862
|
+
promise.execute
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
#
|
|
866
|
+
# Retrieve a list of jobs.
|
|
867
|
+
#
|
|
868
|
+
# @param resource_group_name [String] The resource group name.
|
|
869
|
+
# @param automation_account_name [String] The automation account name.
|
|
870
|
+
# @param filter [String] The filter to apply on the operation.
|
|
871
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
872
|
+
# will be added to the HTTP request.
|
|
873
|
+
#
|
|
874
|
+
# @return [JobListResult] which provide lazy access to pages of the response.
|
|
875
|
+
#
|
|
876
|
+
def list_by_automation_account_as_lazy(resource_group_name, automation_account_name, filter = nil, custom_headers = nil)
|
|
877
|
+
response = list_by_automation_account_async(resource_group_name, automation_account_name, filter, custom_headers).value!
|
|
878
|
+
unless response.nil?
|
|
879
|
+
page = response.body
|
|
880
|
+
page.next_method = Proc.new do |next_page_link|
|
|
881
|
+
list_by_automation_account_next_async(next_page_link, custom_headers)
|
|
882
|
+
end
|
|
883
|
+
page
|
|
884
|
+
end
|
|
885
|
+
end
|
|
886
|
+
|
|
887
|
+
end
|
|
888
|
+
end
|