azure_mgmt_stor_simple8000_series 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_stor_simple8000_series.rb +7 -0
  4. data/lib/generated/azure_mgmt_stor_simple8000_series/access_control_records.rb +507 -0
  5. data/lib/generated/azure_mgmt_stor_simple8000_series/alerts.rb +422 -0
  6. data/lib/generated/azure_mgmt_stor_simple8000_series/backup_policies.rb +655 -0
  7. data/lib/generated/azure_mgmt_stor_simple8000_series/backup_schedules.rb +532 -0
  8. data/lib/generated/azure_mgmt_stor_simple8000_series/backups.rb +645 -0
  9. data/lib/generated/azure_mgmt_stor_simple8000_series/bandwidth_settings.rb +497 -0
  10. data/lib/generated/azure_mgmt_stor_simple8000_series/cloud_appliances.rb +249 -0
  11. data/lib/generated/azure_mgmt_stor_simple8000_series/device_settings.rb +1150 -0
  12. data/lib/generated/azure_mgmt_stor_simple8000_series/devices.rb +1724 -0
  13. data/lib/generated/azure_mgmt_stor_simple8000_series/hardware_component_groups.rb +275 -0
  14. data/lib/generated/azure_mgmt_stor_simple8000_series/jobs.rb +681 -0
  15. data/lib/generated/azure_mgmt_stor_simple8000_series/managers.rb +1709 -0
  16. data/lib/generated/azure_mgmt_stor_simple8000_series/models/access_control_record.rb +88 -0
  17. data/lib/generated/azure_mgmt_stor_simple8000_series/models/access_control_record_list.rb +52 -0
  18. data/lib/generated/azure_mgmt_stor_simple8000_series/models/acs_configuration.rb +64 -0
  19. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert.rb +223 -0
  20. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_email_notification_status.rb +16 -0
  21. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_error_details.rb +64 -0
  22. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_filter.rb +96 -0
  23. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_list.rb +94 -0
  24. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_scope.rb +16 -0
  25. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_settings.rb +119 -0
  26. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_severity.rb +17 -0
  27. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_source.rb +66 -0
  28. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_source_type.rb +16 -0
  29. data/lib/generated/azure_mgmt_stor_simple8000_series/models/alert_status.rb +16 -0
  30. data/lib/generated/azure_mgmt_stor_simple8000_series/models/asymmetric_encrypted_secret.rb +67 -0
  31. data/lib/generated/azure_mgmt_stor_simple8000_series/models/authentication_type.rb +18 -0
  32. data/lib/generated/azure_mgmt_stor_simple8000_series/models/authorization_eligibility.rb +16 -0
  33. data/lib/generated/azure_mgmt_stor_simple8000_series/models/authorization_status.rb +16 -0
  34. data/lib/generated/azure_mgmt_stor_simple8000_series/models/available_provider_operation.rb +82 -0
  35. data/lib/generated/azure_mgmt_stor_simple8000_series/models/available_provider_operation_display.rb +88 -0
  36. data/lib/generated/azure_mgmt_stor_simple8000_series/models/available_provider_operation_list.rb +94 -0
  37. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup.rb +148 -0
  38. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_element.rb +107 -0
  39. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_filter.rb +68 -0
  40. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_job_creation_type.rb +17 -0
  41. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_list.rb +94 -0
  42. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_policy.rb +158 -0
  43. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_policy_creation_type.rb +16 -0
  44. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_policy_list.rb +52 -0
  45. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_schedule.rb +133 -0
  46. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_schedule_list.rb +52 -0
  47. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_status.rb +16 -0
  48. data/lib/generated/azure_mgmt_stor_simple8000_series/models/backup_type.rb +16 -0
  49. data/lib/generated/azure_mgmt_stor_simple8000_series/models/bandwidth_schedule.rb +85 -0
  50. data/lib/generated/azure_mgmt_stor_simple8000_series/models/bandwidth_setting.rb +96 -0
  51. data/lib/generated/azure_mgmt_stor_simple8000_series/models/bandwidth_setting_list.rb +52 -0
  52. data/lib/generated/azure_mgmt_stor_simple8000_series/models/base_model.rb +79 -0
  53. data/lib/generated/azure_mgmt_stor_simple8000_series/models/chap_settings.rb +76 -0
  54. data/lib/generated/azure_mgmt_stor_simple8000_series/models/clear_alert_request.rb +61 -0
  55. data/lib/generated/azure_mgmt_stor_simple8000_series/models/clone_request.rb +85 -0
  56. data/lib/generated/azure_mgmt_stor_simple8000_series/models/cloud_appliance.rb +146 -0
  57. data/lib/generated/azure_mgmt_stor_simple8000_series/models/cloud_appliance_configuration.rb +166 -0
  58. data/lib/generated/azure_mgmt_stor_simple8000_series/models/cloud_appliance_configuration_list.rb +52 -0
  59. data/lib/generated/azure_mgmt_stor_simple8000_series/models/cloud_appliance_settings.rb +58 -0
  60. data/lib/generated/azure_mgmt_stor_simple8000_series/models/configure_device_request.rb +120 -0
  61. data/lib/generated/azure_mgmt_stor_simple8000_series/models/controller_id.rb +18 -0
  62. data/lib/generated/azure_mgmt_stor_simple8000_series/models/controller_power_state_action.rb +17 -0
  63. data/lib/generated/azure_mgmt_stor_simple8000_series/models/controller_power_state_change_request.rb +118 -0
  64. data/lib/generated/azure_mgmt_stor_simple8000_series/models/controller_status.rb +20 -0
  65. data/lib/generated/azure_mgmt_stor_simple8000_series/models/data_statistics.rb +79 -0
  66. data/lib/generated/azure_mgmt_stor_simple8000_series/models/day_of_week.rb +21 -0
  67. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device.rb +364 -0
  68. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_configuration_status.rb +16 -0
  69. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_details.rb +56 -0
  70. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_list.rb +52 -0
  71. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_patch.rb +44 -0
  72. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_rollover_details.rb +75 -0
  73. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_status.rb +25 -0
  74. data/lib/generated/azure_mgmt_stor_simple8000_series/models/device_type.rb +17 -0
  75. data/lib/generated/azure_mgmt_stor_simple8000_series/models/dimension_filter.rb +60 -0
  76. data/lib/generated/azure_mgmt_stor_simple8000_series/models/dnssettings.rb +88 -0
  77. data/lib/generated/azure_mgmt_stor_simple8000_series/models/encryption_algorithm.rb +17 -0
  78. data/lib/generated/azure_mgmt_stor_simple8000_series/models/encryption_settings.rb +93 -0
  79. data/lib/generated/azure_mgmt_stor_simple8000_series/models/encryption_status.rb +16 -0
  80. data/lib/generated/azure_mgmt_stor_simple8000_series/models/failover_request.rb +64 -0
  81. data/lib/generated/azure_mgmt_stor_simple8000_series/models/failover_set.rb +65 -0
  82. data/lib/generated/azure_mgmt_stor_simple8000_series/models/failover_set_eligibility_result.rb +56 -0
  83. data/lib/generated/azure_mgmt_stor_simple8000_series/models/failover_sets_list.rb +52 -0
  84. data/lib/generated/azure_mgmt_stor_simple8000_series/models/failover_target.rb +154 -0
  85. data/lib/generated/azure_mgmt_stor_simple8000_series/models/failover_targets_list.rb +53 -0
  86. data/lib/generated/azure_mgmt_stor_simple8000_series/models/feature.rb +56 -0
  87. data/lib/generated/azure_mgmt_stor_simple8000_series/models/feature_filter.rb +45 -0
  88. data/lib/generated/azure_mgmt_stor_simple8000_series/models/feature_list.rb +52 -0
  89. data/lib/generated/azure_mgmt_stor_simple8000_series/models/feature_support_status.rb +17 -0
  90. data/lib/generated/azure_mgmt_stor_simple8000_series/models/hardware_component.rb +77 -0
  91. data/lib/generated/azure_mgmt_stor_simple8000_series/models/hardware_component_group.rb +104 -0
  92. data/lib/generated/azure_mgmt_stor_simple8000_series/models/hardware_component_group_list.rb +52 -0
  93. data/lib/generated/azure_mgmt_stor_simple8000_series/models/hardware_component_status.rb +21 -0
  94. data/lib/generated/azure_mgmt_stor_simple8000_series/models/in_eligibility_category.rb +17 -0
  95. data/lib/generated/azure_mgmt_stor_simple8000_series/models/iscsiand_cloud_status.rb +18 -0
  96. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job.rb +236 -0
  97. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_error_details.rb +73 -0
  98. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_error_item.rb +72 -0
  99. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_filter.rb +73 -0
  100. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_list.rb +94 -0
  101. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_stage.rb +76 -0
  102. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_status.rb +18 -0
  103. data/lib/generated/azure_mgmt_stor_simple8000_series/models/job_type.rb +24 -0
  104. data/lib/generated/azure_mgmt_stor_simple8000_series/models/key.rb +44 -0
  105. data/lib/generated/azure_mgmt_stor_simple8000_series/models/key_rollover_status.rb +16 -0
  106. data/lib/generated/azure_mgmt_stor_simple8000_series/models/kind.rb +15 -0
  107. data/lib/generated/azure_mgmt_stor_simple8000_series/models/list_failover_targets_request.rb +54 -0
  108. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager.rb +126 -0
  109. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager_extended_info.rb +140 -0
  110. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager_intrinsic_settings.rb +46 -0
  111. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager_list.rb +52 -0
  112. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager_patch.rb +51 -0
  113. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager_sku.rb +47 -0
  114. data/lib/generated/azure_mgmt_stor_simple8000_series/models/manager_type.rb +16 -0
  115. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_aggregation_type.rb +20 -0
  116. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_availablity.rb +55 -0
  117. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_data.rb +94 -0
  118. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_definition.rb +136 -0
  119. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_definition_list.rb +52 -0
  120. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_dimension.rb +54 -0
  121. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_filter.rb +110 -0
  122. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_list.rb +52 -0
  123. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_name.rb +54 -0
  124. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_name_filter.rb +48 -0
  125. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metric_unit.rb +20 -0
  126. data/lib/generated/azure_mgmt_stor_simple8000_series/models/metrics.rb +157 -0
  127. data/lib/generated/azure_mgmt_stor_simple8000_series/models/monitoring_status.rb +16 -0
  128. data/lib/generated/azure_mgmt_stor_simple8000_series/models/net_interface_id.rb +21 -0
  129. data/lib/generated/azure_mgmt_stor_simple8000_series/models/net_interface_status.rb +16 -0
  130. data/lib/generated/azure_mgmt_stor_simple8000_series/models/network_adapter_list.rb +52 -0
  131. data/lib/generated/azure_mgmt_stor_simple8000_series/models/network_adapters.rb +126 -0
  132. data/lib/generated/azure_mgmt_stor_simple8000_series/models/network_interface_data0settings.rb +54 -0
  133. data/lib/generated/azure_mgmt_stor_simple8000_series/models/network_mode.rb +18 -0
  134. data/lib/generated/azure_mgmt_stor_simple8000_series/models/network_settings.rb +99 -0
  135. data/lib/generated/azure_mgmt_stor_simple8000_series/models/network_settings_patch.rb +56 -0
  136. data/lib/generated/azure_mgmt_stor_simple8000_series/models/nic_ipv4.rb +84 -0
  137. data/lib/generated/azure_mgmt_stor_simple8000_series/models/nic_ipv6.rb +84 -0
  138. data/lib/generated/azure_mgmt_stor_simple8000_series/models/operation_status.rb +18 -0
  139. data/lib/generated/azure_mgmt_stor_simple8000_series/models/owner_ship_status.rb +16 -0
  140. data/lib/generated/azure_mgmt_stor_simple8000_series/models/public_key.rb +44 -0
  141. data/lib/generated/azure_mgmt_stor_simple8000_series/models/recurrence_type.rb +18 -0
  142. data/lib/generated/azure_mgmt_stor_simple8000_series/models/remote_management_mode_configuration.rb +18 -0
  143. data/lib/generated/azure_mgmt_stor_simple8000_series/models/remote_management_settings.rb +57 -0
  144. data/lib/generated/azure_mgmt_stor_simple8000_series/models/remote_management_settings_patch.rb +47 -0
  145. data/lib/generated/azure_mgmt_stor_simple8000_series/models/resource.rb +94 -0
  146. data/lib/generated/azure_mgmt_stor_simple8000_series/models/schedule_recurrence.rb +75 -0
  147. data/lib/generated/azure_mgmt_stor_simple8000_series/models/schedule_status.rb +16 -0
  148. data/lib/generated/azure_mgmt_stor_simple8000_series/models/scheduled_backup_status.rb +16 -0
  149. data/lib/generated/azure_mgmt_stor_simple8000_series/models/secondary_dnssettings.rb +51 -0
  150. data/lib/generated/azure_mgmt_stor_simple8000_series/models/security_settings.rb +90 -0
  151. data/lib/generated/azure_mgmt_stor_simple8000_series/models/security_settings_patch.rb +89 -0
  152. data/lib/generated/azure_mgmt_stor_simple8000_series/models/send_test_alert_email_request.rb +52 -0
  153. data/lib/generated/azure_mgmt_stor_simple8000_series/models/ssl_status.rb +16 -0
  154. data/lib/generated/azure_mgmt_stor_simple8000_series/models/storage_account_credential.rb +112 -0
  155. data/lib/generated/azure_mgmt_stor_simple8000_series/models/storage_account_credential_list.rb +52 -0
  156. data/lib/generated/azure_mgmt_stor_simple8000_series/models/symmetric_encrypted_secret.rb +68 -0
  157. data/lib/generated/azure_mgmt_stor_simple8000_series/models/target_eligibility_error_message.rb +74 -0
  158. data/lib/generated/azure_mgmt_stor_simple8000_series/models/target_eligibility_result.rb +66 -0
  159. data/lib/generated/azure_mgmt_stor_simple8000_series/models/target_eligibility_result_code.rb +21 -0
  160. data/lib/generated/azure_mgmt_stor_simple8000_series/models/target_eligibility_status.rb +16 -0
  161. data/lib/generated/azure_mgmt_stor_simple8000_series/models/time.rb +76 -0
  162. data/lib/generated/azure_mgmt_stor_simple8000_series/models/time_settings.rb +106 -0
  163. data/lib/generated/azure_mgmt_stor_simple8000_series/models/updates.rb +107 -0
  164. data/lib/generated/azure_mgmt_stor_simple8000_series/models/virtual_machine_api_type.rb +16 -0
  165. data/lib/generated/azure_mgmt_stor_simple8000_series/models/vm_image.rb +84 -0
  166. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume.rb +187 -0
  167. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_container.rb +161 -0
  168. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_container_failover_metadata.rb +64 -0
  169. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_container_list.rb +52 -0
  170. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_failover_metadata.rb +109 -0
  171. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_list.rb +52 -0
  172. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_status.rb +16 -0
  173. data/lib/generated/azure_mgmt_stor_simple8000_series/models/volume_type.rb +17 -0
  174. data/lib/generated/azure_mgmt_stor_simple8000_series/models/webproxy_settings.rb +66 -0
  175. data/lib/generated/azure_mgmt_stor_simple8000_series/module_definition.rb +8 -0
  176. data/lib/generated/azure_mgmt_stor_simple8000_series/operations.rb +220 -0
  177. data/lib/generated/azure_mgmt_stor_simple8000_series/stor_simple8000series_management_client.rb +189 -0
  178. data/lib/generated/azure_mgmt_stor_simple8000_series/storage_account_credentials.rb +507 -0
  179. data/lib/generated/azure_mgmt_stor_simple8000_series/version.rb +8 -0
  180. data/lib/generated/azure_mgmt_stor_simple8000_series/volume_containers.rb +717 -0
  181. data/lib/generated/azure_mgmt_stor_simple8000_series/volumes.rb +835 -0
  182. data/lib/generated/azure_mgmt_stor_simple8000_series.rb +202 -0
  183. metadata +295 -0
@@ -0,0 +1,275 @@
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::StorSimple8000Series
7
+ #
8
+ # HardwareComponentGroups
9
+ #
10
+ class HardwareComponentGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the HardwareComponentGroups class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorSimple8000SeriesManagementClient] reference to the StorSimple8000SeriesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the hardware component groups at device-level.
26
+ #
27
+ # @param device_name [String] The device name
28
+ # @param resource_group_name [String] The resource group name
29
+ # @param manager_name [String] The manager 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 [HardwareComponentGroupList] operation results.
34
+ #
35
+ def list_by_device(device_name, resource_group_name, manager_name, custom_headers = nil)
36
+ response = list_by_device_async(device_name, resource_group_name, manager_name, custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Lists the hardware component groups at device-level.
42
+ #
43
+ # @param device_name [String] The device name
44
+ # @param resource_group_name [String] The resource group name
45
+ # @param manager_name [String] The manager 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 list_by_device_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
52
+ list_by_device_async(device_name, resource_group_name, manager_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Lists the hardware component groups at device-level.
57
+ #
58
+ # @param device_name [String] The device name
59
+ # @param resource_group_name [String] The resource group name
60
+ # @param manager_name [String] The manager 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 list_by_device_async(device_name, resource_group_name, manager_name, custom_headers = nil)
67
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, 'manager_name is nil' if manager_name.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.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
86
+ skip_encoding_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 MsRestAzure::AzureOperationError.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 = Azure::ARM::StorSimple8000Series::Models::HardwareComponentGroupList.mapper()
107
+ result.body = @client.deserialize(result_mapper, parsed_response)
108
+ rescue Exception => e
109
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
110
+ end
111
+ end
112
+
113
+ result
114
+ end
115
+
116
+ promise.execute
117
+ end
118
+
119
+ #
120
+ # Changes the power state of the controller.
121
+ #
122
+ # @param device_name [String] The device name
123
+ # @param hardware_component_group_name [String] The hardware component group
124
+ # name.
125
+ # @param parameters [ControllerPowerStateChangeRequest] The controller power
126
+ # state change request.
127
+ # @param resource_group_name [String] The resource group name
128
+ # @param manager_name [String] The manager name
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ def change_controller_power_state(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers = nil)
133
+ response = change_controller_power_state_async(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers).value!
134
+ nil
135
+ end
136
+
137
+ #
138
+ # @param device_name [String] The device name
139
+ # @param hardware_component_group_name [String] The hardware component group
140
+ # name.
141
+ # @param parameters [ControllerPowerStateChangeRequest] The controller power
142
+ # state change request.
143
+ # @param resource_group_name [String] The resource group name
144
+ # @param manager_name [String] The manager name
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 change_controller_power_state_async(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers = nil)
152
+ # Send request
153
+ promise = begin_change_controller_power_state_async(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, 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
+ # Changes the power state of the controller.
169
+ #
170
+ # @param device_name [String] The device name
171
+ # @param hardware_component_group_name [String] The hardware component group
172
+ # name.
173
+ # @param parameters [ControllerPowerStateChangeRequest] The controller power
174
+ # state change request.
175
+ # @param resource_group_name [String] The resource group name
176
+ # @param manager_name [String] The manager name
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ #
181
+ def begin_change_controller_power_state(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers = nil)
182
+ response = begin_change_controller_power_state_async(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers).value!
183
+ nil
184
+ end
185
+
186
+ #
187
+ # Changes the power state of the controller.
188
+ #
189
+ # @param device_name [String] The device name
190
+ # @param hardware_component_group_name [String] The hardware component group
191
+ # name.
192
+ # @param parameters [ControllerPowerStateChangeRequest] The controller power
193
+ # state change request.
194
+ # @param resource_group_name [String] The resource group name
195
+ # @param manager_name [String] The manager name
196
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
197
+ # will be added to the HTTP request.
198
+ #
199
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
200
+ #
201
+ def begin_change_controller_power_state_with_http_info(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers = nil)
202
+ begin_change_controller_power_state_async(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers).value!
203
+ end
204
+
205
+ #
206
+ # Changes the power state of the controller.
207
+ #
208
+ # @param device_name [String] The device name
209
+ # @param hardware_component_group_name [String] The hardware component group
210
+ # name.
211
+ # @param parameters [ControllerPowerStateChangeRequest] The controller power
212
+ # state change request.
213
+ # @param resource_group_name [String] The resource group name
214
+ # @param manager_name [String] The manager name
215
+ # @param [Hash{String => String}] A hash of custom headers that will be added
216
+ # to the HTTP request.
217
+ #
218
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
219
+ #
220
+ def begin_change_controller_power_state_async(device_name, hardware_component_group_name, parameters, resource_group_name, manager_name, custom_headers = nil)
221
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
222
+ fail ArgumentError, 'hardware_component_group_name is nil' if hardware_component_group_name.nil?
223
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
224
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
225
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
226
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
227
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
228
+
229
+
230
+ request_headers = {}
231
+
232
+ # Set Headers
233
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
234
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
235
+
236
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
237
+
238
+ # Serialize Request
239
+ request_mapper = Azure::ARM::StorSimple8000Series::Models::ControllerPowerStateChangeRequest.mapper()
240
+ request_content = @client.serialize(request_mapper, parameters)
241
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
242
+
243
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/hardwareComponentGroups/{hardwareComponentGroupName}/changeControllerPowerState'
244
+
245
+ request_url = @base_url || @client.base_url
246
+
247
+ options = {
248
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
249
+ skip_encoding_path_params: {'deviceName' => device_name,'hardwareComponentGroupName' => hardware_component_group_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
250
+ skip_encoding_query_params: {'api-version' => @client.api_version},
251
+ body: request_content,
252
+ headers: request_headers.merge(custom_headers || {}),
253
+ base_url: request_url
254
+ }
255
+ promise = @client.make_request_async(:post, path_template, options)
256
+
257
+ promise = promise.then do |result|
258
+ http_response = result.response
259
+ status_code = http_response.status
260
+ response_content = http_response.body
261
+ unless status_code == 202 || status_code == 204
262
+ error_model = JSON.load(response_content)
263
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
264
+ end
265
+
266
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
267
+
268
+ result
269
+ end
270
+
271
+ promise.execute
272
+ end
273
+
274
+ end
275
+ end
@@ -0,0 +1,681 @@
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::StorSimple8000Series
7
+ #
8
+ # Jobs
9
+ #
10
+ class Jobs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Jobs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorSimple8000SeriesManagementClient] reference to the StorSimple8000SeriesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all the jobs for specified device. With optional OData query parameters,
26
+ # a filtered set of jobs is returned.
27
+ #
28
+ # @param device_name [String] The device name
29
+ # @param resource_group_name [String] The resource group name
30
+ # @param manager_name [String] The manager name
31
+ # @param filter [String] OData Filter options
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Array<Job>] operation results.
36
+ #
37
+ def list_by_device(device_name, resource_group_name, manager_name, filter = nil, custom_headers = nil)
38
+ first_page = list_by_device_as_lazy(device_name, resource_group_name, manager_name, filter, custom_headers)
39
+ first_page.get_all_items
40
+ end
41
+
42
+ #
43
+ # Gets all the jobs for specified device. With optional OData query parameters,
44
+ # a filtered set of jobs is returned.
45
+ #
46
+ # @param device_name [String] The device name
47
+ # @param resource_group_name [String] The resource group name
48
+ # @param manager_name [String] The manager name
49
+ # @param filter [String] OData Filter options
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_by_device_with_http_info(device_name, resource_group_name, manager_name, filter = nil, custom_headers = nil)
56
+ list_by_device_async(device_name, resource_group_name, manager_name, filter, custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Gets all the jobs for specified device. With optional OData query parameters,
61
+ # a filtered set of jobs is returned.
62
+ #
63
+ # @param device_name [String] The device name
64
+ # @param resource_group_name [String] The resource group name
65
+ # @param manager_name [String] The manager name
66
+ # @param filter [String] OData Filter options
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_by_device_async(device_name, resource_group_name, manager_name, filter = nil, custom_headers = nil)
73
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+
79
+
80
+ request_headers = {}
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
92
+ query_params: {'$filter' => filter},
93
+ skip_encoding_query_params: {'api-version' => @client.api_version},
94
+ headers: request_headers.merge(custom_headers || {}),
95
+ base_url: request_url
96
+ }
97
+ promise = @client.make_request_async(:get, path_template, options)
98
+
99
+ promise = promise.then do |result|
100
+ http_response = result.response
101
+ status_code = http_response.status
102
+ response_content = http_response.body
103
+ unless status_code == 200
104
+ error_model = JSON.load(response_content)
105
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
106
+ end
107
+
108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::JobList.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Gets the details of the specified job name.
128
+ #
129
+ # @param device_name [String] The device name
130
+ # @param job_name [String] The job Name.
131
+ # @param resource_group_name [String] The resource group name
132
+ # @param manager_name [String] The manager name
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [Job] operation results.
137
+ #
138
+ def get(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
139
+ response = get_async(device_name, job_name, resource_group_name, manager_name, custom_headers).value!
140
+ response.body unless response.nil?
141
+ end
142
+
143
+ #
144
+ # Gets the details of the specified job name.
145
+ #
146
+ # @param device_name [String] The device name
147
+ # @param job_name [String] The job Name.
148
+ # @param resource_group_name [String] The resource group name
149
+ # @param manager_name [String] The manager name
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def get_with_http_info(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
156
+ get_async(device_name, job_name, resource_group_name, manager_name, custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Gets the details of the specified job name.
161
+ #
162
+ # @param device_name [String] The device name
163
+ # @param job_name [String] The job Name.
164
+ # @param resource_group_name [String] The resource group name
165
+ # @param manager_name [String] The manager name
166
+ # @param [Hash{String => String}] A hash of custom headers that will be added
167
+ # to the HTTP request.
168
+ #
169
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
170
+ #
171
+ def get_async(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
172
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
173
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
174
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
175
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
176
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
177
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
178
+
179
+
180
+ request_headers = {}
181
+
182
+ # Set Headers
183
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
184
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
185
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
+ options = {
190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
+ skip_encoding_path_params: {'deviceName' => device_name,'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
192
+ skip_encoding_query_params: {'api-version' => @client.api_version},
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
+ }
196
+ promise = @client.make_request_async(:get, path_template, options)
197
+
198
+ promise = promise.then do |result|
199
+ http_response = result.response
200
+ status_code = http_response.status
201
+ response_content = http_response.body
202
+ unless status_code == 200
203
+ error_model = JSON.load(response_content)
204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
205
+ end
206
+
207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
+ # Deserialize Response
209
+ if status_code == 200
210
+ begin
211
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
212
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::Job.mapper()
213
+ result.body = @client.deserialize(result_mapper, parsed_response)
214
+ rescue Exception => e
215
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
216
+ end
217
+ end
218
+
219
+ result
220
+ end
221
+
222
+ promise.execute
223
+ end
224
+
225
+ #
226
+ # Cancels a job on the device.
227
+ #
228
+ # @param device_name [String] The device name
229
+ # @param job_name [String] The jobName.
230
+ # @param resource_group_name [String] The resource group name
231
+ # @param manager_name [String] The manager name
232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
233
+ # will be added to the HTTP request.
234
+ #
235
+ def cancel(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
236
+ response = cancel_async(device_name, job_name, resource_group_name, manager_name, custom_headers).value!
237
+ nil
238
+ end
239
+
240
+ #
241
+ # @param device_name [String] The device name
242
+ # @param job_name [String] The jobName.
243
+ # @param resource_group_name [String] The resource group name
244
+ # @param manager_name [String] The manager name
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [Concurrent::Promise] promise which provides async access to http
249
+ # response.
250
+ #
251
+ def cancel_async(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
252
+ # Send request
253
+ promise = begin_cancel_async(device_name, job_name, resource_group_name, manager_name, custom_headers)
254
+
255
+ promise = promise.then do |response|
256
+ # Defining deserialization method.
257
+ deserialize_method = lambda do |parsed_response|
258
+ end
259
+
260
+ # Waiting for response.
261
+ @client.get_long_running_operation_result(response, deserialize_method)
262
+ end
263
+
264
+ promise
265
+ end
266
+
267
+ #
268
+ # Gets all the jobs for the specified manager. With optional OData query
269
+ # parameters, a filtered set of jobs is returned.
270
+ #
271
+ # @param resource_group_name [String] The resource group name
272
+ # @param manager_name [String] The manager name
273
+ # @param filter [String] OData Filter options
274
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
275
+ # will be added to the HTTP request.
276
+ #
277
+ # @return [Array<Job>] operation results.
278
+ #
279
+ def list_by_manager(resource_group_name, manager_name, filter = nil, custom_headers = nil)
280
+ first_page = list_by_manager_as_lazy(resource_group_name, manager_name, filter, custom_headers)
281
+ first_page.get_all_items
282
+ end
283
+
284
+ #
285
+ # Gets all the jobs for the specified manager. With optional OData query
286
+ # parameters, a filtered set of jobs is returned.
287
+ #
288
+ # @param resource_group_name [String] The resource group name
289
+ # @param manager_name [String] The manager name
290
+ # @param filter [String] OData Filter options
291
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
+ # will be added to the HTTP request.
293
+ #
294
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
295
+ #
296
+ def list_by_manager_with_http_info(resource_group_name, manager_name, filter = nil, custom_headers = nil)
297
+ list_by_manager_async(resource_group_name, manager_name, filter, custom_headers).value!
298
+ end
299
+
300
+ #
301
+ # Gets all the jobs for the specified manager. With optional OData query
302
+ # parameters, a filtered set of jobs is returned.
303
+ #
304
+ # @param resource_group_name [String] The resource group name
305
+ # @param manager_name [String] The manager name
306
+ # @param filter [String] OData Filter options
307
+ # @param [Hash{String => String}] A hash of custom headers that will be added
308
+ # to the HTTP request.
309
+ #
310
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
311
+ #
312
+ def list_by_manager_async(resource_group_name, manager_name, filter = nil, custom_headers = nil)
313
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
314
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
315
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
316
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
317
+
318
+
319
+ request_headers = {}
320
+
321
+ # Set Headers
322
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
323
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
324
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs'
325
+
326
+ request_url = @base_url || @client.base_url
327
+
328
+ options = {
329
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
330
+ skip_encoding_path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
331
+ query_params: {'$filter' => filter},
332
+ skip_encoding_query_params: {'api-version' => @client.api_version},
333
+ headers: request_headers.merge(custom_headers || {}),
334
+ base_url: request_url
335
+ }
336
+ promise = @client.make_request_async(:get, path_template, options)
337
+
338
+ promise = promise.then do |result|
339
+ http_response = result.response
340
+ status_code = http_response.status
341
+ response_content = http_response.body
342
+ unless status_code == 200
343
+ error_model = JSON.load(response_content)
344
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
345
+ end
346
+
347
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
348
+ # Deserialize Response
349
+ if status_code == 200
350
+ begin
351
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
352
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::JobList.mapper()
353
+ result.body = @client.deserialize(result_mapper, parsed_response)
354
+ rescue Exception => e
355
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
356
+ end
357
+ end
358
+
359
+ result
360
+ end
361
+
362
+ promise.execute
363
+ end
364
+
365
+ #
366
+ # Cancels a job on the device.
367
+ #
368
+ # @param device_name [String] The device name
369
+ # @param job_name [String] The jobName.
370
+ # @param resource_group_name [String] The resource group name
371
+ # @param manager_name [String] The manager name
372
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
373
+ # will be added to the HTTP request.
374
+ #
375
+ #
376
+ def begin_cancel(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
377
+ response = begin_cancel_async(device_name, job_name, resource_group_name, manager_name, custom_headers).value!
378
+ nil
379
+ end
380
+
381
+ #
382
+ # Cancels a job on the device.
383
+ #
384
+ # @param device_name [String] The device name
385
+ # @param job_name [String] The jobName.
386
+ # @param resource_group_name [String] The resource group name
387
+ # @param manager_name [String] The manager name
388
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
389
+ # will be added to the HTTP request.
390
+ #
391
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
392
+ #
393
+ def begin_cancel_with_http_info(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
394
+ begin_cancel_async(device_name, job_name, resource_group_name, manager_name, custom_headers).value!
395
+ end
396
+
397
+ #
398
+ # Cancels a job on the device.
399
+ #
400
+ # @param device_name [String] The device name
401
+ # @param job_name [String] The jobName.
402
+ # @param resource_group_name [String] The resource group name
403
+ # @param manager_name [String] The manager name
404
+ # @param [Hash{String => String}] A hash of custom headers that will be added
405
+ # to the HTTP request.
406
+ #
407
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
408
+ #
409
+ def begin_cancel_async(device_name, job_name, resource_group_name, manager_name, custom_headers = nil)
410
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
411
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
412
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
413
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
414
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
415
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
416
+
417
+
418
+ request_headers = {}
419
+
420
+ # Set Headers
421
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
422
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
423
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}/cancel'
424
+
425
+ request_url = @base_url || @client.base_url
426
+
427
+ options = {
428
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
429
+ skip_encoding_path_params: {'deviceName' => device_name,'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
430
+ skip_encoding_query_params: {'api-version' => @client.api_version},
431
+ headers: request_headers.merge(custom_headers || {}),
432
+ base_url: request_url
433
+ }
434
+ promise = @client.make_request_async(:post, path_template, options)
435
+
436
+ promise = promise.then do |result|
437
+ http_response = result.response
438
+ status_code = http_response.status
439
+ response_content = http_response.body
440
+ unless status_code == 202 || status_code == 204
441
+ error_model = JSON.load(response_content)
442
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
443
+ end
444
+
445
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
446
+
447
+ result
448
+ end
449
+
450
+ promise.execute
451
+ end
452
+
453
+ #
454
+ # Gets all the jobs for specified device. With optional OData query parameters,
455
+ # a filtered set of jobs is returned.
456
+ #
457
+ # @param next_page_link [String] The NextLink from the previous successful call
458
+ # to List operation.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [JobList] operation results.
463
+ #
464
+ def list_by_device_next(next_page_link, custom_headers = nil)
465
+ response = list_by_device_next_async(next_page_link, custom_headers).value!
466
+ response.body unless response.nil?
467
+ end
468
+
469
+ #
470
+ # Gets all the jobs for specified device. With optional OData query parameters,
471
+ # a filtered set of jobs is returned.
472
+ #
473
+ # @param next_page_link [String] The NextLink from the previous successful call
474
+ # to List operation.
475
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
476
+ # will be added to the HTTP request.
477
+ #
478
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
479
+ #
480
+ def list_by_device_next_with_http_info(next_page_link, custom_headers = nil)
481
+ list_by_device_next_async(next_page_link, custom_headers).value!
482
+ end
483
+
484
+ #
485
+ # Gets all the jobs for specified device. With optional OData query parameters,
486
+ # a filtered set of jobs is returned.
487
+ #
488
+ # @param next_page_link [String] The NextLink from the previous successful call
489
+ # to List operation.
490
+ # @param [Hash{String => String}] A hash of custom headers that will be added
491
+ # to the HTTP request.
492
+ #
493
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
494
+ #
495
+ def list_by_device_next_async(next_page_link, custom_headers = nil)
496
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
497
+
498
+
499
+ request_headers = {}
500
+
501
+ # Set Headers
502
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
503
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
504
+ path_template = '{nextLink}'
505
+
506
+ request_url = @base_url || @client.base_url
507
+
508
+ options = {
509
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
510
+ skip_encoding_path_params: {'nextLink' => next_page_link},
511
+ headers: request_headers.merge(custom_headers || {}),
512
+ base_url: request_url
513
+ }
514
+ promise = @client.make_request_async(:get, path_template, options)
515
+
516
+ promise = promise.then do |result|
517
+ http_response = result.response
518
+ status_code = http_response.status
519
+ response_content = http_response.body
520
+ unless status_code == 200
521
+ error_model = JSON.load(response_content)
522
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
523
+ end
524
+
525
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
526
+ # Deserialize Response
527
+ if status_code == 200
528
+ begin
529
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
530
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::JobList.mapper()
531
+ result.body = @client.deserialize(result_mapper, parsed_response)
532
+ rescue Exception => e
533
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
534
+ end
535
+ end
536
+
537
+ result
538
+ end
539
+
540
+ promise.execute
541
+ end
542
+
543
+ #
544
+ # Gets all the jobs for the specified manager. With optional OData query
545
+ # parameters, a filtered set of jobs is returned.
546
+ #
547
+ # @param next_page_link [String] The NextLink from the previous successful call
548
+ # to List operation.
549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
550
+ # will be added to the HTTP request.
551
+ #
552
+ # @return [JobList] operation results.
553
+ #
554
+ def list_by_manager_next(next_page_link, custom_headers = nil)
555
+ response = list_by_manager_next_async(next_page_link, custom_headers).value!
556
+ response.body unless response.nil?
557
+ end
558
+
559
+ #
560
+ # Gets all the jobs for the specified manager. With optional OData query
561
+ # parameters, a filtered set of jobs is returned.
562
+ #
563
+ # @param next_page_link [String] The NextLink from the previous successful call
564
+ # to List operation.
565
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
566
+ # will be added to the HTTP request.
567
+ #
568
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
569
+ #
570
+ def list_by_manager_next_with_http_info(next_page_link, custom_headers = nil)
571
+ list_by_manager_next_async(next_page_link, custom_headers).value!
572
+ end
573
+
574
+ #
575
+ # Gets all the jobs for the specified manager. With optional OData query
576
+ # parameters, a filtered set of jobs is returned.
577
+ #
578
+ # @param next_page_link [String] The NextLink from the previous successful call
579
+ # to List operation.
580
+ # @param [Hash{String => String}] A hash of custom headers that will be added
581
+ # to the HTTP request.
582
+ #
583
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
584
+ #
585
+ def list_by_manager_next_async(next_page_link, custom_headers = nil)
586
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
587
+
588
+
589
+ request_headers = {}
590
+
591
+ # Set Headers
592
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
593
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
594
+ path_template = '{nextLink}'
595
+
596
+ request_url = @base_url || @client.base_url
597
+
598
+ options = {
599
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
600
+ skip_encoding_path_params: {'nextLink' => next_page_link},
601
+ headers: request_headers.merge(custom_headers || {}),
602
+ base_url: request_url
603
+ }
604
+ promise = @client.make_request_async(:get, path_template, options)
605
+
606
+ promise = promise.then do |result|
607
+ http_response = result.response
608
+ status_code = http_response.status
609
+ response_content = http_response.body
610
+ unless status_code == 200
611
+ error_model = JSON.load(response_content)
612
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
613
+ end
614
+
615
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
616
+ # Deserialize Response
617
+ if status_code == 200
618
+ begin
619
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
620
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::JobList.mapper()
621
+ result.body = @client.deserialize(result_mapper, parsed_response)
622
+ rescue Exception => e
623
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
624
+ end
625
+ end
626
+
627
+ result
628
+ end
629
+
630
+ promise.execute
631
+ end
632
+
633
+ #
634
+ # Gets all the jobs for specified device. With optional OData query parameters,
635
+ # a filtered set of jobs is returned.
636
+ #
637
+ # @param device_name [String] The device name
638
+ # @param resource_group_name [String] The resource group name
639
+ # @param manager_name [String] The manager name
640
+ # @param filter [String] OData Filter options
641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
+ # will be added to the HTTP request.
643
+ #
644
+ # @return [JobList] which provide lazy access to pages of the response.
645
+ #
646
+ def list_by_device_as_lazy(device_name, resource_group_name, manager_name, filter = nil, custom_headers = nil)
647
+ response = list_by_device_async(device_name, resource_group_name, manager_name, filter, custom_headers).value!
648
+ unless response.nil?
649
+ page = response.body
650
+ page.next_method = Proc.new do |next_page_link|
651
+ list_by_device_next_async(next_page_link, custom_headers)
652
+ end
653
+ page
654
+ end
655
+ end
656
+
657
+ #
658
+ # Gets all the jobs for the specified manager. With optional OData query
659
+ # parameters, a filtered set of jobs is returned.
660
+ #
661
+ # @param resource_group_name [String] The resource group name
662
+ # @param manager_name [String] The manager name
663
+ # @param filter [String] OData Filter options
664
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
665
+ # will be added to the HTTP request.
666
+ #
667
+ # @return [JobList] which provide lazy access to pages of the response.
668
+ #
669
+ def list_by_manager_as_lazy(resource_group_name, manager_name, filter = nil, custom_headers = nil)
670
+ response = list_by_manager_async(resource_group_name, manager_name, filter, custom_headers).value!
671
+ unless response.nil?
672
+ page = response.body
673
+ page.next_method = Proc.new do |next_page_link|
674
+ list_by_manager_next_async(next_page_link, custom_headers)
675
+ end
676
+ page
677
+ end
678
+ end
679
+
680
+ end
681
+ end