azure_mgmt_automation 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_automation.rb +6 -0
  4. data/lib/generated/azure_mgmt_automation.rb +183 -0
  5. data/lib/generated/azure_mgmt_automation/activity_operations.rb +332 -0
  6. data/lib/generated/azure_mgmt_automation/agent_registration_information.rb +223 -0
  7. data/lib/generated/azure_mgmt_automation/automation_account_operations.rb +822 -0
  8. data/lib/generated/azure_mgmt_automation/automation_client.rb +245 -0
  9. data/lib/generated/azure_mgmt_automation/certificate_operations.rb +642 -0
  10. data/lib/generated/azure_mgmt_automation/connection_operations.rb +653 -0
  11. data/lib/generated/azure_mgmt_automation/connection_type_operations.rb +528 -0
  12. data/lib/generated/azure_mgmt_automation/credential_operations.rb +642 -0
  13. data/lib/generated/azure_mgmt_automation/dsc_compilation_job_operations.rb +534 -0
  14. data/lib/generated/azure_mgmt_automation/dsc_configuration_operations.rb +629 -0
  15. data/lib/generated/azure_mgmt_automation/dsc_node_configuration_operations.rb +532 -0
  16. data/lib/generated/azure_mgmt_automation/dsc_node_operations.rb +530 -0
  17. data/lib/generated/azure_mgmt_automation/fields.rb +124 -0
  18. data/lib/generated/azure_mgmt_automation/hybrid_runbook_worker_group_operations.rb +524 -0
  19. data/lib/generated/azure_mgmt_automation/job_operations.rb +888 -0
  20. data/lib/generated/azure_mgmt_automation/job_schedule_operations.rb +515 -0
  21. data/lib/generated/azure_mgmt_automation/job_stream_operations.rb +333 -0
  22. data/lib/generated/azure_mgmt_automation/models/activity.rb +133 -0
  23. data/lib/generated/azure_mgmt_automation/models/activity_list_result.rb +94 -0
  24. data/lib/generated/azure_mgmt_automation/models/activity_output_type.rb +54 -0
  25. data/lib/generated/azure_mgmt_automation/models/activity_parameter.rb +129 -0
  26. data/lib/generated/azure_mgmt_automation/models/activity_parameter_set.rb +63 -0
  27. data/lib/generated/azure_mgmt_automation/models/advanced_schedule.rb +89 -0
  28. data/lib/generated/azure_mgmt_automation/models/advanced_schedule_monthly_occurrence.rb +58 -0
  29. data/lib/generated/azure_mgmt_automation/models/agent_registration.rb +76 -0
  30. data/lib/generated/azure_mgmt_automation/models/agent_registration_key_name.rb +16 -0
  31. data/lib/generated/azure_mgmt_automation/models/agent_registration_keys.rb +54 -0
  32. data/lib/generated/azure_mgmt_automation/models/agent_registration_regenerate_key_parameter.rb +84 -0
  33. data/lib/generated/azure_mgmt_automation/models/automation_account.rb +154 -0
  34. data/lib/generated/azure_mgmt_automation/models/automation_account_create_or_update_parameters.rb +85 -0
  35. data/lib/generated/azure_mgmt_automation/models/automation_account_list_result.rb +94 -0
  36. data/lib/generated/azure_mgmt_automation/models/automation_account_state.rb +17 -0
  37. data/lib/generated/azure_mgmt_automation/models/automation_account_update_parameters.rb +83 -0
  38. data/lib/generated/azure_mgmt_automation/models/certificate.rb +121 -0
  39. data/lib/generated/azure_mgmt_automation/models/certificate_create_or_update_parameters.rb +87 -0
  40. data/lib/generated/azure_mgmt_automation/models/certificate_list_result.rb +94 -0
  41. data/lib/generated/azure_mgmt_automation/models/certificate_update_parameters.rb +54 -0
  42. data/lib/generated/azure_mgmt_automation/models/connection.rb +119 -0
  43. data/lib/generated/azure_mgmt_automation/models/connection_create_or_update_parameters.rb +84 -0
  44. data/lib/generated/azure_mgmt_automation/models/connection_list_result.rb +94 -0
  45. data/lib/generated/azure_mgmt_automation/models/connection_type.rb +118 -0
  46. data/lib/generated/azure_mgmt_automation/models/connection_type_association_property.rb +44 -0
  47. data/lib/generated/azure_mgmt_automation/models/connection_type_create_or_update_parameters.rb +75 -0
  48. data/lib/generated/azure_mgmt_automation/models/connection_type_list_result.rb +95 -0
  49. data/lib/generated/azure_mgmt_automation/models/connection_update_parameters.rb +72 -0
  50. data/lib/generated/azure_mgmt_automation/models/content_hash.rb +55 -0
  51. data/lib/generated/azure_mgmt_automation/models/content_link.rb +65 -0
  52. data/lib/generated/azure_mgmt_automation/models/content_source.rb +77 -0
  53. data/lib/generated/azure_mgmt_automation/models/content_source_type.rb +16 -0
  54. data/lib/generated/azure_mgmt_automation/models/credential.rb +98 -0
  55. data/lib/generated/azure_mgmt_automation/models/credential_create_or_update_parameters.rb +74 -0
  56. data/lib/generated/azure_mgmt_automation/models/credential_list_result.rb +94 -0
  57. data/lib/generated/azure_mgmt_automation/models/credential_update_parameters.rb +74 -0
  58. data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job.rb +186 -0
  59. data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job_create_parameters.rb +102 -0
  60. data/lib/generated/azure_mgmt_automation/models/dsc_compilation_job_list_result.rb +95 -0
  61. data/lib/generated/azure_mgmt_automation/models/dsc_configuration.rb +193 -0
  62. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_association_property.rb +44 -0
  63. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_create_or_update_parameters.rb +132 -0
  64. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_list_result.rb +95 -0
  65. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_parameter.rb +75 -0
  66. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_provisioning_state.rb +15 -0
  67. data/lib/generated/azure_mgmt_automation/models/dsc_configuration_state.rb +17 -0
  68. data/lib/generated/azure_mgmt_automation/models/dsc_meta_configuration.rb +111 -0
  69. data/lib/generated/azure_mgmt_automation/models/dsc_node.rb +161 -0
  70. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration.rb +86 -0
  71. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_association_property.rb +44 -0
  72. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_create_or_update_parameters.rb +69 -0
  73. data/lib/generated/azure_mgmt_automation/models/dsc_node_configuration_list_result.rb +95 -0
  74. data/lib/generated/azure_mgmt_automation/models/dsc_node_list_result.rb +94 -0
  75. data/lib/generated/azure_mgmt_automation/models/dsc_node_report.rb +265 -0
  76. data/lib/generated/azure_mgmt_automation/models/dsc_node_report_list_result.rb +94 -0
  77. data/lib/generated/azure_mgmt_automation/models/dsc_node_update_parameters.rb +56 -0
  78. data/lib/generated/azure_mgmt_automation/models/dsc_report_error.rb +95 -0
  79. data/lib/generated/azure_mgmt_automation/models/dsc_report_resource.rb +143 -0
  80. data/lib/generated/azure_mgmt_automation/models/dsc_report_resource_navigation.rb +44 -0
  81. data/lib/generated/azure_mgmt_automation/models/error_response.rb +54 -0
  82. data/lib/generated/azure_mgmt_automation/models/field_definition.rb +67 -0
  83. data/lib/generated/azure_mgmt_automation/models/http_status_code.rb +61 -0
  84. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker.rb +65 -0
  85. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group.rb +85 -0
  86. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group_update_parameters.rb +46 -0
  87. data/lib/generated/azure_mgmt_automation/models/hybrid_runbook_worker_groups_list_result.rb +95 -0
  88. data/lib/generated/azure_mgmt_automation/models/job.rb +188 -0
  89. data/lib/generated/azure_mgmt_automation/models/job_create_parameters.rb +112 -0
  90. data/lib/generated/azure_mgmt_automation/models/job_list_result.rb +94 -0
  91. data/lib/generated/azure_mgmt_automation/models/job_schedule.rb +105 -0
  92. data/lib/generated/azure_mgmt_automation/models/job_schedule_create_parameters.rb +84 -0
  93. data/lib/generated/azure_mgmt_automation/models/job_schedule_list_result.rb +94 -0
  94. data/lib/generated/azure_mgmt_automation/models/job_status.rb +27 -0
  95. data/lib/generated/azure_mgmt_automation/models/job_stream.rb +113 -0
  96. data/lib/generated/azure_mgmt_automation/models/job_stream_list_result.rb +94 -0
  97. data/lib/generated/azure_mgmt_automation/models/job_stream_type.rb +21 -0
  98. data/lib/generated/azure_mgmt_automation/models/module_create_or_update_parameters.rb +83 -0
  99. data/lib/generated/azure_mgmt_automation/models/module_error_info.rb +54 -0
  100. data/lib/generated/azure_mgmt_automation/models/module_list_result.rb +94 -0
  101. data/lib/generated/azure_mgmt_automation/models/module_model.rb +198 -0
  102. data/lib/generated/azure_mgmt_automation/models/module_provisioning_state.rb +30 -0
  103. data/lib/generated/azure_mgmt_automation/models/module_update_parameters.rb +83 -0
  104. data/lib/generated/azure_mgmt_automation/models/operation.rb +55 -0
  105. data/lib/generated/azure_mgmt_automation/models/operation_display.rb +65 -0
  106. data/lib/generated/azure_mgmt_automation/models/operation_list_result.rb +53 -0
  107. data/lib/generated/azure_mgmt_automation/models/resource.rb +94 -0
  108. data/lib/generated/azure_mgmt_automation/models/run_as_credential_association_property.rb +44 -0
  109. data/lib/generated/azure_mgmt_automation/models/runbook.rb +263 -0
  110. data/lib/generated/azure_mgmt_automation/models/runbook_association_property.rb +44 -0
  111. data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_draft_parameters.rb +44 -0
  112. data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_draft_properties.rb +99 -0
  113. data/lib/generated/azure_mgmt_automation/models/runbook_create_or_update_parameters.rb +147 -0
  114. data/lib/generated/azure_mgmt_automation/models/runbook_draft.rb +112 -0
  115. data/lib/generated/azure_mgmt_automation/models/runbook_draft_undo_edit_result.rb +68 -0
  116. data/lib/generated/azure_mgmt_automation/models/runbook_list_result.rb +94 -0
  117. data/lib/generated/azure_mgmt_automation/models/runbook_parameter.rb +75 -0
  118. data/lib/generated/azure_mgmt_automation/models/runbook_provisioning_state.rb +15 -0
  119. data/lib/generated/azure_mgmt_automation/models/runbook_state.rb +17 -0
  120. data/lib/generated/azure_mgmt_automation/models/runbook_type_enum.rb +20 -0
  121. data/lib/generated/azure_mgmt_automation/models/runbook_update_parameters.rb +113 -0
  122. data/lib/generated/azure_mgmt_automation/models/schedule.rb +199 -0
  123. data/lib/generated/azure_mgmt_automation/models/schedule_association_property.rb +44 -0
  124. data/lib/generated/azure_mgmt_automation/models/schedule_create_or_update_parameters.rb +116 -0
  125. data/lib/generated/azure_mgmt_automation/models/schedule_day.rb +21 -0
  126. data/lib/generated/azure_mgmt_automation/models/schedule_frequency.rb +19 -0
  127. data/lib/generated/azure_mgmt_automation/models/schedule_list_result.rb +94 -0
  128. data/lib/generated/azure_mgmt_automation/models/schedule_update_parameters.rb +65 -0
  129. data/lib/generated/azure_mgmt_automation/models/sku.rb +65 -0
  130. data/lib/generated/azure_mgmt_automation/models/sku_name_enum.rb +16 -0
  131. data/lib/generated/azure_mgmt_automation/models/statistics.rb +89 -0
  132. data/lib/generated/azure_mgmt_automation/models/statistics_list_result.rb +52 -0
  133. data/lib/generated/azure_mgmt_automation/models/sub_resource.rb +44 -0
  134. data/lib/generated/azure_mgmt_automation/models/test_job.rb +144 -0
  135. data/lib/generated/azure_mgmt_automation/models/test_job_create_parameters.rb +73 -0
  136. data/lib/generated/azure_mgmt_automation/models/type_field.rb +54 -0
  137. data/lib/generated/azure_mgmt_automation/models/type_field_list_result.rb +52 -0
  138. data/lib/generated/azure_mgmt_automation/models/usage.rb +95 -0
  139. data/lib/generated/azure_mgmt_automation/models/usage_counter_name.rb +54 -0
  140. data/lib/generated/azure_mgmt_automation/models/usage_list_result.rb +52 -0
  141. data/lib/generated/azure_mgmt_automation/models/variable.rb +104 -0
  142. data/lib/generated/azure_mgmt_automation/models/variable_create_or_update_parameters.rb +74 -0
  143. data/lib/generated/azure_mgmt_automation/models/variable_list_result.rb +94 -0
  144. data/lib/generated/azure_mgmt_automation/models/variable_update_parameters.rb +64 -0
  145. data/lib/generated/azure_mgmt_automation/models/webhook.rb +168 -0
  146. data/lib/generated/azure_mgmt_automation/models/webhook_create_or_update_parameters.rb +115 -0
  147. data/lib/generated/azure_mgmt_automation/models/webhook_list_result.rb +94 -0
  148. data/lib/generated/azure_mgmt_automation/models/webhook_update_parameters.rb +94 -0
  149. data/lib/generated/azure_mgmt_automation/module_definition.rb +8 -0
  150. data/lib/generated/azure_mgmt_automation/module_model_operations.rb +633 -0
  151. data/lib/generated/azure_mgmt_automation/node_reports.rb +438 -0
  152. data/lib/generated/azure_mgmt_automation/object_data_types.rb +219 -0
  153. data/lib/generated/azure_mgmt_automation/operations.rb +106 -0
  154. data/lib/generated/azure_mgmt_automation/runbook_draft_operations.rb +605 -0
  155. data/lib/generated/azure_mgmt_automation/runbook_operations.rb +719 -0
  156. data/lib/generated/azure_mgmt_automation/schedule_operations.rb +626 -0
  157. data/lib/generated/azure_mgmt_automation/statistics_operations.rb +119 -0
  158. data/lib/generated/azure_mgmt_automation/test_job_streams.rb +333 -0
  159. data/lib/generated/azure_mgmt_automation/test_jobs.rb +486 -0
  160. data/lib/generated/azure_mgmt_automation/usages.rb +116 -0
  161. data/lib/generated/azure_mgmt_automation/variable_operations.rb +636 -0
  162. data/lib/generated/azure_mgmt_automation/version.rb +8 -0
  163. data/lib/generated/azure_mgmt_automation/webhook_operations.rb +737 -0
  164. metadata +275 -0
@@ -0,0 +1,438 @@
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 NodeReports
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the NodeReports 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 Dsc node report list by node id.
26
+ #
27
+ # @param resource_group_name [String] The resource group name.
28
+ # @param automation_account_name [String] The automation account name.
29
+ # @param node_id [String] The parameters supplied to the list operation.
30
+ # @param filter [String] The filter to apply on the operation.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<DscNodeReport>] operation results.
35
+ #
36
+ def list_by_node(resource_group_name, automation_account_name, node_id, filter = nil, custom_headers = nil)
37
+ first_page = list_by_node_as_lazy(resource_group_name, automation_account_name, node_id, filter, custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Retrieve the Dsc node report list by node id.
43
+ #
44
+ # @param resource_group_name [String] The resource group name.
45
+ # @param automation_account_name [String] The automation account name.
46
+ # @param node_id [String] The parameters supplied to the list operation.
47
+ # @param filter [String] The filter to apply on the operation.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_by_node_with_http_info(resource_group_name, automation_account_name, node_id, filter = nil, custom_headers = nil)
54
+ list_by_node_async(resource_group_name, automation_account_name, node_id, filter, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Retrieve the Dsc node report list by node id.
59
+ #
60
+ # @param resource_group_name [String] The resource group name.
61
+ # @param automation_account_name [String] The automation account name.
62
+ # @param node_id [String] The parameters supplied to the list operation.
63
+ # @param filter [String] The filter to apply on the operation.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_by_node_async(resource_group_name, automation_account_name, node_id, filter = nil, custom_headers = nil)
70
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
72
+ fail ArgumentError, 'node_id is nil' if node_id.nil?
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+
76
+
77
+ request_headers = {}
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'nodeId' => node_id,'subscriptionId' => @client.subscription_id},
89
+ query_params: {'$filter' => filter,'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ # Deserialize Response
106
+ if status_code == 200
107
+ begin
108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
+ result_mapper = Azure::ARM::Automation::Models::DscNodeReportListResult.mapper()
110
+ result.body = @client.deserialize(result_mapper, parsed_response)
111
+ rescue Exception => e
112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
113
+ end
114
+ end
115
+
116
+ result
117
+ end
118
+
119
+ promise.execute
120
+ end
121
+
122
+ #
123
+ # Retrieve the Dsc node report data by node id and report id.
124
+ #
125
+ # @param resource_group_name [String] The resource group name.
126
+ # @param automation_account_name [String] The automation account name.
127
+ # @param node_id [String] The Dsc node id.
128
+ # @param report_id [String] The report id.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [DscNodeReport] operation results.
133
+ #
134
+ def get(resource_group_name, automation_account_name, node_id, report_id, custom_headers = nil)
135
+ response = get_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers).value!
136
+ response.body unless response.nil?
137
+ end
138
+
139
+ #
140
+ # Retrieve the Dsc node report data by node id and report id.
141
+ #
142
+ # @param resource_group_name [String] The resource group name.
143
+ # @param automation_account_name [String] The automation account name.
144
+ # @param node_id [String] The Dsc node id.
145
+ # @param report_id [String] The report id.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def get_with_http_info(resource_group_name, automation_account_name, node_id, report_id, custom_headers = nil)
152
+ get_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Retrieve the Dsc node report data by node id and report id.
157
+ #
158
+ # @param resource_group_name [String] The resource group name.
159
+ # @param automation_account_name [String] The automation account name.
160
+ # @param node_id [String] The Dsc node id.
161
+ # @param report_id [String] The report id.
162
+ # @param [Hash{String => String}] A hash of custom headers that will be added
163
+ # to the HTTP request.
164
+ #
165
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
166
+ #
167
+ def get_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers = nil)
168
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
169
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
170
+ fail ArgumentError, 'node_id is nil' if node_id.nil?
171
+ fail ArgumentError, 'report_id is nil' if report_id.nil?
172
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
173
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
174
+
175
+
176
+ request_headers = {}
177
+
178
+ # Set Headers
179
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
180
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
181
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}'
182
+
183
+ request_url = @base_url || @client.base_url
184
+
185
+ options = {
186
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
187
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'nodeId' => node_id,'reportId' => report_id,'subscriptionId' => @client.subscription_id},
188
+ query_params: {'api-version' => @client.api_version},
189
+ headers: request_headers.merge(custom_headers || {}),
190
+ base_url: request_url
191
+ }
192
+ promise = @client.make_request_async(:get, path_template, options)
193
+
194
+ promise = promise.then do |result|
195
+ http_response = result.response
196
+ status_code = http_response.status
197
+ response_content = http_response.body
198
+ unless status_code == 200
199
+ error_model = JSON.load(response_content)
200
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
201
+ end
202
+
203
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
204
+ # Deserialize Response
205
+ if status_code == 200
206
+ begin
207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
208
+ result_mapper = Azure::ARM::Automation::Models::DscNodeReport.mapper()
209
+ result.body = @client.deserialize(result_mapper, parsed_response)
210
+ rescue Exception => e
211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
212
+ end
213
+ end
214
+
215
+ result
216
+ end
217
+
218
+ promise.execute
219
+ end
220
+
221
+ #
222
+ # Retrieve the Dsc node reports by node id and report id.
223
+ #
224
+ # @param resource_group_name [String] The resource group name.
225
+ # @param automation_account_name [String] The automation account name.
226
+ # @param node_id [String] The Dsc node id.
227
+ # @param report_id [String] The report id.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [NOT_IMPLEMENTED] operation results.
232
+ #
233
+ def get_content(resource_group_name, automation_account_name, node_id, report_id, custom_headers = nil)
234
+ response = get_content_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers).value!
235
+ response.body unless response.nil?
236
+ end
237
+
238
+ #
239
+ # Retrieve the Dsc node reports by node id and report id.
240
+ #
241
+ # @param resource_group_name [String] The resource group name.
242
+ # @param automation_account_name [String] The automation account name.
243
+ # @param node_id [String] The Dsc node id.
244
+ # @param report_id [String] The report id.
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
249
+ #
250
+ def get_content_with_http_info(resource_group_name, automation_account_name, node_id, report_id, custom_headers = nil)
251
+ get_content_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers).value!
252
+ end
253
+
254
+ #
255
+ # Retrieve the Dsc node reports by node id and report id.
256
+ #
257
+ # @param resource_group_name [String] The resource group name.
258
+ # @param automation_account_name [String] The automation account name.
259
+ # @param node_id [String] The Dsc node id.
260
+ # @param report_id [String] The report id.
261
+ # @param [Hash{String => String}] A hash of custom headers that will be added
262
+ # to the HTTP request.
263
+ #
264
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
265
+ #
266
+ def get_content_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers = nil)
267
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
268
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
269
+ fail ArgumentError, 'node_id is nil' if node_id.nil?
270
+ fail ArgumentError, 'report_id is nil' if report_id.nil?
271
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
272
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
273
+
274
+
275
+ request_headers = {}
276
+
277
+ # Set Headers
278
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
279
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
280
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content'
281
+
282
+ request_url = @base_url || @client.base_url
283
+
284
+ options = {
285
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
286
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'nodeId' => node_id,'reportId' => report_id,'subscriptionId' => @client.subscription_id},
287
+ query_params: {'api-version' => @client.api_version},
288
+ headers: request_headers.merge(custom_headers || {}),
289
+ base_url: request_url
290
+ }
291
+ promise = @client.make_request_async(:get, path_template, options)
292
+
293
+ promise = promise.then do |result|
294
+ http_response = result.response
295
+ status_code = http_response.status
296
+ response_content = http_response.body
297
+ unless status_code == 200
298
+ error_model = JSON.load(response_content)
299
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
300
+ end
301
+
302
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
303
+ # Deserialize Response
304
+ if status_code == 200
305
+ begin
306
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
307
+ result_mapper = {
308
+ required: false,
309
+ serialized_name: 'parsed_response',
310
+ type: {
311
+ name: 'Stream'
312
+ }
313
+ }
314
+ result.body = @client.deserialize(result_mapper, parsed_response)
315
+ rescue Exception => e
316
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
317
+ end
318
+ end
319
+
320
+ result
321
+ end
322
+
323
+ promise.execute
324
+ end
325
+
326
+ #
327
+ # Retrieve the Dsc node report list by node id.
328
+ #
329
+ # @param next_page_link [String] The NextLink from the previous successful call
330
+ # to List operation.
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [DscNodeReportListResult] operation results.
335
+ #
336
+ def list_by_node_next(next_page_link, custom_headers = nil)
337
+ response = list_by_node_next_async(next_page_link, custom_headers).value!
338
+ response.body unless response.nil?
339
+ end
340
+
341
+ #
342
+ # Retrieve the Dsc node report list by node id.
343
+ #
344
+ # @param next_page_link [String] The NextLink from the previous successful call
345
+ # to List operation.
346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
+ # will be added to the HTTP request.
348
+ #
349
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
350
+ #
351
+ def list_by_node_next_with_http_info(next_page_link, custom_headers = nil)
352
+ list_by_node_next_async(next_page_link, custom_headers).value!
353
+ end
354
+
355
+ #
356
+ # Retrieve the Dsc node report list by node id.
357
+ #
358
+ # @param next_page_link [String] The NextLink from the previous successful call
359
+ # to List operation.
360
+ # @param [Hash{String => String}] A hash of custom headers that will be added
361
+ # to the HTTP request.
362
+ #
363
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
364
+ #
365
+ def list_by_node_next_async(next_page_link, custom_headers = nil)
366
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
367
+
368
+
369
+ request_headers = {}
370
+
371
+ # Set Headers
372
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
373
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
374
+ path_template = '{nextLink}'
375
+
376
+ request_url = @base_url || @client.base_url
377
+
378
+ options = {
379
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
380
+ skip_encoding_path_params: {'nextLink' => next_page_link},
381
+ headers: request_headers.merge(custom_headers || {}),
382
+ base_url: request_url
383
+ }
384
+ promise = @client.make_request_async(:get, path_template, options)
385
+
386
+ promise = promise.then do |result|
387
+ http_response = result.response
388
+ status_code = http_response.status
389
+ response_content = http_response.body
390
+ unless status_code == 200
391
+ error_model = JSON.load(response_content)
392
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
393
+ end
394
+
395
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
396
+ # Deserialize Response
397
+ if status_code == 200
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ result_mapper = Azure::ARM::Automation::Models::DscNodeReportListResult.mapper()
401
+ result.body = @client.deserialize(result_mapper, parsed_response)
402
+ rescue Exception => e
403
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
404
+ end
405
+ end
406
+
407
+ result
408
+ end
409
+
410
+ promise.execute
411
+ end
412
+
413
+ #
414
+ # Retrieve the Dsc node report list by node id.
415
+ #
416
+ # @param resource_group_name [String] The resource group name.
417
+ # @param automation_account_name [String] The automation account name.
418
+ # @param node_id [String] The parameters supplied to the list operation.
419
+ # @param filter [String] The filter to apply on the operation.
420
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
421
+ # will be added to the HTTP request.
422
+ #
423
+ # @return [DscNodeReportListResult] which provide lazy access to pages of the
424
+ # response.
425
+ #
426
+ def list_by_node_as_lazy(resource_group_name, automation_account_name, node_id, filter = nil, custom_headers = nil)
427
+ response = list_by_node_async(resource_group_name, automation_account_name, node_id, filter, custom_headers).value!
428
+ unless response.nil?
429
+ page = response.body
430
+ page.next_method = Proc.new do |next_page_link|
431
+ list_by_node_next_async(next_page_link, custom_headers)
432
+ end
433
+ page
434
+ end
435
+ end
436
+
437
+ end
438
+ end
@@ -0,0 +1,219 @@
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 ObjectDataTypes
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ObjectDataTypes 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 a list of fields of a given type identified by module name.
26
+ #
27
+ # @param resource_group_name [String] The resource group name.
28
+ # @param automation_account_name [String] The automation account name.
29
+ # @param module_name [String] The name of module.
30
+ # @param type_name [String] The name of type.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [TypeFieldListResult] operation results.
35
+ #
36
+ def list_fields_by_module_and_type(resource_group_name, automation_account_name, module_name, type_name, custom_headers = nil)
37
+ response = list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Retrieve a list of fields of a given type identified by module name.
43
+ #
44
+ # @param resource_group_name [String] The resource group name.
45
+ # @param automation_account_name [String] The automation account name.
46
+ # @param module_name [String] The name of module.
47
+ # @param type_name [String] The name of type.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_fields_by_module_and_type_with_http_info(resource_group_name, automation_account_name, module_name, type_name, custom_headers = nil)
54
+ list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Retrieve a list of fields of a given type identified by module name.
59
+ #
60
+ # @param resource_group_name [String] The resource group name.
61
+ # @param automation_account_name [String] The automation account name.
62
+ # @param module_name [String] The name of module.
63
+ # @param type_name [String] The name of type.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers = nil)
70
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
72
+ fail ArgumentError, 'module_name is nil' if module_name.nil?
73
+ fail ArgumentError, 'type_name is nil' if type_name.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
76
+
77
+
78
+ request_headers = {}
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'moduleName' => module_name,'typeName' => type_name,'subscriptionId' => @client.subscription_id},
90
+ query_params: {'api-version' => @client.api_version},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::ARM::Automation::Models::TypeFieldListResult.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Retrieve a list of fields of a given type across all accessible modules.
125
+ #
126
+ # @param resource_group_name [String] The resource group name.
127
+ # @param automation_account_name [String] The automation account name.
128
+ # @param type_name [String] The name of type.
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [TypeFieldListResult] operation results.
133
+ #
134
+ def list_fields_by_type(resource_group_name, automation_account_name, type_name, custom_headers = nil)
135
+ response = list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers).value!
136
+ response.body unless response.nil?
137
+ end
138
+
139
+ #
140
+ # Retrieve a list of fields of a given type across all accessible modules.
141
+ #
142
+ # @param resource_group_name [String] The resource group name.
143
+ # @param automation_account_name [String] The automation account name.
144
+ # @param type_name [String] The name of type.
145
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
146
+ # will be added to the HTTP request.
147
+ #
148
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
149
+ #
150
+ def list_fields_by_type_with_http_info(resource_group_name, automation_account_name, type_name, custom_headers = nil)
151
+ list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers).value!
152
+ end
153
+
154
+ #
155
+ # Retrieve a list of fields of a given type across all accessible modules.
156
+ #
157
+ # @param resource_group_name [String] The resource group name.
158
+ # @param automation_account_name [String] The automation account name.
159
+ # @param type_name [String] The name of type.
160
+ # @param [Hash{String => String}] A hash of custom headers that will be added
161
+ # to the HTTP request.
162
+ #
163
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
164
+ #
165
+ def list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers = nil)
166
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
167
+ fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
168
+ fail ArgumentError, 'type_name is nil' if type_name.nil?
169
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
170
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
171
+
172
+
173
+ request_headers = {}
174
+
175
+ # Set Headers
176
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
177
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
178
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields'
179
+
180
+ request_url = @base_url || @client.base_url
181
+
182
+ options = {
183
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
184
+ path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'typeName' => type_name,'subscriptionId' => @client.subscription_id},
185
+ query_params: {'api-version' => @client.api_version},
186
+ headers: request_headers.merge(custom_headers || {}),
187
+ base_url: request_url
188
+ }
189
+ promise = @client.make_request_async(:get, path_template, options)
190
+
191
+ promise = promise.then do |result|
192
+ http_response = result.response
193
+ status_code = http_response.status
194
+ response_content = http_response.body
195
+ unless status_code == 200
196
+ error_model = JSON.load(response_content)
197
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
198
+ end
199
+
200
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
201
+ # Deserialize Response
202
+ if status_code == 200
203
+ begin
204
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
205
+ result_mapper = Azure::ARM::Automation::Models::TypeFieldListResult.mapper()
206
+ result.body = @client.deserialize(result_mapper, parsed_response)
207
+ rescue Exception => e
208
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
209
+ end
210
+ end
211
+
212
+ result
213
+ end
214
+
215
+ promise.execute
216
+ end
217
+
218
+ end
219
+ end