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,486 @@
|
|
|
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 TestJobs
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the TestJobs 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
|
+
# Create a test job of the runbook.
|
|
26
|
+
#
|
|
27
|
+
# @param resource_group_name [String] The resource group name.
|
|
28
|
+
# @param automation_account_name [String] The automation account name.
|
|
29
|
+
# @param runbook_name [String] The parameters supplied to the create test job
|
|
30
|
+
# operation.
|
|
31
|
+
# @param parameters [TestJobCreateParameters] The parameters supplied to the
|
|
32
|
+
# create test job operation.
|
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
34
|
+
# will be added to the HTTP request.
|
|
35
|
+
#
|
|
36
|
+
# @return [TestJob] operation results.
|
|
37
|
+
#
|
|
38
|
+
def create(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers = nil)
|
|
39
|
+
response = create_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers).value!
|
|
40
|
+
response.body unless response.nil?
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
#
|
|
44
|
+
# Create a test job of the runbook.
|
|
45
|
+
#
|
|
46
|
+
# @param resource_group_name [String] The resource group name.
|
|
47
|
+
# @param automation_account_name [String] The automation account name.
|
|
48
|
+
# @param runbook_name [String] The parameters supplied to the create test job
|
|
49
|
+
# operation.
|
|
50
|
+
# @param parameters [TestJobCreateParameters] The parameters supplied to the
|
|
51
|
+
# create test job operation.
|
|
52
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
53
|
+
# will be added to the HTTP request.
|
|
54
|
+
#
|
|
55
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
56
|
+
#
|
|
57
|
+
def create_with_http_info(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers = nil)
|
|
58
|
+
create_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers).value!
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
#
|
|
62
|
+
# Create a test job of the runbook.
|
|
63
|
+
#
|
|
64
|
+
# @param resource_group_name [String] The resource group name.
|
|
65
|
+
# @param automation_account_name [String] The automation account name.
|
|
66
|
+
# @param runbook_name [String] The parameters supplied to the create test job
|
|
67
|
+
# operation.
|
|
68
|
+
# @param parameters [TestJobCreateParameters] The parameters supplied to the
|
|
69
|
+
# create test job operation.
|
|
70
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
71
|
+
# to the HTTP request.
|
|
72
|
+
#
|
|
73
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
74
|
+
#
|
|
75
|
+
def create_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers = nil)
|
|
76
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
77
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
78
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
|
79
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
81
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
request_headers = {}
|
|
85
|
+
|
|
86
|
+
# Set Headers
|
|
87
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
88
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
89
|
+
|
|
90
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
91
|
+
|
|
92
|
+
# Serialize Request
|
|
93
|
+
request_mapper = Azure::ARM::Automation::Models::TestJobCreateParameters.mapper()
|
|
94
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
95
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
96
|
+
|
|
97
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'
|
|
98
|
+
|
|
99
|
+
request_url = @base_url || @client.base_url
|
|
100
|
+
|
|
101
|
+
options = {
|
|
102
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
103
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
|
104
|
+
query_params: {'api-version' => @client.api_version},
|
|
105
|
+
body: request_content,
|
|
106
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
107
|
+
base_url: request_url
|
|
108
|
+
}
|
|
109
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
110
|
+
|
|
111
|
+
promise = promise.then do |result|
|
|
112
|
+
http_response = result.response
|
|
113
|
+
status_code = http_response.status
|
|
114
|
+
response_content = http_response.body
|
|
115
|
+
unless status_code == 201
|
|
116
|
+
error_model = JSON.load(response_content)
|
|
117
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
121
|
+
# Deserialize Response
|
|
122
|
+
if status_code == 201
|
|
123
|
+
begin
|
|
124
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
125
|
+
result_mapper = Azure::ARM::Automation::Models::TestJob.mapper()
|
|
126
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
127
|
+
rescue Exception => e
|
|
128
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
result
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
promise.execute
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
#
|
|
139
|
+
# Retrieve the test job for the specified runbook.
|
|
140
|
+
#
|
|
141
|
+
# @param resource_group_name [String] The resource group name.
|
|
142
|
+
# @param automation_account_name [String] The automation account name.
|
|
143
|
+
# @param runbook_name [String] The runbook name.
|
|
144
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
145
|
+
# will be added to the HTTP request.
|
|
146
|
+
#
|
|
147
|
+
# @return [TestJob] operation results.
|
|
148
|
+
#
|
|
149
|
+
def get(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
150
|
+
response = get_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
151
|
+
response.body unless response.nil?
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
#
|
|
155
|
+
# Retrieve the test job for the specified runbook.
|
|
156
|
+
#
|
|
157
|
+
# @param resource_group_name [String] The resource group name.
|
|
158
|
+
# @param automation_account_name [String] The automation account name.
|
|
159
|
+
# @param runbook_name [String] The runbook name.
|
|
160
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
161
|
+
# will be added to the HTTP request.
|
|
162
|
+
#
|
|
163
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
164
|
+
#
|
|
165
|
+
def get_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
166
|
+
get_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
#
|
|
170
|
+
# Retrieve the test job for the specified runbook.
|
|
171
|
+
#
|
|
172
|
+
# @param resource_group_name [String] The resource group name.
|
|
173
|
+
# @param automation_account_name [String] The automation account name.
|
|
174
|
+
# @param runbook_name [String] The runbook name.
|
|
175
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
176
|
+
# to the HTTP request.
|
|
177
|
+
#
|
|
178
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
179
|
+
#
|
|
180
|
+
def get_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
181
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
182
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
183
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
|
184
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
185
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
request_headers = {}
|
|
189
|
+
|
|
190
|
+
# Set Headers
|
|
191
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
192
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
193
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'
|
|
194
|
+
|
|
195
|
+
request_url = @base_url || @client.base_url
|
|
196
|
+
|
|
197
|
+
options = {
|
|
198
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
199
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
|
200
|
+
query_params: {'api-version' => @client.api_version},
|
|
201
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
202
|
+
base_url: request_url
|
|
203
|
+
}
|
|
204
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
205
|
+
|
|
206
|
+
promise = promise.then do |result|
|
|
207
|
+
http_response = result.response
|
|
208
|
+
status_code = http_response.status
|
|
209
|
+
response_content = http_response.body
|
|
210
|
+
unless status_code == 200
|
|
211
|
+
error_model = JSON.load(response_content)
|
|
212
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
216
|
+
# Deserialize Response
|
|
217
|
+
if status_code == 200
|
|
218
|
+
begin
|
|
219
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
220
|
+
result_mapper = Azure::ARM::Automation::Models::TestJob.mapper()
|
|
221
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
222
|
+
rescue Exception => e
|
|
223
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
result
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
promise.execute
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
#
|
|
234
|
+
# Resume the test job.
|
|
235
|
+
#
|
|
236
|
+
# @param resource_group_name [String] The resource group name.
|
|
237
|
+
# @param automation_account_name [String] The automation account name.
|
|
238
|
+
# @param runbook_name [String] The runbook name.
|
|
239
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
240
|
+
# will be added to the HTTP request.
|
|
241
|
+
#
|
|
242
|
+
#
|
|
243
|
+
def resume(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
244
|
+
response = resume_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
245
|
+
nil
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
#
|
|
249
|
+
# Resume the test job.
|
|
250
|
+
#
|
|
251
|
+
# @param resource_group_name [String] The resource group name.
|
|
252
|
+
# @param automation_account_name [String] The automation account name.
|
|
253
|
+
# @param runbook_name [String] The runbook name.
|
|
254
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
255
|
+
# will be added to the HTTP request.
|
|
256
|
+
#
|
|
257
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
258
|
+
#
|
|
259
|
+
def resume_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
260
|
+
resume_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
#
|
|
264
|
+
# Resume the test job.
|
|
265
|
+
#
|
|
266
|
+
# @param resource_group_name [String] The resource group name.
|
|
267
|
+
# @param automation_account_name [String] The automation account name.
|
|
268
|
+
# @param runbook_name [String] The runbook name.
|
|
269
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
270
|
+
# to the HTTP request.
|
|
271
|
+
#
|
|
272
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
273
|
+
#
|
|
274
|
+
def resume_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
275
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
276
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
277
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
|
278
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
279
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
request_headers = {}
|
|
283
|
+
|
|
284
|
+
# Set Headers
|
|
285
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
286
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
287
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume'
|
|
288
|
+
|
|
289
|
+
request_url = @base_url || @client.base_url
|
|
290
|
+
|
|
291
|
+
options = {
|
|
292
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
293
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
|
294
|
+
query_params: {'api-version' => @client.api_version},
|
|
295
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
296
|
+
base_url: request_url
|
|
297
|
+
}
|
|
298
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
299
|
+
|
|
300
|
+
promise = promise.then do |result|
|
|
301
|
+
http_response = result.response
|
|
302
|
+
status_code = http_response.status
|
|
303
|
+
response_content = http_response.body
|
|
304
|
+
unless status_code == 200
|
|
305
|
+
error_model = JSON.load(response_content)
|
|
306
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
310
|
+
|
|
311
|
+
result
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
promise.execute
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
#
|
|
318
|
+
# Stop the test job.
|
|
319
|
+
#
|
|
320
|
+
# @param resource_group_name [String] The resource group name.
|
|
321
|
+
# @param automation_account_name [String] The automation account name.
|
|
322
|
+
# @param runbook_name [String] The runbook name.
|
|
323
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
324
|
+
# will be added to the HTTP request.
|
|
325
|
+
#
|
|
326
|
+
#
|
|
327
|
+
def stop(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
328
|
+
response = stop_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
329
|
+
nil
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
#
|
|
333
|
+
# Stop the test job.
|
|
334
|
+
#
|
|
335
|
+
# @param resource_group_name [String] The resource group name.
|
|
336
|
+
# @param automation_account_name [String] The automation account name.
|
|
337
|
+
# @param runbook_name [String] The runbook name.
|
|
338
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
339
|
+
# will be added to the HTTP request.
|
|
340
|
+
#
|
|
341
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
342
|
+
#
|
|
343
|
+
def stop_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
344
|
+
stop_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
#
|
|
348
|
+
# Stop the test job.
|
|
349
|
+
#
|
|
350
|
+
# @param resource_group_name [String] The resource group name.
|
|
351
|
+
# @param automation_account_name [String] The automation account name.
|
|
352
|
+
# @param runbook_name [String] The runbook name.
|
|
353
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
354
|
+
# to the HTTP request.
|
|
355
|
+
#
|
|
356
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
357
|
+
#
|
|
358
|
+
def stop_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
359
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
360
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
361
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
|
362
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
363
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
request_headers = {}
|
|
367
|
+
|
|
368
|
+
# Set Headers
|
|
369
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
370
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
371
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop'
|
|
372
|
+
|
|
373
|
+
request_url = @base_url || @client.base_url
|
|
374
|
+
|
|
375
|
+
options = {
|
|
376
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
377
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
|
378
|
+
query_params: {'api-version' => @client.api_version},
|
|
379
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
380
|
+
base_url: request_url
|
|
381
|
+
}
|
|
382
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
383
|
+
|
|
384
|
+
promise = promise.then do |result|
|
|
385
|
+
http_response = result.response
|
|
386
|
+
status_code = http_response.status
|
|
387
|
+
response_content = http_response.body
|
|
388
|
+
unless status_code == 200
|
|
389
|
+
error_model = JSON.load(response_content)
|
|
390
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
394
|
+
|
|
395
|
+
result
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
promise.execute
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
#
|
|
402
|
+
# Suspend the test job.
|
|
403
|
+
#
|
|
404
|
+
# @param resource_group_name [String] The resource group name.
|
|
405
|
+
# @param automation_account_name [String] The automation account name.
|
|
406
|
+
# @param runbook_name [String] The runbook name.
|
|
407
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
408
|
+
# will be added to the HTTP request.
|
|
409
|
+
#
|
|
410
|
+
#
|
|
411
|
+
def suspend(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
412
|
+
response = suspend_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
413
|
+
nil
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
#
|
|
417
|
+
# Suspend the test job.
|
|
418
|
+
#
|
|
419
|
+
# @param resource_group_name [String] The resource group name.
|
|
420
|
+
# @param automation_account_name [String] The automation account name.
|
|
421
|
+
# @param runbook_name [String] The runbook name.
|
|
422
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
423
|
+
# will be added to the HTTP request.
|
|
424
|
+
#
|
|
425
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
426
|
+
#
|
|
427
|
+
def suspend_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
428
|
+
suspend_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
#
|
|
432
|
+
# Suspend the test job.
|
|
433
|
+
#
|
|
434
|
+
# @param resource_group_name [String] The resource group name.
|
|
435
|
+
# @param automation_account_name [String] The automation account name.
|
|
436
|
+
# @param runbook_name [String] The runbook name.
|
|
437
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
438
|
+
# to the HTTP request.
|
|
439
|
+
#
|
|
440
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
441
|
+
#
|
|
442
|
+
def suspend_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
|
443
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
444
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
|
445
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
|
446
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
447
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
request_headers = {}
|
|
451
|
+
|
|
452
|
+
# Set Headers
|
|
453
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
454
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
455
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend'
|
|
456
|
+
|
|
457
|
+
request_url = @base_url || @client.base_url
|
|
458
|
+
|
|
459
|
+
options = {
|
|
460
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
461
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
|
462
|
+
query_params: {'api-version' => @client.api_version},
|
|
463
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
464
|
+
base_url: request_url
|
|
465
|
+
}
|
|
466
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
467
|
+
|
|
468
|
+
promise = promise.then do |result|
|
|
469
|
+
http_response = result.response
|
|
470
|
+
status_code = http_response.status
|
|
471
|
+
response_content = http_response.body
|
|
472
|
+
unless status_code == 200
|
|
473
|
+
error_model = JSON.load(response_content)
|
|
474
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
478
|
+
|
|
479
|
+
result
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
promise.execute
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
end
|
|
486
|
+
end
|