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,1724 @@
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
+ # Devices
9
+ #
10
+ class Devices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Devices 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
+ # Complete minimal setup before using the device.
26
+ #
27
+ # @param parameters [ConfigureDeviceRequest] The minimal properties to
28
+ # configure a device.
29
+ # @param resource_group_name [String] The resource group name
30
+ # @param manager_name [String] The manager name
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ def configure(parameters, resource_group_name, manager_name, custom_headers = nil)
35
+ response = configure_async(parameters, resource_group_name, manager_name, custom_headers).value!
36
+ nil
37
+ end
38
+
39
+ #
40
+ # @param parameters [ConfigureDeviceRequest] The minimal properties to
41
+ # configure a device.
42
+ # @param resource_group_name [String] The resource group name
43
+ # @param manager_name [String] The manager name
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [Concurrent::Promise] promise which provides async access to http
48
+ # response.
49
+ #
50
+ def configure_async(parameters, resource_group_name, manager_name, custom_headers = nil)
51
+ # Send request
52
+ promise = begin_configure_async(parameters, resource_group_name, manager_name, custom_headers)
53
+
54
+ promise = promise.then do |response|
55
+ # Defining deserialization method.
56
+ deserialize_method = lambda do |parsed_response|
57
+ end
58
+
59
+ # Waiting for response.
60
+ @client.get_long_running_operation_result(response, deserialize_method)
61
+ end
62
+
63
+ promise
64
+ end
65
+
66
+ #
67
+ # Returns the list of devices for the specified manager.
68
+ #
69
+ # @param resource_group_name [String] The resource group name
70
+ # @param manager_name [String] The manager name
71
+ # @param expand [String] Specify $expand=details to populate additional fields
72
+ # related to the device or $expand=rolloverdetails to populate additional
73
+ # fields related to the service data encryption key rollover on device
74
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
75
+ # will be added to the HTTP request.
76
+ #
77
+ # @return [DeviceList] operation results.
78
+ #
79
+ def list_by_manager(resource_group_name, manager_name, expand = nil, custom_headers = nil)
80
+ response = list_by_manager_async(resource_group_name, manager_name, expand, custom_headers).value!
81
+ response.body unless response.nil?
82
+ end
83
+
84
+ #
85
+ # Returns the list of devices for the specified manager.
86
+ #
87
+ # @param resource_group_name [String] The resource group name
88
+ # @param manager_name [String] The manager name
89
+ # @param expand [String] Specify $expand=details to populate additional fields
90
+ # related to the device or $expand=rolloverdetails to populate additional
91
+ # fields related to the service data encryption key rollover on device
92
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
93
+ # will be added to the HTTP request.
94
+ #
95
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
96
+ #
97
+ def list_by_manager_with_http_info(resource_group_name, manager_name, expand = nil, custom_headers = nil)
98
+ list_by_manager_async(resource_group_name, manager_name, expand, custom_headers).value!
99
+ end
100
+
101
+ #
102
+ # Returns the list of devices for the specified manager.
103
+ #
104
+ # @param resource_group_name [String] The resource group name
105
+ # @param manager_name [String] The manager name
106
+ # @param expand [String] Specify $expand=details to populate additional fields
107
+ # related to the device or $expand=rolloverdetails to populate additional
108
+ # fields related to the service data encryption key rollover on device
109
+ # @param [Hash{String => String}] A hash of custom headers that will be added
110
+ # to the HTTP request.
111
+ #
112
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
113
+ #
114
+ def list_by_manager_async(resource_group_name, manager_name, expand = nil, custom_headers = nil)
115
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
116
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
117
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
118
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
119
+
120
+
121
+ request_headers = {}
122
+
123
+ # Set Headers
124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
126
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices'
127
+
128
+ request_url = @base_url || @client.base_url
129
+
130
+ options = {
131
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
132
+ skip_encoding_path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
133
+ query_params: {'$expand' => expand},
134
+ skip_encoding_query_params: {'api-version' => @client.api_version},
135
+ headers: request_headers.merge(custom_headers || {}),
136
+ base_url: request_url
137
+ }
138
+ promise = @client.make_request_async(:get, path_template, options)
139
+
140
+ promise = promise.then do |result|
141
+ http_response = result.response
142
+ status_code = http_response.status
143
+ response_content = http_response.body
144
+ unless status_code == 200
145
+ error_model = JSON.load(response_content)
146
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
147
+ end
148
+
149
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
150
+ # Deserialize Response
151
+ if status_code == 200
152
+ begin
153
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
154
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::DeviceList.mapper()
155
+ result.body = @client.deserialize(result_mapper, parsed_response)
156
+ rescue Exception => e
157
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
158
+ end
159
+ end
160
+
161
+ result
162
+ end
163
+
164
+ promise.execute
165
+ end
166
+
167
+ #
168
+ # Returns the properties of the specified device.
169
+ #
170
+ # @param device_name [String] The device name
171
+ # @param resource_group_name [String] The resource group name
172
+ # @param manager_name [String] The manager name
173
+ # @param expand [String] Specify $expand=details to populate additional fields
174
+ # related to the device or $expand=rolloverdetails to populate additional
175
+ # fields related to the service data encryption key rollover on device
176
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
177
+ # will be added to the HTTP request.
178
+ #
179
+ # @return [Device] operation results.
180
+ #
181
+ def get(device_name, resource_group_name, manager_name, expand = nil, custom_headers = nil)
182
+ response = get_async(device_name, resource_group_name, manager_name, expand, custom_headers).value!
183
+ response.body unless response.nil?
184
+ end
185
+
186
+ #
187
+ # Returns the properties of the specified device.
188
+ #
189
+ # @param device_name [String] The device name
190
+ # @param resource_group_name [String] The resource group name
191
+ # @param manager_name [String] The manager name
192
+ # @param expand [String] Specify $expand=details to populate additional fields
193
+ # related to the device or $expand=rolloverdetails to populate additional
194
+ # fields related to the service data encryption key rollover on device
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
199
+ #
200
+ def get_with_http_info(device_name, resource_group_name, manager_name, expand = nil, custom_headers = nil)
201
+ get_async(device_name, resource_group_name, manager_name, expand, custom_headers).value!
202
+ end
203
+
204
+ #
205
+ # Returns the properties of the specified device.
206
+ #
207
+ # @param device_name [String] The device name
208
+ # @param resource_group_name [String] The resource group name
209
+ # @param manager_name [String] The manager name
210
+ # @param expand [String] Specify $expand=details to populate additional fields
211
+ # related to the device or $expand=rolloverdetails to populate additional
212
+ # fields related to the service data encryption key rollover on device
213
+ # @param [Hash{String => String}] A hash of custom headers that will be added
214
+ # to the HTTP request.
215
+ #
216
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
217
+ #
218
+ def get_async(device_name, resource_group_name, manager_name, expand = nil, custom_headers = nil)
219
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
220
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
221
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
222
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
223
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
224
+
225
+
226
+ request_headers = {}
227
+
228
+ # Set Headers
229
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
230
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
231
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'
232
+
233
+ request_url = @base_url || @client.base_url
234
+
235
+ options = {
236
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
237
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
238
+ query_params: {'$expand' => expand},
239
+ skip_encoding_query_params: {'api-version' => @client.api_version},
240
+ headers: request_headers.merge(custom_headers || {}),
241
+ base_url: request_url
242
+ }
243
+ promise = @client.make_request_async(:get, path_template, options)
244
+
245
+ promise = promise.then do |result|
246
+ http_response = result.response
247
+ status_code = http_response.status
248
+ response_content = http_response.body
249
+ unless status_code == 200
250
+ error_model = JSON.load(response_content)
251
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
252
+ end
253
+
254
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
255
+ # Deserialize Response
256
+ if status_code == 200
257
+ begin
258
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
259
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::Device.mapper()
260
+ result.body = @client.deserialize(result_mapper, parsed_response)
261
+ rescue Exception => e
262
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
263
+ end
264
+ end
265
+
266
+ result
267
+ end
268
+
269
+ promise.execute
270
+ end
271
+
272
+ #
273
+ # Deletes the device.
274
+ #
275
+ # @param device_name [String] The device name
276
+ # @param resource_group_name [String] The resource group name
277
+ # @param manager_name [String] The manager name
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ def delete(device_name, resource_group_name, manager_name, custom_headers = nil)
282
+ response = delete_async(device_name, resource_group_name, manager_name, custom_headers).value!
283
+ nil
284
+ end
285
+
286
+ #
287
+ # @param device_name [String] The device name
288
+ # @param resource_group_name [String] The resource group name
289
+ # @param manager_name [String] The manager name
290
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
291
+ # will be added to the HTTP request.
292
+ #
293
+ # @return [Concurrent::Promise] promise which provides async access to http
294
+ # response.
295
+ #
296
+ def delete_async(device_name, resource_group_name, manager_name, custom_headers = nil)
297
+ # Send request
298
+ promise = begin_delete_async(device_name, resource_group_name, manager_name, custom_headers)
299
+
300
+ promise = promise.then do |response|
301
+ # Defining deserialization method.
302
+ deserialize_method = lambda do |parsed_response|
303
+ end
304
+
305
+ # Waiting for response.
306
+ @client.get_long_running_operation_result(response, deserialize_method)
307
+ end
308
+
309
+ promise
310
+ end
311
+
312
+ #
313
+ # Patches the device.
314
+ #
315
+ # @param device_name [String] The device name
316
+ # @param parameters [DevicePatch] Patch representation of the device.
317
+ # @param resource_group_name [String] The resource group name
318
+ # @param manager_name [String] The manager name
319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
320
+ # will be added to the HTTP request.
321
+ #
322
+ # @return [Device] operation results.
323
+ #
324
+ def update(device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
325
+ response = update_async(device_name, parameters, resource_group_name, manager_name, custom_headers).value!
326
+ response.body unless response.nil?
327
+ end
328
+
329
+ #
330
+ # Patches the device.
331
+ #
332
+ # @param device_name [String] The device name
333
+ # @param parameters [DevicePatch] Patch representation of the device.
334
+ # @param resource_group_name [String] The resource group name
335
+ # @param manager_name [String] The manager name
336
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
337
+ # will be added to the HTTP request.
338
+ #
339
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
340
+ #
341
+ def update_with_http_info(device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
342
+ update_async(device_name, parameters, resource_group_name, manager_name, custom_headers).value!
343
+ end
344
+
345
+ #
346
+ # Patches the device.
347
+ #
348
+ # @param device_name [String] The device name
349
+ # @param parameters [DevicePatch] Patch representation of the device.
350
+ # @param resource_group_name [String] The resource group name
351
+ # @param manager_name [String] The manager name
352
+ # @param [Hash{String => String}] A hash of custom headers that will be added
353
+ # to the HTTP request.
354
+ #
355
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
356
+ #
357
+ def update_async(device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
358
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
359
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
360
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
361
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
362
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
363
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
364
+
365
+
366
+ request_headers = {}
367
+
368
+ # Set Headers
369
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
370
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
371
+
372
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
373
+
374
+ # Serialize Request
375
+ request_mapper = Azure::ARM::StorSimple8000Series::Models::DevicePatch.mapper()
376
+ request_content = @client.serialize(request_mapper, parameters)
377
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
378
+
379
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'
380
+
381
+ request_url = @base_url || @client.base_url
382
+
383
+ options = {
384
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
385
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
386
+ skip_encoding_query_params: {'api-version' => @client.api_version},
387
+ body: request_content,
388
+ headers: request_headers.merge(custom_headers || {}),
389
+ base_url: request_url
390
+ }
391
+ promise = @client.make_request_async(:patch, path_template, options)
392
+
393
+ promise = promise.then do |result|
394
+ http_response = result.response
395
+ status_code = http_response.status
396
+ response_content = http_response.body
397
+ unless status_code == 200
398
+ error_model = JSON.load(response_content)
399
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
400
+ end
401
+
402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
403
+ # Deserialize Response
404
+ if status_code == 200
405
+ begin
406
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
407
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::Device.mapper()
408
+ result.body = @client.deserialize(result_mapper, parsed_response)
409
+ rescue Exception => e
410
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
411
+ end
412
+ end
413
+
414
+ result
415
+ end
416
+
417
+ promise.execute
418
+ end
419
+
420
+ #
421
+ # Authorizes the specified device for service data encryption key rollover.
422
+ #
423
+ # @param device_name [String] The device name
424
+ # @param resource_group_name [String] The resource group name
425
+ # @param manager_name [String] The manager name
426
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
427
+ # will be added to the HTTP request.
428
+ #
429
+ #
430
+ def authorize_for_service_encryption_key_rollover(device_name, resource_group_name, manager_name, custom_headers = nil)
431
+ response = authorize_for_service_encryption_key_rollover_async(device_name, resource_group_name, manager_name, custom_headers).value!
432
+ nil
433
+ end
434
+
435
+ #
436
+ # Authorizes the specified device for service data encryption key rollover.
437
+ #
438
+ # @param device_name [String] The device name
439
+ # @param resource_group_name [String] The resource group name
440
+ # @param manager_name [String] The manager name
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
445
+ #
446
+ def authorize_for_service_encryption_key_rollover_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
447
+ authorize_for_service_encryption_key_rollover_async(device_name, resource_group_name, manager_name, custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Authorizes the specified device for service data encryption key rollover.
452
+ #
453
+ # @param device_name [String] The device name
454
+ # @param resource_group_name [String] The resource group name
455
+ # @param manager_name [String] The manager name
456
+ # @param [Hash{String => String}] A hash of custom headers that will be added
457
+ # to the HTTP request.
458
+ #
459
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
460
+ #
461
+ def authorize_for_service_encryption_key_rollover_async(device_name, resource_group_name, manager_name, custom_headers = nil)
462
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
463
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
464
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
465
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
466
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
467
+
468
+
469
+ request_headers = {}
470
+
471
+ # Set Headers
472
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
473
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
474
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/authorizeForServiceEncryptionKeyRollover'
475
+
476
+ request_url = @base_url || @client.base_url
477
+
478
+ options = {
479
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
480
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
481
+ skip_encoding_query_params: {'api-version' => @client.api_version},
482
+ headers: request_headers.merge(custom_headers || {}),
483
+ base_url: request_url
484
+ }
485
+ promise = @client.make_request_async(:post, path_template, options)
486
+
487
+ promise = promise.then do |result|
488
+ http_response = result.response
489
+ status_code = http_response.status
490
+ response_content = http_response.body
491
+ unless status_code == 204
492
+ error_model = JSON.load(response_content)
493
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
494
+ end
495
+
496
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
497
+
498
+ result
499
+ end
500
+
501
+ promise.execute
502
+ end
503
+
504
+ #
505
+ # Deactivates the device.
506
+ #
507
+ # @param device_name [String] The device name
508
+ # @param resource_group_name [String] The resource group name
509
+ # @param manager_name [String] The manager name
510
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
511
+ # will be added to the HTTP request.
512
+ #
513
+ def deactivate(device_name, resource_group_name, manager_name, custom_headers = nil)
514
+ response = deactivate_async(device_name, resource_group_name, manager_name, custom_headers).value!
515
+ nil
516
+ end
517
+
518
+ #
519
+ # @param device_name [String] The device name
520
+ # @param resource_group_name [String] The resource group name
521
+ # @param manager_name [String] The manager name
522
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
523
+ # will be added to the HTTP request.
524
+ #
525
+ # @return [Concurrent::Promise] promise which provides async access to http
526
+ # response.
527
+ #
528
+ def deactivate_async(device_name, resource_group_name, manager_name, custom_headers = nil)
529
+ # Send request
530
+ promise = begin_deactivate_async(device_name, resource_group_name, manager_name, custom_headers)
531
+
532
+ promise = promise.then do |response|
533
+ # Defining deserialization method.
534
+ deserialize_method = lambda do |parsed_response|
535
+ end
536
+
537
+ # Waiting for response.
538
+ @client.get_long_running_operation_result(response, deserialize_method)
539
+ end
540
+
541
+ promise
542
+ end
543
+
544
+ #
545
+ # Downloads and installs the updates on the device.
546
+ #
547
+ # @param device_name [String] The device name
548
+ # @param resource_group_name [String] The resource group name
549
+ # @param manager_name [String] The manager name
550
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
551
+ # will be added to the HTTP request.
552
+ #
553
+ def install_updates(device_name, resource_group_name, manager_name, custom_headers = nil)
554
+ response = install_updates_async(device_name, resource_group_name, manager_name, custom_headers).value!
555
+ nil
556
+ end
557
+
558
+ #
559
+ # @param device_name [String] The device name
560
+ # @param resource_group_name [String] The resource group name
561
+ # @param manager_name [String] The manager name
562
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
+ # will be added to the HTTP request.
564
+ #
565
+ # @return [Concurrent::Promise] promise which provides async access to http
566
+ # response.
567
+ #
568
+ def install_updates_async(device_name, resource_group_name, manager_name, custom_headers = nil)
569
+ # Send request
570
+ promise = begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers)
571
+
572
+ promise = promise.then do |response|
573
+ # Defining deserialization method.
574
+ deserialize_method = lambda do |parsed_response|
575
+ end
576
+
577
+ # Waiting for response.
578
+ @client.get_long_running_operation_result(response, deserialize_method)
579
+ end
580
+
581
+ promise
582
+ end
583
+
584
+ #
585
+ # Returns all failover sets for a given device and their eligibility for
586
+ # participating in a failover. A failover set refers to a set of volume
587
+ # containers that need to be failed-over as a single unit to maintain data
588
+ # integrity.
589
+ #
590
+ # @param device_name [String] The device name
591
+ # @param resource_group_name [String] The resource group name
592
+ # @param manager_name [String] The manager name
593
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
594
+ # will be added to the HTTP request.
595
+ #
596
+ # @return [FailoverSetsList] operation results.
597
+ #
598
+ def list_failover_sets(device_name, resource_group_name, manager_name, custom_headers = nil)
599
+ response = list_failover_sets_async(device_name, resource_group_name, manager_name, custom_headers).value!
600
+ response.body unless response.nil?
601
+ end
602
+
603
+ #
604
+ # Returns all failover sets for a given device and their eligibility for
605
+ # participating in a failover. A failover set refers to a set of volume
606
+ # containers that need to be failed-over as a single unit to maintain data
607
+ # integrity.
608
+ #
609
+ # @param device_name [String] The device name
610
+ # @param resource_group_name [String] The resource group name
611
+ # @param manager_name [String] The manager name
612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
613
+ # will be added to the HTTP request.
614
+ #
615
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
616
+ #
617
+ def list_failover_sets_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
618
+ list_failover_sets_async(device_name, resource_group_name, manager_name, custom_headers).value!
619
+ end
620
+
621
+ #
622
+ # Returns all failover sets for a given device and their eligibility for
623
+ # participating in a failover. A failover set refers to a set of volume
624
+ # containers that need to be failed-over as a single unit to maintain data
625
+ # integrity.
626
+ #
627
+ # @param device_name [String] The device name
628
+ # @param resource_group_name [String] The resource group name
629
+ # @param manager_name [String] The manager name
630
+ # @param [Hash{String => String}] A hash of custom headers that will be added
631
+ # to the HTTP request.
632
+ #
633
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
634
+ #
635
+ def list_failover_sets_async(device_name, resource_group_name, manager_name, custom_headers = nil)
636
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
637
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
638
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
639
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
640
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
641
+
642
+
643
+ request_headers = {}
644
+
645
+ # Set Headers
646
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
647
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
648
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/listFailoverSets'
649
+
650
+ request_url = @base_url || @client.base_url
651
+
652
+ options = {
653
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
654
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
655
+ skip_encoding_query_params: {'api-version' => @client.api_version},
656
+ headers: request_headers.merge(custom_headers || {}),
657
+ base_url: request_url
658
+ }
659
+ promise = @client.make_request_async(:post, path_template, options)
660
+
661
+ promise = promise.then do |result|
662
+ http_response = result.response
663
+ status_code = http_response.status
664
+ response_content = http_response.body
665
+ unless status_code == 200
666
+ error_model = JSON.load(response_content)
667
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
668
+ end
669
+
670
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
671
+ # Deserialize Response
672
+ if status_code == 200
673
+ begin
674
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
675
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::FailoverSetsList.mapper()
676
+ result.body = @client.deserialize(result_mapper, parsed_response)
677
+ rescue Exception => e
678
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
679
+ end
680
+ end
681
+
682
+ result
683
+ end
684
+
685
+ promise.execute
686
+ end
687
+
688
+ #
689
+ # Gets the metrics for the specified device.
690
+ #
691
+ # @param device_name [String] The device name
692
+ # @param resource_group_name [String] The resource group name
693
+ # @param manager_name [String] The manager name
694
+ # @param filter [String] OData Filter options
695
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
696
+ # will be added to the HTTP request.
697
+ #
698
+ # @return [MetricList] operation results.
699
+ #
700
+ def list_metrics(device_name, resource_group_name, manager_name, filter, custom_headers = nil)
701
+ response = list_metrics_async(device_name, resource_group_name, manager_name, filter, custom_headers).value!
702
+ response.body unless response.nil?
703
+ end
704
+
705
+ #
706
+ # Gets the metrics for the specified device.
707
+ #
708
+ # @param device_name [String] The device name
709
+ # @param resource_group_name [String] The resource group name
710
+ # @param manager_name [String] The manager name
711
+ # @param filter [String] OData Filter options
712
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
713
+ # will be added to the HTTP request.
714
+ #
715
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
716
+ #
717
+ def list_metrics_with_http_info(device_name, resource_group_name, manager_name, filter, custom_headers = nil)
718
+ list_metrics_async(device_name, resource_group_name, manager_name, filter, custom_headers).value!
719
+ end
720
+
721
+ #
722
+ # Gets the metrics for the specified device.
723
+ #
724
+ # @param device_name [String] The device name
725
+ # @param resource_group_name [String] The resource group name
726
+ # @param manager_name [String] The manager name
727
+ # @param filter [String] OData Filter options
728
+ # @param [Hash{String => String}] A hash of custom headers that will be added
729
+ # to the HTTP request.
730
+ #
731
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
732
+ #
733
+ def list_metrics_async(device_name, resource_group_name, manager_name, filter, custom_headers = nil)
734
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
735
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
736
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
737
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
738
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
739
+ fail ArgumentError, 'filter is nil' if filter.nil?
740
+
741
+
742
+ request_headers = {}
743
+
744
+ # Set Headers
745
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
746
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
747
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics'
748
+
749
+ request_url = @base_url || @client.base_url
750
+
751
+ options = {
752
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
753
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
754
+ query_params: {'$filter' => filter},
755
+ skip_encoding_query_params: {'api-version' => @client.api_version},
756
+ headers: request_headers.merge(custom_headers || {}),
757
+ base_url: request_url
758
+ }
759
+ promise = @client.make_request_async(:get, path_template, options)
760
+
761
+ promise = promise.then do |result|
762
+ http_response = result.response
763
+ status_code = http_response.status
764
+ response_content = http_response.body
765
+ unless status_code == 200
766
+ error_model = JSON.load(response_content)
767
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
768
+ end
769
+
770
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
771
+ # Deserialize Response
772
+ if status_code == 200
773
+ begin
774
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
775
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::MetricList.mapper()
776
+ result.body = @client.deserialize(result_mapper, parsed_response)
777
+ rescue Exception => e
778
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
779
+ end
780
+ end
781
+
782
+ result
783
+ end
784
+
785
+ promise.execute
786
+ end
787
+
788
+ #
789
+ # Gets the metric definitions for the specified device.
790
+ #
791
+ # @param device_name [String] The device name
792
+ # @param resource_group_name [String] The resource group name
793
+ # @param manager_name [String] The manager name
794
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
795
+ # will be added to the HTTP request.
796
+ #
797
+ # @return [MetricDefinitionList] operation results.
798
+ #
799
+ def list_metric_definition(device_name, resource_group_name, manager_name, custom_headers = nil)
800
+ response = list_metric_definition_async(device_name, resource_group_name, manager_name, custom_headers).value!
801
+ response.body unless response.nil?
802
+ end
803
+
804
+ #
805
+ # Gets the metric definitions for the specified device.
806
+ #
807
+ # @param device_name [String] The device name
808
+ # @param resource_group_name [String] The resource group name
809
+ # @param manager_name [String] The manager name
810
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
811
+ # will be added to the HTTP request.
812
+ #
813
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
814
+ #
815
+ def list_metric_definition_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
816
+ list_metric_definition_async(device_name, resource_group_name, manager_name, custom_headers).value!
817
+ end
818
+
819
+ #
820
+ # Gets the metric definitions for the specified device.
821
+ #
822
+ # @param device_name [String] The device name
823
+ # @param resource_group_name [String] The resource group name
824
+ # @param manager_name [String] The manager name
825
+ # @param [Hash{String => String}] A hash of custom headers that will be added
826
+ # to the HTTP request.
827
+ #
828
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
829
+ #
830
+ def list_metric_definition_async(device_name, resource_group_name, manager_name, custom_headers = nil)
831
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
832
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
833
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
834
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
835
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
836
+
837
+
838
+ request_headers = {}
839
+
840
+ # Set Headers
841
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
842
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
843
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions'
844
+
845
+ request_url = @base_url || @client.base_url
846
+
847
+ options = {
848
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
849
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
850
+ skip_encoding_query_params: {'api-version' => @client.api_version},
851
+ headers: request_headers.merge(custom_headers || {}),
852
+ base_url: request_url
853
+ }
854
+ promise = @client.make_request_async(:get, path_template, options)
855
+
856
+ promise = promise.then do |result|
857
+ http_response = result.response
858
+ status_code = http_response.status
859
+ response_content = http_response.body
860
+ unless status_code == 200
861
+ error_model = JSON.load(response_content)
862
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
863
+ end
864
+
865
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
866
+ # Deserialize Response
867
+ if status_code == 200
868
+ begin
869
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
870
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::MetricDefinitionList.mapper()
871
+ result.body = @client.deserialize(result_mapper, parsed_response)
872
+ rescue Exception => e
873
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
874
+ end
875
+ end
876
+
877
+ result
878
+ end
879
+
880
+ promise.execute
881
+ end
882
+
883
+ #
884
+ # Scans for updates on the device.
885
+ #
886
+ # @param device_name [String] The device name
887
+ # @param resource_group_name [String] The resource group name
888
+ # @param manager_name [String] The manager name
889
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
890
+ # will be added to the HTTP request.
891
+ #
892
+ def scan_for_updates(device_name, resource_group_name, manager_name, custom_headers = nil)
893
+ response = scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers).value!
894
+ nil
895
+ end
896
+
897
+ #
898
+ # @param device_name [String] The device name
899
+ # @param resource_group_name [String] The resource group name
900
+ # @param manager_name [String] The manager name
901
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
902
+ # will be added to the HTTP request.
903
+ #
904
+ # @return [Concurrent::Promise] promise which provides async access to http
905
+ # response.
906
+ #
907
+ def scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers = nil)
908
+ # Send request
909
+ promise = begin_scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers)
910
+
911
+ promise = promise.then do |response|
912
+ # Defining deserialization method.
913
+ deserialize_method = lambda do |parsed_response|
914
+ end
915
+
916
+ # Waiting for response.
917
+ @client.get_long_running_operation_result(response, deserialize_method)
918
+ end
919
+
920
+ promise
921
+ end
922
+
923
+ #
924
+ # Returns the update summary of the specified device name.
925
+ #
926
+ # @param device_name [String] The device name
927
+ # @param resource_group_name [String] The resource group name
928
+ # @param manager_name [String] The manager name
929
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
930
+ # will be added to the HTTP request.
931
+ #
932
+ # @return [Updates] operation results.
933
+ #
934
+ def get_update_summary(device_name, resource_group_name, manager_name, custom_headers = nil)
935
+ response = get_update_summary_async(device_name, resource_group_name, manager_name, custom_headers).value!
936
+ response.body unless response.nil?
937
+ end
938
+
939
+ #
940
+ # Returns the update summary of the specified device name.
941
+ #
942
+ # @param device_name [String] The device name
943
+ # @param resource_group_name [String] The resource group name
944
+ # @param manager_name [String] The manager name
945
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
946
+ # will be added to the HTTP request.
947
+ #
948
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
949
+ #
950
+ def get_update_summary_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
951
+ get_update_summary_async(device_name, resource_group_name, manager_name, custom_headers).value!
952
+ end
953
+
954
+ #
955
+ # Returns the update summary of the specified device name.
956
+ #
957
+ # @param device_name [String] The device name
958
+ # @param resource_group_name [String] The resource group name
959
+ # @param manager_name [String] The manager name
960
+ # @param [Hash{String => String}] A hash of custom headers that will be added
961
+ # to the HTTP request.
962
+ #
963
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
964
+ #
965
+ def get_update_summary_async(device_name, resource_group_name, manager_name, custom_headers = nil)
966
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
967
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
968
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
969
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
970
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
971
+
972
+
973
+ request_headers = {}
974
+
975
+ # Set Headers
976
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
977
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
978
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default'
979
+
980
+ request_url = @base_url || @client.base_url
981
+
982
+ options = {
983
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
984
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
985
+ skip_encoding_query_params: {'api-version' => @client.api_version},
986
+ headers: request_headers.merge(custom_headers || {}),
987
+ base_url: request_url
988
+ }
989
+ promise = @client.make_request_async(:get, path_template, options)
990
+
991
+ promise = promise.then do |result|
992
+ http_response = result.response
993
+ status_code = http_response.status
994
+ response_content = http_response.body
995
+ unless status_code == 200
996
+ error_model = JSON.load(response_content)
997
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
998
+ end
999
+
1000
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1001
+ # Deserialize Response
1002
+ if status_code == 200
1003
+ begin
1004
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1005
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::Updates.mapper()
1006
+ result.body = @client.deserialize(result_mapper, parsed_response)
1007
+ rescue Exception => e
1008
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1009
+ end
1010
+ end
1011
+
1012
+ result
1013
+ end
1014
+
1015
+ promise.execute
1016
+ end
1017
+
1018
+ #
1019
+ # Failovers a set of volume containers from a specified source device to a
1020
+ # target device.
1021
+ #
1022
+ # @param source_device_name [String] The source device name on which failover
1023
+ # is performed.
1024
+ # @param parameters [FailoverRequest] FailoverRequest containing the source
1025
+ # device and the list of volume containers to be failed over.
1026
+ # @param resource_group_name [String] The resource group name
1027
+ # @param manager_name [String] The manager name
1028
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1029
+ # will be added to the HTTP request.
1030
+ #
1031
+ def failover(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1032
+ response = failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers).value!
1033
+ nil
1034
+ end
1035
+
1036
+ #
1037
+ # @param source_device_name [String] The source device name on which failover
1038
+ # is performed.
1039
+ # @param parameters [FailoverRequest] FailoverRequest containing the source
1040
+ # device and the list of volume containers to be failed over.
1041
+ # @param resource_group_name [String] The resource group name
1042
+ # @param manager_name [String] The manager name
1043
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1044
+ # will be added to the HTTP request.
1045
+ #
1046
+ # @return [Concurrent::Promise] promise which provides async access to http
1047
+ # response.
1048
+ #
1049
+ def failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1050
+ # Send request
1051
+ promise = begin_failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers)
1052
+
1053
+ promise = promise.then do |response|
1054
+ # Defining deserialization method.
1055
+ deserialize_method = lambda do |parsed_response|
1056
+ end
1057
+
1058
+ # Waiting for response.
1059
+ @client.get_long_running_operation_result(response, deserialize_method)
1060
+ end
1061
+
1062
+ promise
1063
+ end
1064
+
1065
+ #
1066
+ # Given a list of volume containers to be failed over from a source device,
1067
+ # this method returns the eligibility result, as a failover target, for all
1068
+ # devices under that resource.
1069
+ #
1070
+ # @param source_device_name [String] The source device name on which failover
1071
+ # is performed.
1072
+ # @param parameters [ListFailoverTargetsRequest] ListFailoverTargetsRequest
1073
+ # containing the list of volume containers to be failed over.
1074
+ # @param resource_group_name [String] The resource group name
1075
+ # @param manager_name [String] The manager name
1076
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1077
+ # will be added to the HTTP request.
1078
+ #
1079
+ # @return [FailoverTargetsList] operation results.
1080
+ #
1081
+ def list_failover_targets(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1082
+ response = list_failover_targets_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers).value!
1083
+ response.body unless response.nil?
1084
+ end
1085
+
1086
+ #
1087
+ # Given a list of volume containers to be failed over from a source device,
1088
+ # this method returns the eligibility result, as a failover target, for all
1089
+ # devices under that resource.
1090
+ #
1091
+ # @param source_device_name [String] The source device name on which failover
1092
+ # is performed.
1093
+ # @param parameters [ListFailoverTargetsRequest] ListFailoverTargetsRequest
1094
+ # containing the list of volume containers to be failed over.
1095
+ # @param resource_group_name [String] The resource group name
1096
+ # @param manager_name [String] The manager name
1097
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1098
+ # will be added to the HTTP request.
1099
+ #
1100
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1101
+ #
1102
+ def list_failover_targets_with_http_info(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1103
+ list_failover_targets_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers).value!
1104
+ end
1105
+
1106
+ #
1107
+ # Given a list of volume containers to be failed over from a source device,
1108
+ # this method returns the eligibility result, as a failover target, for all
1109
+ # devices under that resource.
1110
+ #
1111
+ # @param source_device_name [String] The source device name on which failover
1112
+ # is performed.
1113
+ # @param parameters [ListFailoverTargetsRequest] ListFailoverTargetsRequest
1114
+ # containing the list of volume containers to be failed over.
1115
+ # @param resource_group_name [String] The resource group name
1116
+ # @param manager_name [String] The manager name
1117
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1118
+ # to the HTTP request.
1119
+ #
1120
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1121
+ #
1122
+ def list_failover_targets_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1123
+ fail ArgumentError, 'source_device_name is nil' if source_device_name.nil?
1124
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1125
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1126
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1127
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1128
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1129
+
1130
+
1131
+ request_headers = {}
1132
+
1133
+ # Set Headers
1134
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1135
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1136
+
1137
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1138
+
1139
+ # Serialize Request
1140
+ request_mapper = Azure::ARM::StorSimple8000Series::Models::ListFailoverTargetsRequest.mapper()
1141
+ request_content = @client.serialize(request_mapper, parameters)
1142
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1143
+
1144
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{sourceDeviceName}/listFailoverTargets'
1145
+
1146
+ request_url = @base_url || @client.base_url
1147
+
1148
+ options = {
1149
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1150
+ skip_encoding_path_params: {'sourceDeviceName' => source_device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1151
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1152
+ body: request_content,
1153
+ headers: request_headers.merge(custom_headers || {}),
1154
+ base_url: request_url
1155
+ }
1156
+ promise = @client.make_request_async(:post, path_template, options)
1157
+
1158
+ promise = promise.then do |result|
1159
+ http_response = result.response
1160
+ status_code = http_response.status
1161
+ response_content = http_response.body
1162
+ unless status_code == 200
1163
+ error_model = JSON.load(response_content)
1164
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1165
+ end
1166
+
1167
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1168
+ # Deserialize Response
1169
+ if status_code == 200
1170
+ begin
1171
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1172
+ result_mapper = Azure::ARM::StorSimple8000Series::Models::FailoverTargetsList.mapper()
1173
+ result.body = @client.deserialize(result_mapper, parsed_response)
1174
+ rescue Exception => e
1175
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1176
+ end
1177
+ end
1178
+
1179
+ result
1180
+ end
1181
+
1182
+ promise.execute
1183
+ end
1184
+
1185
+ #
1186
+ # Complete minimal setup before using the device.
1187
+ #
1188
+ # @param parameters [ConfigureDeviceRequest] The minimal properties to
1189
+ # configure a device.
1190
+ # @param resource_group_name [String] The resource group name
1191
+ # @param manager_name [String] The manager name
1192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1193
+ # will be added to the HTTP request.
1194
+ #
1195
+ #
1196
+ def begin_configure(parameters, resource_group_name, manager_name, custom_headers = nil)
1197
+ response = begin_configure_async(parameters, resource_group_name, manager_name, custom_headers).value!
1198
+ nil
1199
+ end
1200
+
1201
+ #
1202
+ # Complete minimal setup before using the device.
1203
+ #
1204
+ # @param parameters [ConfigureDeviceRequest] The minimal properties to
1205
+ # configure a device.
1206
+ # @param resource_group_name [String] The resource group name
1207
+ # @param manager_name [String] The manager name
1208
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1209
+ # will be added to the HTTP request.
1210
+ #
1211
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1212
+ #
1213
+ def begin_configure_with_http_info(parameters, resource_group_name, manager_name, custom_headers = nil)
1214
+ begin_configure_async(parameters, resource_group_name, manager_name, custom_headers).value!
1215
+ end
1216
+
1217
+ #
1218
+ # Complete minimal setup before using the device.
1219
+ #
1220
+ # @param parameters [ConfigureDeviceRequest] The minimal properties to
1221
+ # configure a device.
1222
+ # @param resource_group_name [String] The resource group name
1223
+ # @param manager_name [String] The manager name
1224
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1225
+ # to the HTTP request.
1226
+ #
1227
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1228
+ #
1229
+ def begin_configure_async(parameters, resource_group_name, manager_name, custom_headers = nil)
1230
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1231
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1232
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1233
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1234
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1235
+
1236
+
1237
+ request_headers = {}
1238
+
1239
+ # Set Headers
1240
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1241
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1242
+
1243
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1244
+
1245
+ # Serialize Request
1246
+ request_mapper = Azure::ARM::StorSimple8000Series::Models::ConfigureDeviceRequest.mapper()
1247
+ request_content = @client.serialize(request_mapper, parameters)
1248
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1249
+
1250
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/configureDevice'
1251
+
1252
+ request_url = @base_url || @client.base_url
1253
+
1254
+ options = {
1255
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1256
+ skip_encoding_path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1257
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1258
+ body: request_content,
1259
+ headers: request_headers.merge(custom_headers || {}),
1260
+ base_url: request_url
1261
+ }
1262
+ promise = @client.make_request_async(:post, path_template, options)
1263
+
1264
+ promise = promise.then do |result|
1265
+ http_response = result.response
1266
+ status_code = http_response.status
1267
+ response_content = http_response.body
1268
+ unless status_code == 202 || status_code == 204
1269
+ error_model = JSON.load(response_content)
1270
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1271
+ end
1272
+
1273
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1274
+
1275
+ result
1276
+ end
1277
+
1278
+ promise.execute
1279
+ end
1280
+
1281
+ #
1282
+ # Deletes the device.
1283
+ #
1284
+ # @param device_name [String] The device name
1285
+ # @param resource_group_name [String] The resource group name
1286
+ # @param manager_name [String] The manager name
1287
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1288
+ # will be added to the HTTP request.
1289
+ #
1290
+ #
1291
+ def begin_delete(device_name, resource_group_name, manager_name, custom_headers = nil)
1292
+ response = begin_delete_async(device_name, resource_group_name, manager_name, custom_headers).value!
1293
+ nil
1294
+ end
1295
+
1296
+ #
1297
+ # Deletes the device.
1298
+ #
1299
+ # @param device_name [String] The device name
1300
+ # @param resource_group_name [String] The resource group name
1301
+ # @param manager_name [String] The manager name
1302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1303
+ # will be added to the HTTP request.
1304
+ #
1305
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1306
+ #
1307
+ def begin_delete_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
1308
+ begin_delete_async(device_name, resource_group_name, manager_name, custom_headers).value!
1309
+ end
1310
+
1311
+ #
1312
+ # Deletes the device.
1313
+ #
1314
+ # @param device_name [String] The device name
1315
+ # @param resource_group_name [String] The resource group name
1316
+ # @param manager_name [String] The manager name
1317
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1318
+ # to the HTTP request.
1319
+ #
1320
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1321
+ #
1322
+ def begin_delete_async(device_name, resource_group_name, manager_name, custom_headers = nil)
1323
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1324
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1325
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1326
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1327
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1328
+
1329
+
1330
+ request_headers = {}
1331
+
1332
+ # Set Headers
1333
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1334
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1335
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'
1336
+
1337
+ request_url = @base_url || @client.base_url
1338
+
1339
+ options = {
1340
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1341
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1342
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1343
+ headers: request_headers.merge(custom_headers || {}),
1344
+ base_url: request_url
1345
+ }
1346
+ promise = @client.make_request_async(:delete, path_template, options)
1347
+
1348
+ promise = promise.then do |result|
1349
+ http_response = result.response
1350
+ status_code = http_response.status
1351
+ response_content = http_response.body
1352
+ unless status_code == 202 || status_code == 204
1353
+ error_model = JSON.load(response_content)
1354
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1355
+ end
1356
+
1357
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1358
+
1359
+ result
1360
+ end
1361
+
1362
+ promise.execute
1363
+ end
1364
+
1365
+ #
1366
+ # Deactivates the device.
1367
+ #
1368
+ # @param device_name [String] The device name
1369
+ # @param resource_group_name [String] The resource group name
1370
+ # @param manager_name [String] The manager name
1371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1372
+ # will be added to the HTTP request.
1373
+ #
1374
+ #
1375
+ def begin_deactivate(device_name, resource_group_name, manager_name, custom_headers = nil)
1376
+ response = begin_deactivate_async(device_name, resource_group_name, manager_name, custom_headers).value!
1377
+ nil
1378
+ end
1379
+
1380
+ #
1381
+ # Deactivates the device.
1382
+ #
1383
+ # @param device_name [String] The device name
1384
+ # @param resource_group_name [String] The resource group name
1385
+ # @param manager_name [String] The manager name
1386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1387
+ # will be added to the HTTP request.
1388
+ #
1389
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1390
+ #
1391
+ def begin_deactivate_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
1392
+ begin_deactivate_async(device_name, resource_group_name, manager_name, custom_headers).value!
1393
+ end
1394
+
1395
+ #
1396
+ # Deactivates the device.
1397
+ #
1398
+ # @param device_name [String] The device name
1399
+ # @param resource_group_name [String] The resource group name
1400
+ # @param manager_name [String] The manager name
1401
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1402
+ # to the HTTP request.
1403
+ #
1404
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1405
+ #
1406
+ def begin_deactivate_async(device_name, resource_group_name, manager_name, custom_headers = nil)
1407
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1408
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1409
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1410
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1411
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1412
+
1413
+
1414
+ request_headers = {}
1415
+
1416
+ # Set Headers
1417
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1418
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1419
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate'
1420
+
1421
+ request_url = @base_url || @client.base_url
1422
+
1423
+ options = {
1424
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1425
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1426
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1427
+ headers: request_headers.merge(custom_headers || {}),
1428
+ base_url: request_url
1429
+ }
1430
+ promise = @client.make_request_async(:post, path_template, options)
1431
+
1432
+ promise = promise.then do |result|
1433
+ http_response = result.response
1434
+ status_code = http_response.status
1435
+ response_content = http_response.body
1436
+ unless status_code == 202 || status_code == 204
1437
+ error_model = JSON.load(response_content)
1438
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1439
+ end
1440
+
1441
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1442
+
1443
+ result
1444
+ end
1445
+
1446
+ promise.execute
1447
+ end
1448
+
1449
+ #
1450
+ # Downloads and installs the updates on the device.
1451
+ #
1452
+ # @param device_name [String] The device name
1453
+ # @param resource_group_name [String] The resource group name
1454
+ # @param manager_name [String] The manager name
1455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1456
+ # will be added to the HTTP request.
1457
+ #
1458
+ #
1459
+ def begin_install_updates(device_name, resource_group_name, manager_name, custom_headers = nil)
1460
+ response = begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers).value!
1461
+ nil
1462
+ end
1463
+
1464
+ #
1465
+ # Downloads and installs the updates on the device.
1466
+ #
1467
+ # @param device_name [String] The device name
1468
+ # @param resource_group_name [String] The resource group name
1469
+ # @param manager_name [String] The manager name
1470
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1471
+ # will be added to the HTTP request.
1472
+ #
1473
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1474
+ #
1475
+ def begin_install_updates_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
1476
+ begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers).value!
1477
+ end
1478
+
1479
+ #
1480
+ # Downloads and installs the updates on the device.
1481
+ #
1482
+ # @param device_name [String] The device name
1483
+ # @param resource_group_name [String] The resource group name
1484
+ # @param manager_name [String] The manager name
1485
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1486
+ # to the HTTP request.
1487
+ #
1488
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1489
+ #
1490
+ def begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers = nil)
1491
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1492
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1493
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1494
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1495
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1496
+
1497
+
1498
+ request_headers = {}
1499
+
1500
+ # Set Headers
1501
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1502
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1503
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/installUpdates'
1504
+
1505
+ request_url = @base_url || @client.base_url
1506
+
1507
+ options = {
1508
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1509
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1510
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1511
+ headers: request_headers.merge(custom_headers || {}),
1512
+ base_url: request_url
1513
+ }
1514
+ promise = @client.make_request_async(:post, path_template, options)
1515
+
1516
+ promise = promise.then do |result|
1517
+ http_response = result.response
1518
+ status_code = http_response.status
1519
+ response_content = http_response.body
1520
+ unless status_code == 202 || status_code == 204
1521
+ error_model = JSON.load(response_content)
1522
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1523
+ end
1524
+
1525
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1526
+
1527
+ result
1528
+ end
1529
+
1530
+ promise.execute
1531
+ end
1532
+
1533
+ #
1534
+ # Scans for updates on the device.
1535
+ #
1536
+ # @param device_name [String] The device name
1537
+ # @param resource_group_name [String] The resource group name
1538
+ # @param manager_name [String] The manager name
1539
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1540
+ # will be added to the HTTP request.
1541
+ #
1542
+ #
1543
+ def begin_scan_for_updates(device_name, resource_group_name, manager_name, custom_headers = nil)
1544
+ response = begin_scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers).value!
1545
+ nil
1546
+ end
1547
+
1548
+ #
1549
+ # Scans for updates on the device.
1550
+ #
1551
+ # @param device_name [String] The device name
1552
+ # @param resource_group_name [String] The resource group name
1553
+ # @param manager_name [String] The manager name
1554
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1555
+ # will be added to the HTTP request.
1556
+ #
1557
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1558
+ #
1559
+ def begin_scan_for_updates_with_http_info(device_name, resource_group_name, manager_name, custom_headers = nil)
1560
+ begin_scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers).value!
1561
+ end
1562
+
1563
+ #
1564
+ # Scans for updates on the device.
1565
+ #
1566
+ # @param device_name [String] The device name
1567
+ # @param resource_group_name [String] The resource group name
1568
+ # @param manager_name [String] The manager name
1569
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1570
+ # to the HTTP request.
1571
+ #
1572
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1573
+ #
1574
+ def begin_scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers = nil)
1575
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1576
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1577
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1578
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1579
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1580
+
1581
+
1582
+ request_headers = {}
1583
+
1584
+ # Set Headers
1585
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1586
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1587
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates'
1588
+
1589
+ request_url = @base_url || @client.base_url
1590
+
1591
+ options = {
1592
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1593
+ skip_encoding_path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1594
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1595
+ headers: request_headers.merge(custom_headers || {}),
1596
+ base_url: request_url
1597
+ }
1598
+ promise = @client.make_request_async(:post, path_template, options)
1599
+
1600
+ promise = promise.then do |result|
1601
+ http_response = result.response
1602
+ status_code = http_response.status
1603
+ response_content = http_response.body
1604
+ unless status_code == 202 || status_code == 204
1605
+ error_model = JSON.load(response_content)
1606
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1607
+ end
1608
+
1609
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1610
+
1611
+ result
1612
+ end
1613
+
1614
+ promise.execute
1615
+ end
1616
+
1617
+ #
1618
+ # Failovers a set of volume containers from a specified source device to a
1619
+ # target device.
1620
+ #
1621
+ # @param source_device_name [String] The source device name on which failover
1622
+ # is performed.
1623
+ # @param parameters [FailoverRequest] FailoverRequest containing the source
1624
+ # device and the list of volume containers to be failed over.
1625
+ # @param resource_group_name [String] The resource group name
1626
+ # @param manager_name [String] The manager name
1627
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1628
+ # will be added to the HTTP request.
1629
+ #
1630
+ #
1631
+ def begin_failover(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1632
+ response = begin_failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers).value!
1633
+ nil
1634
+ end
1635
+
1636
+ #
1637
+ # Failovers a set of volume containers from a specified source device to a
1638
+ # target device.
1639
+ #
1640
+ # @param source_device_name [String] The source device name on which failover
1641
+ # is performed.
1642
+ # @param parameters [FailoverRequest] FailoverRequest containing the source
1643
+ # device and the list of volume containers to be failed over.
1644
+ # @param resource_group_name [String] The resource group name
1645
+ # @param manager_name [String] The manager name
1646
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1647
+ # will be added to the HTTP request.
1648
+ #
1649
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1650
+ #
1651
+ def begin_failover_with_http_info(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1652
+ begin_failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers).value!
1653
+ end
1654
+
1655
+ #
1656
+ # Failovers a set of volume containers from a specified source device to a
1657
+ # target device.
1658
+ #
1659
+ # @param source_device_name [String] The source device name on which failover
1660
+ # is performed.
1661
+ # @param parameters [FailoverRequest] FailoverRequest containing the source
1662
+ # device and the list of volume containers to be failed over.
1663
+ # @param resource_group_name [String] The resource group name
1664
+ # @param manager_name [String] The manager name
1665
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1666
+ # to the HTTP request.
1667
+ #
1668
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1669
+ #
1670
+ def begin_failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers = nil)
1671
+ fail ArgumentError, 'source_device_name is nil' if source_device_name.nil?
1672
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1673
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1674
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1675
+ fail ArgumentError, 'manager_name is nil' if manager_name.nil?
1676
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1677
+
1678
+
1679
+ request_headers = {}
1680
+
1681
+ # Set Headers
1682
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1683
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1684
+
1685
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1686
+
1687
+ # Serialize Request
1688
+ request_mapper = Azure::ARM::StorSimple8000Series::Models::FailoverRequest.mapper()
1689
+ request_content = @client.serialize(request_mapper, parameters)
1690
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1691
+
1692
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{sourceDeviceName}/failover'
1693
+
1694
+ request_url = @base_url || @client.base_url
1695
+
1696
+ options = {
1697
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1698
+ skip_encoding_path_params: {'sourceDeviceName' => source_device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'managerName' => manager_name},
1699
+ skip_encoding_query_params: {'api-version' => @client.api_version},
1700
+ body: request_content,
1701
+ headers: request_headers.merge(custom_headers || {}),
1702
+ base_url: request_url
1703
+ }
1704
+ promise = @client.make_request_async(:post, path_template, options)
1705
+
1706
+ promise = promise.then do |result|
1707
+ http_response = result.response
1708
+ status_code = http_response.status
1709
+ response_content = http_response.body
1710
+ unless status_code == 202 || status_code == 204
1711
+ error_model = JSON.load(response_content)
1712
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1713
+ end
1714
+
1715
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1716
+
1717
+ result
1718
+ end
1719
+
1720
+ promise.execute
1721
+ end
1722
+
1723
+ end
1724
+ end