azure_mgmt_automation 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/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,106 @@
|
|
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 Operations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Operations 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
|
+
# Lists all of the available Automation REST API operations.
|
26
|
+
#
|
27
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
28
|
+
# will be added to the HTTP request.
|
29
|
+
#
|
30
|
+
# @return [OperationListResult] operation results.
|
31
|
+
#
|
32
|
+
def list(custom_headers = nil)
|
33
|
+
response = list_async(custom_headers).value!
|
34
|
+
response.body unless response.nil?
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Lists all of the available Automation REST API operations.
|
39
|
+
#
|
40
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
41
|
+
# will be added to the HTTP request.
|
42
|
+
#
|
43
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
44
|
+
#
|
45
|
+
def list_with_http_info(custom_headers = nil)
|
46
|
+
list_async(custom_headers).value!
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Lists all of the available Automation REST API operations.
|
51
|
+
#
|
52
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
53
|
+
# to the HTTP request.
|
54
|
+
#
|
55
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
56
|
+
#
|
57
|
+
def list_async(custom_headers = nil)
|
58
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
59
|
+
|
60
|
+
|
61
|
+
request_headers = {}
|
62
|
+
|
63
|
+
# Set Headers
|
64
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
65
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
66
|
+
path_template = 'providers/Microsoft.Automation/operations'
|
67
|
+
|
68
|
+
request_url = @base_url || @client.base_url
|
69
|
+
|
70
|
+
options = {
|
71
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
72
|
+
query_params: {'api-version' => @client.api_version},
|
73
|
+
headers: request_headers.merge(custom_headers || {}),
|
74
|
+
base_url: request_url
|
75
|
+
}
|
76
|
+
promise = @client.make_request_async(:get, path_template, options)
|
77
|
+
|
78
|
+
promise = promise.then do |result|
|
79
|
+
http_response = result.response
|
80
|
+
status_code = http_response.status
|
81
|
+
response_content = http_response.body
|
82
|
+
unless status_code == 200
|
83
|
+
error_model = JSON.load(response_content)
|
84
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
85
|
+
end
|
86
|
+
|
87
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
88
|
+
# Deserialize Response
|
89
|
+
if status_code == 200
|
90
|
+
begin
|
91
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
92
|
+
result_mapper = Azure::ARM::Automation::Models::OperationListResult.mapper()
|
93
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
94
|
+
rescue Exception => e
|
95
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
result
|
100
|
+
end
|
101
|
+
|
102
|
+
promise.execute
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,605 @@
|
|
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 RunbookDraftOperations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the RunbookDraftOperations 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 content of runbook draft identified by runbook name.
|
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 runbook name.
|
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_content(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
36
|
+
response = get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
37
|
+
response.body unless response.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Retrieve the content of runbook draft identified by runbook name.
|
42
|
+
#
|
43
|
+
# @param resource_group_name [String] The resource group name.
|
44
|
+
# @param automation_account_name [String] The automation account name.
|
45
|
+
# @param runbook_name [String] The runbook name.
|
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_content_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
52
|
+
get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Retrieve the content of runbook draft identified by runbook name.
|
57
|
+
#
|
58
|
+
# @param resource_group_name [String] The resource group name.
|
59
|
+
# @param automation_account_name [String] The automation account name.
|
60
|
+
# @param runbook_name [String] The runbook name.
|
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_content_async(resource_group_name, automation_account_name, runbook_name, 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, 'runbook_name is nil' if runbook_name.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}/runbooks/{runbookName}/draft/content'
|
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,'runbookName' => runbook_name,'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
|
+
# Updates the runbook draft with runbookStream as its content.
|
127
|
+
#
|
128
|
+
# @param resource_group_name [String] The resource group name.
|
129
|
+
# @param automation_account_name [String] The automation account name.
|
130
|
+
# @param runbook_name [String] The runbook name.
|
131
|
+
# @param runbook_content The runbook draft content.
|
132
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
133
|
+
# will be added to the HTTP request.
|
134
|
+
#
|
135
|
+
def create_or_update(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
|
136
|
+
response = create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers).value!
|
137
|
+
nil
|
138
|
+
end
|
139
|
+
|
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 runbook_content The runbook draft content.
|
145
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
146
|
+
# will be added to the HTTP request.
|
147
|
+
#
|
148
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
149
|
+
# response.
|
150
|
+
#
|
151
|
+
def create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
|
152
|
+
# Send request
|
153
|
+
promise = begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers)
|
154
|
+
|
155
|
+
promise = promise.then do |response|
|
156
|
+
# Defining deserialization method.
|
157
|
+
deserialize_method = lambda do |parsed_response|
|
158
|
+
end
|
159
|
+
|
160
|
+
# Waiting for response.
|
161
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
162
|
+
end
|
163
|
+
|
164
|
+
promise
|
165
|
+
end
|
166
|
+
|
167
|
+
#
|
168
|
+
# Retrieve the runbook draft identified by runbook name.
|
169
|
+
#
|
170
|
+
# @param resource_group_name [String] The resource group name.
|
171
|
+
# @param automation_account_name [String] The automation account name.
|
172
|
+
# @param runbook_name [String] The runbook name.
|
173
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
174
|
+
# will be added to the HTTP request.
|
175
|
+
#
|
176
|
+
# @return [RunbookDraft] operation results.
|
177
|
+
#
|
178
|
+
def get(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
179
|
+
response = get_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
180
|
+
response.body unless response.nil?
|
181
|
+
end
|
182
|
+
|
183
|
+
#
|
184
|
+
# Retrieve the runbook draft identified by runbook name.
|
185
|
+
#
|
186
|
+
# @param resource_group_name [String] The resource group name.
|
187
|
+
# @param automation_account_name [String] The automation account name.
|
188
|
+
# @param runbook_name [String] The runbook name.
|
189
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
190
|
+
# will be added to the HTTP request.
|
191
|
+
#
|
192
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
193
|
+
#
|
194
|
+
def get_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
195
|
+
get_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
196
|
+
end
|
197
|
+
|
198
|
+
#
|
199
|
+
# Retrieve the runbook draft identified by runbook name.
|
200
|
+
#
|
201
|
+
# @param resource_group_name [String] The resource group name.
|
202
|
+
# @param automation_account_name [String] The automation account name.
|
203
|
+
# @param runbook_name [String] The runbook name.
|
204
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
205
|
+
# to the HTTP request.
|
206
|
+
#
|
207
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
208
|
+
#
|
209
|
+
def get_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
210
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
211
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
212
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
213
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
214
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
215
|
+
|
216
|
+
|
217
|
+
request_headers = {}
|
218
|
+
|
219
|
+
# Set Headers
|
220
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
221
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
222
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'
|
223
|
+
|
224
|
+
request_url = @base_url || @client.base_url
|
225
|
+
|
226
|
+
options = {
|
227
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
228
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
229
|
+
query_params: {'api-version' => @client.api_version},
|
230
|
+
headers: request_headers.merge(custom_headers || {}),
|
231
|
+
base_url: request_url
|
232
|
+
}
|
233
|
+
promise = @client.make_request_async(:get, path_template, options)
|
234
|
+
|
235
|
+
promise = promise.then do |result|
|
236
|
+
http_response = result.response
|
237
|
+
status_code = http_response.status
|
238
|
+
response_content = http_response.body
|
239
|
+
unless status_code == 200
|
240
|
+
error_model = JSON.load(response_content)
|
241
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
242
|
+
end
|
243
|
+
|
244
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
245
|
+
# Deserialize Response
|
246
|
+
if status_code == 200
|
247
|
+
begin
|
248
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
249
|
+
result_mapper = Azure::ARM::Automation::Models::RunbookDraft.mapper()
|
250
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
251
|
+
rescue Exception => e
|
252
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
result
|
257
|
+
end
|
258
|
+
|
259
|
+
promise.execute
|
260
|
+
end
|
261
|
+
|
262
|
+
#
|
263
|
+
# Publish runbook draft.
|
264
|
+
#
|
265
|
+
# @param resource_group_name [String] The resource group name.
|
266
|
+
# @param automation_account_name [String] The automation account name.
|
267
|
+
# @param runbook_name [String] The parameters supplied to the publish runbook
|
268
|
+
# operation.
|
269
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
270
|
+
# will be added to the HTTP request.
|
271
|
+
#
|
272
|
+
# @return [Runbook] operation results.
|
273
|
+
#
|
274
|
+
def publish(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
275
|
+
response = publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
276
|
+
response.body unless response.nil?
|
277
|
+
end
|
278
|
+
|
279
|
+
#
|
280
|
+
# @param resource_group_name [String] The resource group name.
|
281
|
+
# @param automation_account_name [String] The automation account name.
|
282
|
+
# @param runbook_name [String] The parameters supplied to the publish runbook
|
283
|
+
# operation.
|
284
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
285
|
+
# will be added to the HTTP request.
|
286
|
+
#
|
287
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
288
|
+
# response.
|
289
|
+
#
|
290
|
+
def publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
291
|
+
# Send request
|
292
|
+
promise = begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers)
|
293
|
+
|
294
|
+
promise = promise.then do |response|
|
295
|
+
# Defining deserialization method.
|
296
|
+
deserialize_method = lambda do |parsed_response|
|
297
|
+
result_mapper = Azure::ARM::Automation::Models::Runbook.mapper()
|
298
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
299
|
+
end
|
300
|
+
|
301
|
+
# Waiting for response.
|
302
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
303
|
+
end
|
304
|
+
|
305
|
+
promise
|
306
|
+
end
|
307
|
+
|
308
|
+
#
|
309
|
+
# Retrieve the runbook identified by runbook name.
|
310
|
+
#
|
311
|
+
# @param resource_group_name [String] The resource group name.
|
312
|
+
# @param automation_account_name [String] The automation account name.
|
313
|
+
# @param runbook_name [String] The runbook name.
|
314
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
315
|
+
# will be added to the HTTP request.
|
316
|
+
#
|
317
|
+
# @return [RunbookDraftUndoEditResult] operation results.
|
318
|
+
#
|
319
|
+
def undo_edit(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
320
|
+
response = undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
321
|
+
response.body unless response.nil?
|
322
|
+
end
|
323
|
+
|
324
|
+
#
|
325
|
+
# Retrieve the runbook identified by runbook name.
|
326
|
+
#
|
327
|
+
# @param resource_group_name [String] The resource group name.
|
328
|
+
# @param automation_account_name [String] The automation account name.
|
329
|
+
# @param runbook_name [String] The runbook name.
|
330
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
331
|
+
# will be added to the HTTP request.
|
332
|
+
#
|
333
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
334
|
+
#
|
335
|
+
def undo_edit_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
336
|
+
undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
337
|
+
end
|
338
|
+
|
339
|
+
#
|
340
|
+
# Retrieve the runbook identified by runbook name.
|
341
|
+
#
|
342
|
+
# @param resource_group_name [String] The resource group name.
|
343
|
+
# @param automation_account_name [String] The automation account name.
|
344
|
+
# @param runbook_name [String] The runbook name.
|
345
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
346
|
+
# to the HTTP request.
|
347
|
+
#
|
348
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
349
|
+
#
|
350
|
+
def undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
351
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
352
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
353
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
354
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
355
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
356
|
+
|
357
|
+
|
358
|
+
request_headers = {}
|
359
|
+
|
360
|
+
# Set Headers
|
361
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
362
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
363
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit'
|
364
|
+
|
365
|
+
request_url = @base_url || @client.base_url
|
366
|
+
|
367
|
+
options = {
|
368
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
369
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
370
|
+
query_params: {'api-version' => @client.api_version},
|
371
|
+
headers: request_headers.merge(custom_headers || {}),
|
372
|
+
base_url: request_url
|
373
|
+
}
|
374
|
+
promise = @client.make_request_async(:post, path_template, options)
|
375
|
+
|
376
|
+
promise = promise.then do |result|
|
377
|
+
http_response = result.response
|
378
|
+
status_code = http_response.status
|
379
|
+
response_content = http_response.body
|
380
|
+
unless status_code == 200
|
381
|
+
error_model = JSON.load(response_content)
|
382
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
383
|
+
end
|
384
|
+
|
385
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
386
|
+
# Deserialize Response
|
387
|
+
if status_code == 200
|
388
|
+
begin
|
389
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
390
|
+
result_mapper = Azure::ARM::Automation::Models::RunbookDraftUndoEditResult.mapper()
|
391
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
392
|
+
rescue Exception => e
|
393
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
result
|
398
|
+
end
|
399
|
+
|
400
|
+
promise.execute
|
401
|
+
end
|
402
|
+
|
403
|
+
#
|
404
|
+
# Updates the runbook draft with runbookStream as its content.
|
405
|
+
#
|
406
|
+
# @param resource_group_name [String] The resource group name.
|
407
|
+
# @param automation_account_name [String] The automation account name.
|
408
|
+
# @param runbook_name [String] The runbook name.
|
409
|
+
# @param runbook_content The runbook draft content.
|
410
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
411
|
+
# will be added to the HTTP request.
|
412
|
+
#
|
413
|
+
#
|
414
|
+
def begin_create_or_update(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
|
415
|
+
response = begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers).value!
|
416
|
+
nil
|
417
|
+
end
|
418
|
+
|
419
|
+
#
|
420
|
+
# Updates the runbook draft with runbookStream as its content.
|
421
|
+
#
|
422
|
+
# @param resource_group_name [String] The resource group name.
|
423
|
+
# @param automation_account_name [String] The automation account name.
|
424
|
+
# @param runbook_name [String] The runbook name.
|
425
|
+
# @param runbook_content The runbook draft content.
|
426
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
427
|
+
# will be added to the HTTP request.
|
428
|
+
#
|
429
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
430
|
+
#
|
431
|
+
def begin_create_or_update_with_http_info(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
|
432
|
+
begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers).value!
|
433
|
+
end
|
434
|
+
|
435
|
+
#
|
436
|
+
# Updates the runbook draft with runbookStream as its content.
|
437
|
+
#
|
438
|
+
# @param resource_group_name [String] The resource group name.
|
439
|
+
# @param automation_account_name [String] The automation account name.
|
440
|
+
# @param runbook_name [String] The runbook name.
|
441
|
+
# @param runbook_content The runbook draft content.
|
442
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
443
|
+
# to the HTTP request.
|
444
|
+
#
|
445
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
446
|
+
#
|
447
|
+
def begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
|
448
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
449
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
450
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
451
|
+
fail ArgumentError, 'runbook_content is nil' if runbook_content.nil?
|
452
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
453
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
454
|
+
|
455
|
+
|
456
|
+
request_headers = {}
|
457
|
+
|
458
|
+
# Set Headers
|
459
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
460
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
461
|
+
|
462
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
463
|
+
|
464
|
+
# Serialize Request
|
465
|
+
request_mapper = {
|
466
|
+
required: true,
|
467
|
+
serialized_name: 'runbookContent',
|
468
|
+
type: {
|
469
|
+
name: 'Stream'
|
470
|
+
}
|
471
|
+
}
|
472
|
+
request_content = @client.serialize(request_mapper, runbook_content)
|
473
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
474
|
+
|
475
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'
|
476
|
+
|
477
|
+
request_url = @base_url || @client.base_url
|
478
|
+
|
479
|
+
options = {
|
480
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
481
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
482
|
+
query_params: {'api-version' => @client.api_version},
|
483
|
+
body: request_content,
|
484
|
+
headers: request_headers.merge(custom_headers || {}),
|
485
|
+
base_url: request_url
|
486
|
+
}
|
487
|
+
promise = @client.make_request_async(:put, path_template, options)
|
488
|
+
|
489
|
+
promise = promise.then do |result|
|
490
|
+
http_response = result.response
|
491
|
+
status_code = http_response.status
|
492
|
+
response_content = http_response.body
|
493
|
+
unless status_code == 202 || status_code == 200
|
494
|
+
error_model = JSON.load(response_content)
|
495
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
496
|
+
end
|
497
|
+
|
498
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
499
|
+
|
500
|
+
result
|
501
|
+
end
|
502
|
+
|
503
|
+
promise.execute
|
504
|
+
end
|
505
|
+
|
506
|
+
#
|
507
|
+
# Publish runbook draft.
|
508
|
+
#
|
509
|
+
# @param resource_group_name [String] The resource group name.
|
510
|
+
# @param automation_account_name [String] The automation account name.
|
511
|
+
# @param runbook_name [String] The parameters supplied to the publish runbook
|
512
|
+
# operation.
|
513
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
514
|
+
# will be added to the HTTP request.
|
515
|
+
#
|
516
|
+
# @return [Runbook] operation results.
|
517
|
+
#
|
518
|
+
def begin_publish(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
519
|
+
response = begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
520
|
+
response.body unless response.nil?
|
521
|
+
end
|
522
|
+
|
523
|
+
#
|
524
|
+
# Publish runbook draft.
|
525
|
+
#
|
526
|
+
# @param resource_group_name [String] The resource group name.
|
527
|
+
# @param automation_account_name [String] The automation account name.
|
528
|
+
# @param runbook_name [String] The parameters supplied to the publish runbook
|
529
|
+
# operation.
|
530
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
531
|
+
# will be added to the HTTP request.
|
532
|
+
#
|
533
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
534
|
+
#
|
535
|
+
def begin_publish_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
536
|
+
begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
|
537
|
+
end
|
538
|
+
|
539
|
+
#
|
540
|
+
# Publish runbook draft.
|
541
|
+
#
|
542
|
+
# @param resource_group_name [String] The resource group name.
|
543
|
+
# @param automation_account_name [String] The automation account name.
|
544
|
+
# @param runbook_name [String] The parameters supplied to the publish runbook
|
545
|
+
# operation.
|
546
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
547
|
+
# to the HTTP request.
|
548
|
+
#
|
549
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
550
|
+
#
|
551
|
+
def begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
|
552
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
553
|
+
fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
|
554
|
+
fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
|
555
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
556
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
557
|
+
|
558
|
+
|
559
|
+
request_headers = {}
|
560
|
+
|
561
|
+
# Set Headers
|
562
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
563
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
564
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish'
|
565
|
+
|
566
|
+
request_url = @base_url || @client.base_url
|
567
|
+
|
568
|
+
options = {
|
569
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
570
|
+
path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
|
571
|
+
query_params: {'api-version' => @client.api_version},
|
572
|
+
headers: request_headers.merge(custom_headers || {}),
|
573
|
+
base_url: request_url
|
574
|
+
}
|
575
|
+
promise = @client.make_request_async(:post, path_template, options)
|
576
|
+
|
577
|
+
promise = promise.then do |result|
|
578
|
+
http_response = result.response
|
579
|
+
status_code = http_response.status
|
580
|
+
response_content = http_response.body
|
581
|
+
unless status_code == 202 || status_code == 200
|
582
|
+
error_model = JSON.load(response_content)
|
583
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
584
|
+
end
|
585
|
+
|
586
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
587
|
+
# Deserialize Response
|
588
|
+
if status_code == 200
|
589
|
+
begin
|
590
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
591
|
+
result_mapper = Azure::ARM::Automation::Models::Runbook.mapper()
|
592
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
593
|
+
rescue Exception => e
|
594
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
595
|
+
end
|
596
|
+
end
|
597
|
+
|
598
|
+
result
|
599
|
+
end
|
600
|
+
|
601
|
+
promise.execute
|
602
|
+
end
|
603
|
+
|
604
|
+
end
|
605
|
+
end
|