Class: Azure::Automation::Mgmt::V2015_10_31::AutomationClient

Inherits:
MsRestAzure::AzureServiceClient
  • Object
show all
Includes:
MsRestAzure, MsRestAzure::Serialization
Defined in:
lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb

Overview

A service client - single point of access to the REST API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials = nil, base_url = nil, options = nil) ⇒ AutomationClient

Creates initializes a new instance of the AutomationClient class.

Parameters:

  • credentials (MsRest::ServiceClientCredentials) (defaults to: nil)

    credentials to authorize HTTP requests made by the service client.

  • base_url (String) (defaults to: nil)

    the base URI of the service.

  • options (Array) (defaults to: nil)

    filters to be applied to the HTTP requests.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 144

def initialize(credentials = nil, base_url = nil, options = nil)
  super(credentials, options)
  @base_url = base_url || 'https://management.azure.com'

  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
  @credentials = credentials

  @automation_account_operations = AutomationAccountOperations.new(self)
  @operations = Operations.new(self)
  @statistics_operations = StatisticsOperations.new(self)
  @usages = Usages.new(self)
  @keys = Keys.new(self)
  @certificate_operations = CertificateOperations.new(self)
  @connection_operations = ConnectionOperations.new(self)
  @connection_type_operations = ConnectionTypeOperations.new(self)
  @credential_operations = CredentialOperations.new(self)
  @dsc_compilation_job_operations = DscCompilationJobOperations.new(self)
  @dsc_compilation_job_stream = DscCompilationJobStream.new(self)
  @dsc_configuration_operations = DscConfigurationOperations.new(self)
  @agent_registration_information = AgentRegistrationInformation.new(self)
  @dsc_node_operations = DscNodeOperations.new(self)
  @node_reports = NodeReports.new(self)
  @dsc_node_configuration_operations = DscNodeConfigurationOperations.new(self)
  @hybrid_runbook_worker_group_operations = HybridRunbookWorkerGroupOperations.new(self)
  @job_operations = JobOperations.new(self)
  @job_stream_operations = JobStreamOperations.new(self)
  @job_schedule_operations = JobScheduleOperations.new(self)
  @linked_workspace_operations = LinkedWorkspaceOperations.new(self)
  @activity_operations = ActivityOperations.new(self)
  @module_model_operations = ModuleModelOperations.new(self)
  @object_data_types = ObjectDataTypes.new(self)
  @fields = Fields.new(self)
  @runbook_draft_operations = RunbookDraftOperations.new(self)
  @runbook_operations = RunbookOperations.new(self)
  @test_job_streams = TestJobStreams.new(self)
  @test_job_operations = TestJobOperations.new(self)
  @schedule_operations = ScheduleOperations.new(self)
  @variable_operations = VariableOperations.new(self)
  @webhook_operations = WebhookOperations.new(self)
  @api_version = '2015-10-31'
  @accept_language = 'en-US'
  @long_running_operation_retry_timeout = 30
  @generate_client_request_id = true
  add_telemetry
end

Instance Attribute Details

#accept_languageString

Returns The preferred language for the response.

Returns:

  • (String)

    The preferred language for the response.



29
30
31
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 29

def accept_language
  @accept_language
end

#activity_operationsActivityOperations (readonly)

Returns activity_operations.

Returns:



106
107
108
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 106

def activity_operations
  @activity_operations
end

#agent_registration_informationAgentRegistrationInformation (readonly)

Returns agent_registration_information.

Returns:



77
78
79
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 77

def agent_registration_information
  @agent_registration_information
end

#api_versionString (readonly)

Returns Client Api Version.

Returns:

  • (String)

    Client Api Version.



21
22
23
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 21

def api_version
  @api_version
end

#automation_account_operationsAutomationAccountOperations (readonly)

Returns automation_account_operations.

Returns:



41
42
43
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 41

def 
  @automation_account_operations
end

#base_urlString

Returns the base URI of the service.

Returns:

  • (String)

    the base URI of the service.



15
16
17
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 15

def base_url
  @base_url
end

#certificate_operationsCertificateOperations (readonly)

Returns certificate_operations.

Returns:



56
57
58
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 56

def certificate_operations
  @certificate_operations
end

#connection_operationsConnectionOperations (readonly)

Returns connection_operations.

Returns:



59
60
61
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 59

def connection_operations
  @connection_operations
end

#connection_type_operationsConnectionTypeOperations (readonly)

Returns connection_type_operations.

Returns:



62
63
64
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 62

def connection_type_operations
  @connection_type_operations
end

#credential_operationsCredentialOperations (readonly)

Returns credential_operations.

Returns:



65
66
67
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 65

def credential_operations
  @credential_operations
end

#credentialsObject (readonly)

Returns Credentials needed for the client to connect to Azure.

Returns:

  • Credentials needed for the client to connect to Azure.



18
19
20
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 18

def credentials
  @credentials
end

#dsc_compilation_job_operationsDscCompilationJobOperations (readonly)

Returns dsc_compilation_job_operations.

Returns:



68
69
70
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 68

def dsc_compilation_job_operations
  @dsc_compilation_job_operations
end

#dsc_compilation_job_streamDscCompilationJobStream (readonly)

Returns dsc_compilation_job_stream.

Returns:



71
72
73
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 71

def dsc_compilation_job_stream
  @dsc_compilation_job_stream
end

#dsc_configuration_operationsDscConfigurationOperations (readonly)

Returns dsc_configuration_operations.

Returns:



74
75
76
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 74

def dsc_configuration_operations
  @dsc_configuration_operations
end

#dsc_node_configuration_operationsDscNodeConfigurationOperations (readonly)

dsc_node_configuration_operations



87
88
89
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 87

def dsc_node_configuration_operations
  @dsc_node_configuration_operations
end

#dsc_node_operationsDscNodeOperations (readonly)

Returns dsc_node_operations.

Returns:



80
81
82
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 80

def dsc_node_operations
  @dsc_node_operations
end

#fieldsFields (readonly)

Returns fields.

Returns:



115
116
117
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 115

def fields
  @fields
end

#generate_client_request_idBoolean

generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

Returns:

  • (Boolean)

    Whether a unique x-ms-client-request-id should be



38
39
40
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 38

def generate_client_request_id
  @generate_client_request_id
end

#hybrid_runbook_worker_group_operationsHybridRunbookWorkerGroupOperations (readonly)

hybrid_runbook_worker_group_operations



91
92
93
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 91

def hybrid_runbook_worker_group_operations
  @hybrid_runbook_worker_group_operations
end

#job_operationsJobOperations (readonly)

Returns job_operations.

Returns:



94
95
96
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 94

def job_operations
  @job_operations
end

#job_schedule_operationsJobScheduleOperations (readonly)

Returns job_schedule_operations.

Returns:



100
101
102
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 100

def job_schedule_operations
  @job_schedule_operations
end

#job_stream_operationsJobStreamOperations (readonly)

Returns job_stream_operations.

Returns:



97
98
99
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 97

def job_stream_operations
  @job_stream_operations
end

#keysKeys (readonly)

Returns keys.

Returns:



53
54
55
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 53

def keys
  @keys
end

#linked_workspace_operationsLinkedWorkspaceOperations (readonly)

Returns linked_workspace_operations.

Returns:



103
104
105
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 103

def linked_workspace_operations
  @linked_workspace_operations
end

#long_running_operation_retry_timeoutInteger

Operations. Default value is 30.

Returns:

  • (Integer)

    The retry timeout in seconds for Long Running



33
34
35
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 33

def long_running_operation_retry_timeout
  @long_running_operation_retry_timeout
end

#module_model_operationsModuleModelOperations (readonly)

Returns module_model_operations.

Returns:



109
110
111
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 109

def module_model_operations
  @module_model_operations
end

#node_reportsNodeReports (readonly)

Returns node_reports.

Returns:



83
84
85
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 83

def node_reports
  @node_reports
end

#object_data_typesObjectDataTypes (readonly)

Returns object_data_types.

Returns:



112
113
114
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 112

def object_data_types
  @object_data_types
end

#operationsOperations (readonly)

Returns operations.

Returns:



44
45
46
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 44

def operations
  @operations
end

#runbook_draft_operationsRunbookDraftOperations (readonly)

Returns runbook_draft_operations.

Returns:



118
119
120
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 118

def runbook_draft_operations
  @runbook_draft_operations
end

#runbook_operationsRunbookOperations (readonly)

Returns runbook_operations.

Returns:



121
122
123
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 121

def runbook_operations
  @runbook_operations
end

#schedule_operationsScheduleOperations (readonly)

Returns schedule_operations.

Returns:



130
131
132
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 130

def schedule_operations
  @schedule_operations
end

#statistics_operationsStatisticsOperations (readonly)

Returns statistics_operations.

Returns:



47
48
49
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 47

def statistics_operations
  @statistics_operations
end

#subscription_idString

Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

Returns:

  • (String)

    Gets subscription credentials which uniquely identify



26
27
28
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 26

def subscription_id
  @subscription_id
end

#test_job_operationsTestJobOperations (readonly)

Returns test_job_operations.

Returns:



127
128
129
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 127

def test_job_operations
  @test_job_operations
end

#test_job_streamsTestJobStreams (readonly)

Returns test_job_streams.

Returns:



124
125
126
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 124

def test_job_streams
  @test_job_streams
end

#usagesUsages (readonly)

Returns usages.

Returns:



50
51
52
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 50

def usages
  @usages
end

#variable_operationsVariableOperations (readonly)

Returns variable_operations.

Returns:



133
134
135
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 133

def variable_operations
  @variable_operations
end

#webhook_operationsWebhookOperations (readonly)

Returns webhook_operations.

Returns:



136
137
138
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 136

def webhook_operations
  @webhook_operations
end

Instance Method Details

#make_request(method, path, options = {}) ⇒ Hash{String=>String}

Makes a request and returns the body of the response. Example:

request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
options = {
  body: request_content,
  query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, options)

Parameters:

  • method (Symbol)

    with any of the following values :get, :put, :post, :patch, :delete.

  • path (String)

    the path, relative to #base_url.

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

    specifying any request options like :body.

Returns:

  • (Hash{String=>String})

    containing the body of the response.



206
207
208
209
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 206

def make_request(method, path, options = {})
  result = make_request_with_http_info(method, path, options)
  result.body unless result.nil?
end

#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise

Makes a request asynchronously.

Parameters:

  • method (Symbol)

    with any of the following values :get, :put, :post, :patch, :delete.

  • path (String)

    the path, relative to #base_url.

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

    specifying any request options like :body.

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 231

def make_request_async(method, path, options = {})
  fail ArgumentError, 'method is nil' if method.nil?
  fail ArgumentError, 'path is nil' if path.nil?

  request_url = options[:base_url] || @base_url
  if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
    @request_headers['Content-Type'] = options[:headers]['Content-Type']
  end

  request_headers = @request_headers
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
  options.merge!({headers: request_headers.merge(options[:headers] || {})})
  options.merge!({credentials: @credentials}) unless @credentials.nil?

  super(request_url, method, path, options)
end

#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse

Makes a request and returns the operation response.

Parameters:

  • method (Symbol)

    with any of the following values :get, :put, :post, :patch, :delete.

  • path (String)

    the path, relative to #base_url.

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

    specifying any request options like :body.

Returns:

  • (MsRestAzure::AzureOperationResponse)

    Operation response containing the request, response and status.



218
219
220
221
222
# File 'lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb', line 218

def make_request_with_http_info(method, path, options = {})
  result = make_request_async(method, path, options).value!
  result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
  result
end