azure_mgmt_recovery_services_site_recovery 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (353) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_recovery_services_site_recovery.rb +7 -0
  4. data/lib/generated/azure_mgmt_recovery_services_site_recovery.rb +372 -0
  5. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aapply_recovery_point_input.rb +48 -0
  6. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2acontainer_creation_input.rb +48 -0
  7. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aenable_protection_input.rb +136 -0
  8. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aevent_details.rb +108 -0
  9. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2afailover_provider_input.rb +71 -0
  10. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2apolicy_creation_input.rb +92 -0
  11. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2apolicy_details.rb +100 -0
  12. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aprotected_disk_details.rb +168 -0
  13. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aprotected_managed_disk_details.rb +158 -0
  14. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2areplication_details.rb +373 -0
  15. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2areprotect_input.rb +117 -0
  16. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2arp_recovery_point_type.rb +18 -0
  17. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aswitch_protection_input.rb +136 -0
  18. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2aupdate_replication_protected_item_input.rb +68 -0
  19. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2avm_disk_input_details.rb +64 -0
  20. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/a2avm_managed_disk_input_details.rb +64 -0
  21. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/add_vcenter_request.rb +46 -0
  22. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/add_vcenter_request_properties.rb +86 -0
  23. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/alert.rb +76 -0
  24. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/alert_collection.rb +94 -0
  25. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/alert_properties.rb +72 -0
  26. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/alternate_location_recovery_option.rb +16 -0
  27. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/apply_recovery_point_input.rb +46 -0
  28. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/apply_recovery_point_input_properties.rb +58 -0
  29. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/apply_recovery_point_provider_specific_input.rb +47 -0
  30. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/armexception.rb +93 -0
  31. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/armexception_details.rb +104 -0
  32. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/arminner_error.rb +186 -0
  33. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/asr_job_details.rb +62 -0
  34. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/asrtask.rb +182 -0
  35. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/automation_runbook_task_details.rb +139 -0
  36. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_fabric_creation_input.rb +58 -0
  37. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_fabric_specific_details.rb +75 -0
  38. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_to_azure_create_network_mapping_input.rb +59 -0
  39. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_to_azure_network_mapping_settings.rb +68 -0
  40. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_to_azure_update_network_mapping_input.rb +58 -0
  41. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_to_azure_vm_synced_config_details.rb +87 -0
  42. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/azure_vm_disk_details.rb +104 -0
  43. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/configuration_settings.rb +47 -0
  44. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/configure_alert_request.rb +46 -0
  45. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/configure_alert_request_properties.rb +72 -0
  46. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/consistency_check_task_details.rb +68 -0
  47. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_network_mapping_input.rb +46 -0
  48. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_network_mapping_input_properties.rb +68 -0
  49. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_policy_input.rb +45 -0
  50. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_policy_input_properties.rb +47 -0
  51. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_protection_container_input.rb +46 -0
  52. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_protection_container_input_properties.rb +55 -0
  53. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_protection_container_mapping_input.rb +46 -0
  54. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_protection_container_mapping_input_properties.rb +67 -0
  55. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_recovery_plan_input.rb +46 -0
  56. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/create_recovery_plan_input_properties.rb +84 -0
  57. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/current_scenario_details.rb +64 -0
  58. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/data_store.rb +84 -0
  59. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/data_sync_status.rb +16 -0
  60. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/disable_protection_input.rb +46 -0
  61. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/disable_protection_input_properties.rb +61 -0
  62. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/disable_protection_provider_specific_input.rb +45 -0
  63. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/disable_protection_reason.rb +16 -0
  64. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/discover_protectable_item_request.rb +46 -0
  65. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/discover_protectable_item_request_properties.rb +65 -0
  66. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/disk_details.rb +74 -0
  67. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/disk_volume_details.rb +54 -0
  68. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/display.rb +100 -0
  69. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/enable_protection_input.rb +46 -0
  70. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/enable_protection_input_properties.rb +71 -0
  71. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/enable_protection_provider_specific_input.rb +49 -0
  72. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/encryption_details.rb +64 -0
  73. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/event.rb +76 -0
  74. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/event_collection.rb +94 -0
  75. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/event_properties.rb +151 -0
  76. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/event_provider_specific_details.rb +50 -0
  77. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/event_query_parameter.rb +107 -0
  78. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/event_specific_details.rb +45 -0
  79. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/export_job_details.rb +82 -0
  80. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric.rb +76 -0
  81. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_collection.rb +94 -0
  82. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_creation_input.rb +45 -0
  83. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_creation_input_properties.rb +48 -0
  84. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_properties.rb +127 -0
  85. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_replication_group_task_details.rb +79 -0
  86. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_specific_create_network_mapping_input.rb +47 -0
  87. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_specific_creation_input.rb +46 -0
  88. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_specific_details.rb +49 -0
  89. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/fabric_specific_update_network_mapping_input.rb +47 -0
  90. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/failover_deployment_model.rb +17 -0
  91. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/failover_job_details.rb +81 -0
  92. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/failover_process_server_request.rb +46 -0
  93. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/failover_process_server_request_properties.rb +92 -0
  94. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/failover_replication_protected_item_details.rb +124 -0
  95. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/group_task_details.rb +66 -0
  96. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/health_error.rb +152 -0
  97. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/health_error_category.rb +17 -0
  98. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/health_error_summary.rb +120 -0
  99. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica2012event_details.rb +88 -0
  100. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica2012r2event_details.rb +88 -0
  101. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_apply_recovery_point_input.rb +79 -0
  102. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_enable_protection_input.rb +201 -0
  103. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_event_details.rb +78 -0
  104. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_failback_provider_input.rb +78 -0
  105. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_failover_provider_input.rb +90 -0
  106. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_policy_details.rb +112 -0
  107. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_policy_input.rb +120 -0
  108. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_replication_details.rb +281 -0
  109. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_reprotect_input.rb +109 -0
  110. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_rp_recovery_point_type.rb +17 -0
  111. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_azure_update_replication_protected_item_input.rb +82 -0
  112. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_base_event_details.rb +88 -0
  113. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_base_policy_details.rb +151 -0
  114. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_base_replication_details.rb +135 -0
  115. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_blue_policy_details.rb +161 -0
  116. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_blue_policy_input.rb +161 -0
  117. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_blue_replication_details.rb +135 -0
  118. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_policy_details.rb +151 -0
  119. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_policy_input.rb +151 -0
  120. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vreplica_replication_details.rb +135 -0
  121. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vsite_details.rb +48 -0
  122. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/hyper_vvirtual_machine_details.rb +97 -0
  123. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/identity_information.rb +117 -0
  124. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/identity_provider_type.rb +16 -0
  125. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_agent_details.rb +66 -0
  126. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2apply_recovery_point_input.rb +58 -0
  127. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2enable_protection_input.rb +211 -0
  128. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2event_details.rb +119 -0
  129. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2failover_provider_input.rb +70 -0
  130. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2policy_details.rb +100 -0
  131. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2policy_input.rb +102 -0
  132. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2protected_disk_details.rb +185 -0
  133. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2recovery_point_details.rb +64 -0
  134. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2replication_details.rb +573 -0
  135. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2reprotect_input.rb +126 -0
  136. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_azure_v2update_replication_protected_item_input.rb +82 -0
  137. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_base_policy_details.rb +90 -0
  138. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_disable_protection_provider_specific_input.rb +60 -0
  139. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_disk_details.rb +102 -0
  140. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_disk_exclusion_input.rb +73 -0
  141. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_disk_signature_exclusion_options.rb +46 -0
  142. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_enable_protection_input.rb +156 -0
  143. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_failover_provider_input.rb +75 -0
  144. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_policy_details.rb +90 -0
  145. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_policy_input.rb +92 -0
  146. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_protected_disk_details.rb +185 -0
  147. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_replication_details.rb +472 -0
  148. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_reprotect_input.rb +136 -0
  149. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_v2rp_recovery_point_type.rb +18 -0
  150. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/in_mage_volume_exclusion_options.rb +59 -0
  151. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/inconsistent_vm_details.rb +90 -0
  152. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/initial_replication_details.rb +54 -0
  153. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/inline_workflow_task_details.rb +80 -0
  154. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/input_endpoint.rb +74 -0
  155. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job.rb +119 -0
  156. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_collection.rb +94 -0
  157. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_details.rb +68 -0
  158. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_entity.rb +95 -0
  159. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_error_details.rb +86 -0
  160. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_properties.rb +206 -0
  161. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_query_parameter.rb +98 -0
  162. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_status_event_details.rb +88 -0
  163. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/job_task_details.rb +60 -0
  164. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/license_type.rb +17 -0
  165. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/logical_network.rb +76 -0
  166. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/logical_network_collection.rb +94 -0
  167. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/logical_network_properties.rb +77 -0
  168. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/manual_action_task_details.rb +78 -0
  169. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/master_target_server.rb +179 -0
  170. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/method_call_status.rb +73 -0
  171. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/mobility_service_update.rb +65 -0
  172. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/multi_vm_sync_status.rb +16 -0
  173. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network.rb +76 -0
  174. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network_collection.rb +94 -0
  175. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network_mapping.rb +82 -0
  176. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network_mapping_collection.rb +98 -0
  177. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network_mapping_fabric_specific_settings.rb +47 -0
  178. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network_mapping_properties.rb +128 -0
  179. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/network_properties.rb +82 -0
  180. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/operations_discovery.rb +95 -0
  181. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/operations_discovery_collection.rb +94 -0
  182. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/osdetails.rb +94 -0
  183. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/osdisk_details.rb +64 -0
  184. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/planned_failover_input.rb +46 -0
  185. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/planned_failover_input_properties.rb +57 -0
  186. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/policy.rb +76 -0
  187. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/policy_collection.rb +94 -0
  188. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/policy_properties.rb +57 -0
  189. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/policy_provider_specific_details.rb +54 -0
  190. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/policy_provider_specific_input.rb +51 -0
  191. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/possible_operations_directions.rb +16 -0
  192. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/process_server.rb +294 -0
  193. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protectable_item.rb +76 -0
  194. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protectable_item_collection.rb +94 -0
  195. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protectable_item_properties.rb +123 -0
  196. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protected_items_query_parameter.rb +64 -0
  197. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container.rb +76 -0
  198. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_collection.rb +94 -0
  199. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_fabric_specific_details.rb +45 -0
  200. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_mapping.rb +76 -0
  201. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_mapping_collection.rb +94 -0
  202. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_mapping_properties.rb +154 -0
  203. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_mapping_provider_specific_details.rb +46 -0
  204. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/protection_container_properties.rb +106 -0
  205. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/provider_error.rb +84 -0
  206. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/provider_specific_failover_input.rb +49 -0
  207. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/provider_specific_recovery_point_details.rb +45 -0
  208. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/rcm_azure_migration_policy_details.rb +101 -0
  209. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan.rb +76 -0
  210. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_a2afailover_input.rb +72 -0
  211. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_action.rb +95 -0
  212. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_action_details.rb +47 -0
  213. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_action_location.rb +16 -0
  214. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_automation_runbook_action_details.rb +81 -0
  215. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_collection.rb +94 -0
  216. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_group.rb +100 -0
  217. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_group_task_details.rb +93 -0
  218. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_group_type.rb +17 -0
  219. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_hyper_vreplica_azure_failback_input.rb +73 -0
  220. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_hyper_vreplica_azure_failover_input.rb +92 -0
  221. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_in_mage_azure_v2failover_input.rb +82 -0
  222. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_in_mage_failover_input.rb +60 -0
  223. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_manual_action_details.rb +58 -0
  224. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_planned_failover_input.rb +46 -0
  225. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_planned_failover_input_properties.rb +68 -0
  226. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_properties.rb +207 -0
  227. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_protected_item.rb +54 -0
  228. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_provider_specific_failover_input.rb +50 -0
  229. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_script_action_details.rb +80 -0
  230. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_shutdown_group_task_details.rb +93 -0
  231. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_test_failover_cleanup_input.rb +46 -0
  232. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_test_failover_cleanup_input_properties.rb +45 -0
  233. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_test_failover_input.rb +46 -0
  234. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_test_failover_input_properties.rb +98 -0
  235. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_unplanned_failover_input.rb +46 -0
  236. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_plan_unplanned_failover_input_properties.rb +81 -0
  237. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_point.rb +76 -0
  238. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_point_collection.rb +94 -0
  239. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_point_properties.rb +67 -0
  240. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_point_type.rb +17 -0
  241. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_services_provider.rb +76 -0
  242. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_services_provider_collection.rb +94 -0
  243. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/recovery_services_provider_properties.rb +191 -0
  244. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/remove_protection_container_mapping_input.rb +46 -0
  245. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/remove_protection_container_mapping_input_properties.rb +47 -0
  246. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/renew_certificate_input.rb +46 -0
  247. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/renew_certificate_input_properties.rb +44 -0
  248. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_group_details.rb +48 -0
  249. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_protected_item.rb +76 -0
  250. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_protected_item_collection.rb +95 -0
  251. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_protected_item_operation.rb +27 -0
  252. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_protected_item_properties.rb +338 -0
  253. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_provider_container_unmapping_input.rb +45 -0
  254. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_provider_specific_container_creation_input.rb +46 -0
  255. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_provider_specific_container_mapping_input.rb +45 -0
  256. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/replication_provider_specific_settings.rb +51 -0
  257. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/resource.rb +77 -0
  258. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/resource_health_summary.rb +64 -0
  259. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/resume_job_params.rb +45 -0
  260. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/resume_job_params_properties.rb +44 -0
  261. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/retention_volume.rb +74 -0
  262. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/reverse_replication_input.rb +46 -0
  263. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/reverse_replication_input_properties.rb +58 -0
  264. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/reverse_replication_provider_specific_input.rb +48 -0
  265. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/role_assignment.rb +84 -0
  266. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/rp_in_mage_recovery_point_type.rb +17 -0
  267. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/run_as_account.rb +54 -0
  268. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/san_enable_protection_input.rb +48 -0
  269. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/script_action_task_details.rb +89 -0
  270. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/service_error.rb +84 -0
  271. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/set_multi_vm_sync_status.rb +16 -0
  272. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/severity.rb +18 -0
  273. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/source_site_operations.rb +16 -0
  274. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification.rb +77 -0
  275. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification_collection.rb +94 -0
  276. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification_mapping.rb +77 -0
  277. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification_mapping_collection.rb +95 -0
  278. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification_mapping_input.rb +46 -0
  279. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification_mapping_properties.rb +44 -0
  280. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_classification_properties.rb +44 -0
  281. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/storage_mapping_input_properties.rb +44 -0
  282. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/subnet.rb +71 -0
  283. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/switch_protection_input.rb +45 -0
  284. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/switch_protection_input_properties.rb +58 -0
  285. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/switch_protection_job_details.rb +72 -0
  286. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/switch_protection_provider_specific_input.rb +45 -0
  287. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/task_type_details.rb +52 -0
  288. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/test_failover_cleanup_input.rb +46 -0
  289. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/test_failover_cleanup_input_properties.rb +44 -0
  290. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/test_failover_input.rb +45 -0
  291. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/test_failover_input_properties.rb +88 -0
  292. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/test_failover_job_details.rb +132 -0
  293. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/unplanned_failover_input.rb +46 -0
  294. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/unplanned_failover_input_properties.rb +67 -0
  295. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_mobility_service_request.rb +46 -0
  296. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_mobility_service_request_properties.rb +44 -0
  297. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_network_mapping_input.rb +46 -0
  298. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_network_mapping_input_properties.rb +68 -0
  299. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_policy_input.rb +45 -0
  300. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_policy_input_properties.rb +47 -0
  301. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_recovery_plan_input.rb +46 -0
  302. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_recovery_plan_input_properties.rb +52 -0
  303. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_replication_protected_item_input.rb +46 -0
  304. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_replication_protected_item_input_properties.rb +131 -0
  305. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_replication_protected_item_provider_input.rb +48 -0
  306. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_vcenter_request.rb +46 -0
  307. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/update_vcenter_request_properties.rb +86 -0
  308. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vault_health_details.rb +76 -0
  309. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vault_health_properties.rb +76 -0
  310. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vcenter.rb +76 -0
  311. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vcenter_collection.rb +94 -0
  312. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vcenter_properties.rb +137 -0
  313. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/virtual_machine_task_details.rb +79 -0
  314. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vm_nic_updates_task_details.rb +78 -0
  315. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_details.rb +48 -0
  316. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_to_azure_create_network_mapping_input.rb +49 -0
  317. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_to_azure_network_mapping_settings.rb +48 -0
  318. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_to_azure_update_network_mapping_input.rb +49 -0
  319. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_to_vmm_create_network_mapping_input.rb +49 -0
  320. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_to_vmm_network_mapping_settings.rb +48 -0
  321. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmm_to_vmm_update_network_mapping_input.rb +49 -0
  322. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmnic_details.rb +154 -0
  323. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmnic_input_details.rb +74 -0
  324. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmware_cbt_policy_creation_input.rb +79 -0
  325. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmware_cbt_policy_details.rb +89 -0
  326. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmware_details.rb +376 -0
  327. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmware_v2fabric_creation_input.rb +48 -0
  328. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmware_v2fabric_specific_details.rb +68 -0
  329. data/lib/generated/azure_mgmt_recovery_services_site_recovery/models/vmware_virtual_machine_details.rb +168 -0
  330. data/lib/generated/azure_mgmt_recovery_services_site_recovery/module_definition.rb +8 -0
  331. data/lib/generated/azure_mgmt_recovery_services_site_recovery/operations.rb +230 -0
  332. data/lib/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb +360 -0
  333. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_alert_settings.rb +442 -0
  334. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_events.rb +329 -0
  335. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_fabrics.rb +1299 -0
  336. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_jobs.rb +905 -0
  337. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_logical_networks.rb +335 -0
  338. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_network_mappings.rb +1012 -0
  339. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_networks.rb +541 -0
  340. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_policies.rb +752 -0
  341. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_protectable_items.rb +344 -0
  342. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_protected_items.rb +2757 -0
  343. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_container_mappings.rb +1002 -0
  344. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb +1175 -0
  345. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_recovery_plans.rb +1639 -0
  346. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_recovery_services_providers.rb +967 -0
  347. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_storage_classification_mappings.rb +861 -0
  348. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_storage_classifications.rb +541 -0
  349. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replication_vault_health.rb +116 -0
  350. data/lib/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb +999 -0
  351. data/lib/generated/azure_mgmt_recovery_services_site_recovery/site_recovery_management_client.rb +217 -0
  352. data/lib/generated/azure_mgmt_recovery_services_site_recovery/version.rb +8 -0
  353. metadata +466 -0
@@ -0,0 +1,344 @@
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::RecoveryServicesSiteRecovery
7
+ #
8
+ # ReplicationProtectableItems
9
+ #
10
+ class ReplicationProtectableItems
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ReplicationProtectableItems class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SiteRecoveryManagementClient] reference to the SiteRecoveryManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the details of a protectable item.
26
+ #
27
+ # The operation to get the details of a protectable item.
28
+ #
29
+ # @param fabric_name [String] Fabric name.
30
+ # @param protection_container_name [String] Protection container name.
31
+ # @param protectable_item_name [String] Protectable item name.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [ProtectableItem] operation results.
36
+ #
37
+ def get(fabric_name, protection_container_name, protectable_item_name, custom_headers = nil)
38
+ response = get_async(fabric_name, protection_container_name, protectable_item_name, custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Gets the details of a protectable item.
44
+ #
45
+ # The operation to get the details of a protectable item.
46
+ #
47
+ # @param fabric_name [String] Fabric name.
48
+ # @param protection_container_name [String] Protection container name.
49
+ # @param protectable_item_name [String] Protectable item name.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(fabric_name, protection_container_name, protectable_item_name, custom_headers = nil)
56
+ get_async(fabric_name, protection_container_name, protectable_item_name, custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Gets the details of a protectable item.
61
+ #
62
+ # The operation to get the details of a protectable item.
63
+ #
64
+ # @param fabric_name [String] Fabric name.
65
+ # @param protection_container_name [String] Protection container name.
66
+ # @param protectable_item_name [String] Protectable item name.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(fabric_name, protection_container_name, protectable_item_name, custom_headers = nil)
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
75
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
76
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
77
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
78
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
79
+ fail ArgumentError, 'protectable_item_name is nil' if protectable_item_name.nil?
80
+
81
+
82
+ request_headers = {}
83
+
84
+ # Set Headers
85
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
86
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
87
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}'
88
+
89
+ request_url = @base_url || @client.base_url
90
+
91
+ options = {
92
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
93
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'protectableItemName' => protectable_item_name},
94
+ query_params: {'api-version' => @client.api_version},
95
+ headers: request_headers.merge(custom_headers || {}),
96
+ base_url: request_url
97
+ }
98
+ promise = @client.make_request_async(:get, path_template, options)
99
+
100
+ promise = promise.then do |result|
101
+ http_response = result.response
102
+ status_code = http_response.status
103
+ response_content = http_response.body
104
+ unless status_code == 200
105
+ error_model = JSON.load(response_content)
106
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
107
+ end
108
+
109
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ProtectableItem.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Gets the list of protectable items.
129
+ #
130
+ # Lists the protectable items in a protection container.
131
+ #
132
+ # @param fabric_name [String] Fabric name.
133
+ # @param protection_container_name [String] Protection container name.
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [Array<ProtectableItem>] operation results.
138
+ #
139
+ def list_by_replication_protection_containers(fabric_name, protection_container_name, custom_headers = nil)
140
+ first_page = list_by_replication_protection_containers_as_lazy(fabric_name, protection_container_name, custom_headers)
141
+ first_page.get_all_items
142
+ end
143
+
144
+ #
145
+ # Gets the list of protectable items.
146
+ #
147
+ # Lists the protectable items in a protection container.
148
+ #
149
+ # @param fabric_name [String] Fabric name.
150
+ # @param protection_container_name [String] Protection container name.
151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
+ # will be added to the HTTP request.
153
+ #
154
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
155
+ #
156
+ def list_by_replication_protection_containers_with_http_info(fabric_name, protection_container_name, custom_headers = nil)
157
+ list_by_replication_protection_containers_async(fabric_name, protection_container_name, custom_headers).value!
158
+ end
159
+
160
+ #
161
+ # Gets the list of protectable items.
162
+ #
163
+ # Lists the protectable items in a protection container.
164
+ #
165
+ # @param fabric_name [String] Fabric name.
166
+ # @param protection_container_name [String] Protection container name.
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def list_by_replication_protection_containers_async(fabric_name, protection_container_name, custom_headers = nil)
173
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
174
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
175
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
177
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
178
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
179
+
180
+
181
+ request_headers = {}
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name},
193
+ query_params: {'api-version' => @client.api_version},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ # Deserialize Response
210
+ if status_code == 200
211
+ begin
212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ProtectableItemCollection.mapper()
214
+ result.body = @client.deserialize(result_mapper, parsed_response)
215
+ rescue Exception => e
216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
217
+ end
218
+ end
219
+
220
+ result
221
+ end
222
+
223
+ promise.execute
224
+ end
225
+
226
+ #
227
+ # Gets the list of protectable items.
228
+ #
229
+ # Lists the protectable items in a protection container.
230
+ #
231
+ # @param next_page_link [String] The NextLink from the previous successful call
232
+ # to List operation.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [ProtectableItemCollection] operation results.
237
+ #
238
+ def list_by_replication_protection_containers_next(next_page_link, custom_headers = nil)
239
+ response = list_by_replication_protection_containers_next_async(next_page_link, custom_headers).value!
240
+ response.body unless response.nil?
241
+ end
242
+
243
+ #
244
+ # Gets the list of protectable items.
245
+ #
246
+ # Lists the protectable items in a protection container.
247
+ #
248
+ # @param next_page_link [String] The NextLink from the previous successful call
249
+ # to List operation.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
254
+ #
255
+ def list_by_replication_protection_containers_next_with_http_info(next_page_link, custom_headers = nil)
256
+ list_by_replication_protection_containers_next_async(next_page_link, custom_headers).value!
257
+ end
258
+
259
+ #
260
+ # Gets the list of protectable items.
261
+ #
262
+ # Lists the protectable items in a protection container.
263
+ #
264
+ # @param next_page_link [String] The NextLink from the previous successful call
265
+ # to List operation.
266
+ # @param [Hash{String => String}] A hash of custom headers that will be added
267
+ # to the HTTP request.
268
+ #
269
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
270
+ #
271
+ def list_by_replication_protection_containers_next_async(next_page_link, custom_headers = nil)
272
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
273
+
274
+
275
+ request_headers = {}
276
+
277
+ # Set Headers
278
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
279
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
280
+ path_template = '{nextLink}'
281
+
282
+ request_url = @base_url || @client.base_url
283
+
284
+ options = {
285
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
286
+ skip_encoding_path_params: {'nextLink' => next_page_link},
287
+ headers: request_headers.merge(custom_headers || {}),
288
+ base_url: request_url
289
+ }
290
+ promise = @client.make_request_async(:get, path_template, options)
291
+
292
+ promise = promise.then do |result|
293
+ http_response = result.response
294
+ status_code = http_response.status
295
+ response_content = http_response.body
296
+ unless status_code == 200
297
+ error_model = JSON.load(response_content)
298
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
299
+ end
300
+
301
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
302
+ # Deserialize Response
303
+ if status_code == 200
304
+ begin
305
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
306
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ProtectableItemCollection.mapper()
307
+ result.body = @client.deserialize(result_mapper, parsed_response)
308
+ rescue Exception => e
309
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
310
+ end
311
+ end
312
+
313
+ result
314
+ end
315
+
316
+ promise.execute
317
+ end
318
+
319
+ #
320
+ # Gets the list of protectable items.
321
+ #
322
+ # Lists the protectable items in a protection container.
323
+ #
324
+ # @param fabric_name [String] Fabric name.
325
+ # @param protection_container_name [String] Protection container name.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [ProtectableItemCollection] which provide lazy access to pages of the
330
+ # response.
331
+ #
332
+ def list_by_replication_protection_containers_as_lazy(fabric_name, protection_container_name, custom_headers = nil)
333
+ response = list_by_replication_protection_containers_async(fabric_name, protection_container_name, custom_headers).value!
334
+ unless response.nil?
335
+ page = response.body
336
+ page.next_method = Proc.new do |next_page_link|
337
+ list_by_replication_protection_containers_next_async(next_page_link, custom_headers)
338
+ end
339
+ page
340
+ end
341
+ end
342
+
343
+ end
344
+ end
@@ -0,0 +1,2757 @@
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::RecoveryServicesSiteRecovery
7
+ #
8
+ # ReplicationProtectedItems
9
+ #
10
+ class ReplicationProtectedItems
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ReplicationProtectedItems class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SiteRecoveryManagementClient] reference to the SiteRecoveryManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the list of Replication protected items.
26
+ #
27
+ # Gets the list of ASR replication protected items in the protection container.
28
+ #
29
+ # @param fabric_name [String] Fabric name.
30
+ # @param protection_container_name [String] Protection container name.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<ReplicationProtectedItem>] operation results.
35
+ #
36
+ def list_by_replication_protection_containers(fabric_name, protection_container_name, custom_headers = nil)
37
+ first_page = list_by_replication_protection_containers_as_lazy(fabric_name, protection_container_name, custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Gets the list of Replication protected items.
43
+ #
44
+ # Gets the list of ASR replication protected items in the protection container.
45
+ #
46
+ # @param fabric_name [String] Fabric name.
47
+ # @param protection_container_name [String] Protection container name.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_by_replication_protection_containers_with_http_info(fabric_name, protection_container_name, custom_headers = nil)
54
+ list_by_replication_protection_containers_async(fabric_name, protection_container_name, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets the list of Replication protected items.
59
+ #
60
+ # Gets the list of ASR replication protected items in the protection container.
61
+ #
62
+ # @param fabric_name [String] Fabric name.
63
+ # @param protection_container_name [String] Protection container name.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_by_replication_protection_containers_async(fabric_name, protection_container_name, custom_headers = nil)
70
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
71
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
72
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
75
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
76
+
77
+
78
+ request_headers = {}
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name},
90
+ query_params: {'api-version' => @client.api_version},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItemCollection.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Gets the list of replication protected items.
125
+ #
126
+ # Gets the list of ASR replication protected items in the vault.
127
+ #
128
+ # @param skip_token [String] The pagination token. Possible values: "FabricId"
129
+ # or "FabricId_CloudId" or null
130
+ # @param filter [String] OData filter options.
131
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
132
+ # will be added to the HTTP request.
133
+ #
134
+ # @return [Array<ReplicationProtectedItem>] operation results.
135
+ #
136
+ def list(skip_token = nil, filter = nil, custom_headers = nil)
137
+ first_page = list_as_lazy(skip_token, filter, custom_headers)
138
+ first_page.get_all_items
139
+ end
140
+
141
+ #
142
+ # Gets the list of replication protected items.
143
+ #
144
+ # Gets the list of ASR replication protected items in the vault.
145
+ #
146
+ # @param skip_token [String] The pagination token. Possible values: "FabricId"
147
+ # or "FabricId_CloudId" or null
148
+ # @param filter [String] OData filter options.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
153
+ #
154
+ def list_with_http_info(skip_token = nil, filter = nil, custom_headers = nil)
155
+ list_async(skip_token, filter, custom_headers).value!
156
+ end
157
+
158
+ #
159
+ # Gets the list of replication protected items.
160
+ #
161
+ # Gets the list of ASR replication protected items in the vault.
162
+ #
163
+ # @param skip_token [String] The pagination token. Possible values: "FabricId"
164
+ # or "FabricId_CloudId" or null
165
+ # @param filter [String] OData filter options.
166
+ # @param [Hash{String => String}] A hash of custom headers that will be added
167
+ # to the HTTP request.
168
+ #
169
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
170
+ #
171
+ def list_async(skip_token = nil, filter = nil, custom_headers = nil)
172
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
173
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
174
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
175
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
176
+
177
+
178
+ request_headers = {}
179
+
180
+ # Set Headers
181
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
182
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
183
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems'
184
+
185
+ request_url = @base_url || @client.base_url
186
+
187
+ options = {
188
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
189
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id},
190
+ query_params: {'api-version' => @client.api_version,'skipToken' => skip_token,'$filter' => filter},
191
+ headers: request_headers.merge(custom_headers || {}),
192
+ base_url: request_url
193
+ }
194
+ promise = @client.make_request_async(:get, path_template, options)
195
+
196
+ promise = promise.then do |result|
197
+ http_response = result.response
198
+ status_code = http_response.status
199
+ response_content = http_response.body
200
+ unless status_code == 200
201
+ error_model = JSON.load(response_content)
202
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
203
+ end
204
+
205
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
206
+ # Deserialize Response
207
+ if status_code == 200
208
+ begin
209
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
210
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItemCollection.mapper()
211
+ result.body = @client.deserialize(result_mapper, parsed_response)
212
+ rescue Exception => e
213
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
214
+ end
215
+ end
216
+
217
+ result
218
+ end
219
+
220
+ promise.execute
221
+ end
222
+
223
+ #
224
+ # Change or apply recovery point.
225
+ #
226
+ # The operation to change the recovery point of a failed over replication
227
+ # protected item.
228
+ #
229
+ # @param fabric_name [String] The ARM fabric name.
230
+ # @param protection_container_name [String] The protection container name.
231
+ # @param replicated_protected_item_name [String] The replicated protected
232
+ # item's name.
233
+ # @param apply_recovery_point_input [ApplyRecoveryPointInput] The
234
+ # ApplyRecoveryPointInput.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [ReplicationProtectedItem] operation results.
239
+ #
240
+ def apply_recovery_point(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers = nil)
241
+ response = apply_recovery_point_async(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers).value!
242
+ response.body unless response.nil?
243
+ end
244
+
245
+ #
246
+ # @param fabric_name [String] The ARM fabric name.
247
+ # @param protection_container_name [String] The protection container name.
248
+ # @param replicated_protected_item_name [String] The replicated protected
249
+ # item's name.
250
+ # @param apply_recovery_point_input [ApplyRecoveryPointInput] The
251
+ # ApplyRecoveryPointInput.
252
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
+ # will be added to the HTTP request.
254
+ #
255
+ # @return [Concurrent::Promise] promise which provides async access to http
256
+ # response.
257
+ #
258
+ def apply_recovery_point_async(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers = nil)
259
+ # Send request
260
+ promise = begin_apply_recovery_point_async(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers)
261
+
262
+ promise = promise.then do |response|
263
+ # Defining deserialization method.
264
+ deserialize_method = lambda do |parsed_response|
265
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
266
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
267
+ end
268
+
269
+ # Waiting for response.
270
+ @client.get_long_running_operation_result(response, deserialize_method)
271
+ end
272
+
273
+ promise
274
+ end
275
+
276
+ #
277
+ # Resynchronize or repair replication.
278
+ #
279
+ # The operation to start resynchronize/repair replication for a replication
280
+ # protected item requiring resynchronization.
281
+ #
282
+ # @param fabric_name [String] The name of the fabric.
283
+ # @param protection_container_name [String] The name of the container.
284
+ # @param replicated_protected_item_name [String] The name of the replication
285
+ # protected item.
286
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
287
+ # will be added to the HTTP request.
288
+ #
289
+ # @return [ReplicationProtectedItem] operation results.
290
+ #
291
+ def repair_replication(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
292
+ response = repair_replication_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
293
+ response.body unless response.nil?
294
+ end
295
+
296
+ #
297
+ # @param fabric_name [String] The name of the fabric.
298
+ # @param protection_container_name [String] The name of the container.
299
+ # @param replicated_protected_item_name [String] The name of the replication
300
+ # protected item.
301
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
302
+ # will be added to the HTTP request.
303
+ #
304
+ # @return [Concurrent::Promise] promise which provides async access to http
305
+ # response.
306
+ #
307
+ def repair_replication_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
308
+ # Send request
309
+ promise = begin_repair_replication_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers)
310
+
311
+ promise = promise.then do |response|
312
+ # Defining deserialization method.
313
+ deserialize_method = lambda do |parsed_response|
314
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
315
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
316
+ end
317
+
318
+ # Waiting for response.
319
+ @client.get_long_running_operation_result(response, deserialize_method)
320
+ end
321
+
322
+ promise
323
+ end
324
+
325
+ #
326
+ # Update the mobility service on a protected item.
327
+ #
328
+ # The operation to update(push update) the installed mobility service software
329
+ # on a replication protected item to the latest available version.
330
+ #
331
+ # @param fabric_name [String] The name of the fabric containing the protected
332
+ # item.
333
+ # @param protection_container_name [String] The name of the container
334
+ # containing the protected item.
335
+ # @param replication_protected_item_name [String] The name of the protected
336
+ # item on which the agent is to be updated.
337
+ # @param update_mobility_service_request [UpdateMobilityServiceRequest] Request
338
+ # to update the mobility service on the protected item.
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [ReplicationProtectedItem] operation results.
343
+ #
344
+ def update_mobility_service(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers = nil)
345
+ response = update_mobility_service_async(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers).value!
346
+ response.body unless response.nil?
347
+ end
348
+
349
+ #
350
+ # @param fabric_name [String] The name of the fabric containing the protected
351
+ # item.
352
+ # @param protection_container_name [String] The name of the container
353
+ # containing the protected item.
354
+ # @param replication_protected_item_name [String] The name of the protected
355
+ # item on which the agent is to be updated.
356
+ # @param update_mobility_service_request [UpdateMobilityServiceRequest] Request
357
+ # to update the mobility service on the protected item.
358
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
359
+ # will be added to the HTTP request.
360
+ #
361
+ # @return [Concurrent::Promise] promise which provides async access to http
362
+ # response.
363
+ #
364
+ def update_mobility_service_async(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers = nil)
365
+ # Send request
366
+ promise = begin_update_mobility_service_async(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers)
367
+
368
+ promise = promise.then do |response|
369
+ # Defining deserialization method.
370
+ deserialize_method = lambda do |parsed_response|
371
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
372
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
373
+ end
374
+
375
+ # Waiting for response.
376
+ @client.get_long_running_operation_result(response, deserialize_method)
377
+ end
378
+
379
+ promise
380
+ end
381
+
382
+ #
383
+ # Execute Reverse Replication\Reprotect
384
+ #
385
+ # Operation to reprotect or reverse replicate a failed over replication
386
+ # protected item.
387
+ #
388
+ # @param fabric_name [String] Unique fabric name.
389
+ # @param protection_container_name [String] Protection container name.
390
+ # @param replicated_protected_item_name [String] Replication protected item
391
+ # name.
392
+ # @param rr_input [ReverseReplicationInput] Disable protection input.
393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
394
+ # will be added to the HTTP request.
395
+ #
396
+ # @return [ReplicationProtectedItem] operation results.
397
+ #
398
+ def reprotect(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers = nil)
399
+ response = reprotect_async(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers).value!
400
+ response.body unless response.nil?
401
+ end
402
+
403
+ #
404
+ # @param fabric_name [String] Unique fabric name.
405
+ # @param protection_container_name [String] Protection container name.
406
+ # @param replicated_protected_item_name [String] Replication protected item
407
+ # name.
408
+ # @param rr_input [ReverseReplicationInput] Disable protection input.
409
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
410
+ # will be added to the HTTP request.
411
+ #
412
+ # @return [Concurrent::Promise] promise which provides async access to http
413
+ # response.
414
+ #
415
+ def reprotect_async(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers = nil)
416
+ # Send request
417
+ promise = begin_reprotect_async(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers)
418
+
419
+ promise = promise.then do |response|
420
+ # Defining deserialization method.
421
+ deserialize_method = lambda do |parsed_response|
422
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
423
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
424
+ end
425
+
426
+ # Waiting for response.
427
+ @client.get_long_running_operation_result(response, deserialize_method)
428
+ end
429
+
430
+ promise
431
+ end
432
+
433
+ #
434
+ # Execute commit failover
435
+ #
436
+ # Operation to commit the failover of the replication protected item.
437
+ #
438
+ # @param fabric_name [String] Unique fabric name.
439
+ # @param protection_container_name [String] Protection container name.
440
+ # @param replicated_protected_item_name [String] Replication protected item
441
+ # name.
442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
443
+ # will be added to the HTTP request.
444
+ #
445
+ # @return [ReplicationProtectedItem] operation results.
446
+ #
447
+ def failover_commit(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
448
+ response = failover_commit_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
449
+ response.body unless response.nil?
450
+ end
451
+
452
+ #
453
+ # @param fabric_name [String] Unique fabric name.
454
+ # @param protection_container_name [String] Protection container name.
455
+ # @param replicated_protected_item_name [String] Replication protected item
456
+ # name.
457
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
458
+ # will be added to the HTTP request.
459
+ #
460
+ # @return [Concurrent::Promise] promise which provides async access to http
461
+ # response.
462
+ #
463
+ def failover_commit_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
464
+ # Send request
465
+ promise = begin_failover_commit_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers)
466
+
467
+ promise = promise.then do |response|
468
+ # Defining deserialization method.
469
+ deserialize_method = lambda do |parsed_response|
470
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
471
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
472
+ end
473
+
474
+ # Waiting for response.
475
+ @client.get_long_running_operation_result(response, deserialize_method)
476
+ end
477
+
478
+ promise
479
+ end
480
+
481
+ #
482
+ # Execute test failover cleanup.
483
+ #
484
+ # Operation to clean up the test failover of a replication protected item.
485
+ #
486
+ # @param fabric_name [String] Unique fabric name.
487
+ # @param protection_container_name [String] Protection container name.
488
+ # @param replicated_protected_item_name [String] Replication protected item
489
+ # name.
490
+ # @param cleanup_input [TestFailoverCleanupInput] Test failover cleanup input.
491
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
492
+ # will be added to the HTTP request.
493
+ #
494
+ # @return [ReplicationProtectedItem] operation results.
495
+ #
496
+ def test_failover_cleanup(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers = nil)
497
+ response = test_failover_cleanup_async(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers).value!
498
+ response.body unless response.nil?
499
+ end
500
+
501
+ #
502
+ # @param fabric_name [String] Unique fabric name.
503
+ # @param protection_container_name [String] Protection container name.
504
+ # @param replicated_protected_item_name [String] Replication protected item
505
+ # name.
506
+ # @param cleanup_input [TestFailoverCleanupInput] Test failover cleanup input.
507
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
508
+ # will be added to the HTTP request.
509
+ #
510
+ # @return [Concurrent::Promise] promise which provides async access to http
511
+ # response.
512
+ #
513
+ def test_failover_cleanup_async(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers = nil)
514
+ # Send request
515
+ promise = begin_test_failover_cleanup_async(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers)
516
+
517
+ promise = promise.then do |response|
518
+ # Defining deserialization method.
519
+ deserialize_method = lambda do |parsed_response|
520
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
521
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
522
+ end
523
+
524
+ # Waiting for response.
525
+ @client.get_long_running_operation_result(response, deserialize_method)
526
+ end
527
+
528
+ promise
529
+ end
530
+
531
+ #
532
+ # Execute test failover
533
+ #
534
+ # Operation to perform a test failover of the replication protected item.
535
+ #
536
+ # @param fabric_name [String] Unique fabric name.
537
+ # @param protection_container_name [String] Protection container name.
538
+ # @param replicated_protected_item_name [String] Replication protected item
539
+ # name.
540
+ # @param failover_input [TestFailoverInput] Test failover input.
541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
542
+ # will be added to the HTTP request.
543
+ #
544
+ # @return [ReplicationProtectedItem] operation results.
545
+ #
546
+ def test_failover(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
547
+ response = test_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
548
+ response.body unless response.nil?
549
+ end
550
+
551
+ #
552
+ # @param fabric_name [String] Unique fabric name.
553
+ # @param protection_container_name [String] Protection container name.
554
+ # @param replicated_protected_item_name [String] Replication protected item
555
+ # name.
556
+ # @param failover_input [TestFailoverInput] Test failover input.
557
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
558
+ # will be added to the HTTP request.
559
+ #
560
+ # @return [Concurrent::Promise] promise which provides async access to http
561
+ # response.
562
+ #
563
+ def test_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
564
+ # Send request
565
+ promise = begin_test_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers)
566
+
567
+ promise = promise.then do |response|
568
+ # Defining deserialization method.
569
+ deserialize_method = lambda do |parsed_response|
570
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
571
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
572
+ end
573
+
574
+ # Waiting for response.
575
+ @client.get_long_running_operation_result(response, deserialize_method)
576
+ end
577
+
578
+ promise
579
+ end
580
+
581
+ #
582
+ # Execute unplanned failover
583
+ #
584
+ # Operation to initiate a failover of the replication protected item.
585
+ #
586
+ # @param fabric_name [String] Unique fabric name.
587
+ # @param protection_container_name [String] Protection container name.
588
+ # @param replicated_protected_item_name [String] Replication protected item
589
+ # name.
590
+ # @param failover_input [UnplannedFailoverInput] Disable protection input.
591
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
592
+ # will be added to the HTTP request.
593
+ #
594
+ # @return [ReplicationProtectedItem] operation results.
595
+ #
596
+ def unplanned_failover(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
597
+ response = unplanned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
598
+ response.body unless response.nil?
599
+ end
600
+
601
+ #
602
+ # @param fabric_name [String] Unique fabric name.
603
+ # @param protection_container_name [String] Protection container name.
604
+ # @param replicated_protected_item_name [String] Replication protected item
605
+ # name.
606
+ # @param failover_input [UnplannedFailoverInput] Disable protection input.
607
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
608
+ # will be added to the HTTP request.
609
+ #
610
+ # @return [Concurrent::Promise] promise which provides async access to http
611
+ # response.
612
+ #
613
+ def unplanned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
614
+ # Send request
615
+ promise = begin_unplanned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers)
616
+
617
+ promise = promise.then do |response|
618
+ # Defining deserialization method.
619
+ deserialize_method = lambda do |parsed_response|
620
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
621
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
622
+ end
623
+
624
+ # Waiting for response.
625
+ @client.get_long_running_operation_result(response, deserialize_method)
626
+ end
627
+
628
+ promise
629
+ end
630
+
631
+ #
632
+ # Execute planned failover
633
+ #
634
+ # Operation to initiate a planned failover of the replication protected item.
635
+ #
636
+ # @param fabric_name [String] Unique fabric name.
637
+ # @param protection_container_name [String] Protection container name.
638
+ # @param replicated_protected_item_name [String] Replication protected item
639
+ # name.
640
+ # @param failover_input [PlannedFailoverInput] Disable protection input.
641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
+ # will be added to the HTTP request.
643
+ #
644
+ # @return [ReplicationProtectedItem] operation results.
645
+ #
646
+ def planned_failover(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
647
+ response = planned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
648
+ response.body unless response.nil?
649
+ end
650
+
651
+ #
652
+ # @param fabric_name [String] Unique fabric name.
653
+ # @param protection_container_name [String] Protection container name.
654
+ # @param replicated_protected_item_name [String] Replication protected item
655
+ # name.
656
+ # @param failover_input [PlannedFailoverInput] Disable protection input.
657
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
658
+ # will be added to the HTTP request.
659
+ #
660
+ # @return [Concurrent::Promise] promise which provides async access to http
661
+ # response.
662
+ #
663
+ def planned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
664
+ # Send request
665
+ promise = begin_planned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers)
666
+
667
+ promise = promise.then do |response|
668
+ # Defining deserialization method.
669
+ deserialize_method = lambda do |parsed_response|
670
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
671
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
672
+ end
673
+
674
+ # Waiting for response.
675
+ @client.get_long_running_operation_result(response, deserialize_method)
676
+ end
677
+
678
+ promise
679
+ end
680
+
681
+ #
682
+ # Disables protection.
683
+ #
684
+ # The operation to disable replication on a replication protected item. This
685
+ # will also remove the item.
686
+ #
687
+ # @param fabric_name [String] Fabric name.
688
+ # @param protection_container_name [String] Protection container name.
689
+ # @param replicated_protected_item_name [String] Replication protected item
690
+ # name.
691
+ # @param disable_protection_input [DisableProtectionInput] Disable protection
692
+ # input.
693
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
694
+ # will be added to the HTTP request.
695
+ #
696
+ def delete(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers = nil)
697
+ response = delete_async(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers).value!
698
+ nil
699
+ end
700
+
701
+ #
702
+ # @param fabric_name [String] Fabric name.
703
+ # @param protection_container_name [String] Protection container name.
704
+ # @param replicated_protected_item_name [String] Replication protected item
705
+ # name.
706
+ # @param disable_protection_input [DisableProtectionInput] Disable protection
707
+ # input.
708
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
709
+ # will be added to the HTTP request.
710
+ #
711
+ # @return [Concurrent::Promise] promise which provides async access to http
712
+ # response.
713
+ #
714
+ def delete_async(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers = nil)
715
+ # Send request
716
+ promise = begin_delete_async(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers)
717
+
718
+ promise = promise.then do |response|
719
+ # Defining deserialization method.
720
+ deserialize_method = lambda do |parsed_response|
721
+ end
722
+
723
+ # Waiting for response.
724
+ @client.get_long_running_operation_result(response, deserialize_method)
725
+ end
726
+
727
+ promise
728
+ end
729
+
730
+ #
731
+ # Gets the details of a Replication protected item.
732
+ #
733
+ # Gets the details of an ASR replication protected item.
734
+ #
735
+ # @param fabric_name [String] Fabric unique name.
736
+ # @param protection_container_name [String] Protection container name.
737
+ # @param replicated_protected_item_name [String] Replication protected item
738
+ # name.
739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
+ # will be added to the HTTP request.
741
+ #
742
+ # @return [ReplicationProtectedItem] operation results.
743
+ #
744
+ def get(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
745
+ response = get_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
746
+ response.body unless response.nil?
747
+ end
748
+
749
+ #
750
+ # Gets the details of a Replication protected item.
751
+ #
752
+ # Gets the details of an ASR replication protected item.
753
+ #
754
+ # @param fabric_name [String] Fabric unique name.
755
+ # @param protection_container_name [String] Protection container name.
756
+ # @param replicated_protected_item_name [String] Replication protected item
757
+ # name.
758
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
759
+ # will be added to the HTTP request.
760
+ #
761
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
762
+ #
763
+ def get_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
764
+ get_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
765
+ end
766
+
767
+ #
768
+ # Gets the details of a Replication protected item.
769
+ #
770
+ # Gets the details of an ASR replication protected item.
771
+ #
772
+ # @param fabric_name [String] Fabric unique name.
773
+ # @param protection_container_name [String] Protection container name.
774
+ # @param replicated_protected_item_name [String] Replication protected item
775
+ # name.
776
+ # @param [Hash{String => String}] A hash of custom headers that will be added
777
+ # to the HTTP request.
778
+ #
779
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
780
+ #
781
+ def get_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
782
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
783
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
784
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
785
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
786
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
787
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
788
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
789
+
790
+
791
+ request_headers = {}
792
+
793
+ # Set Headers
794
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
795
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
796
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'
797
+
798
+ request_url = @base_url || @client.base_url
799
+
800
+ options = {
801
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
802
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
803
+ query_params: {'api-version' => @client.api_version},
804
+ headers: request_headers.merge(custom_headers || {}),
805
+ base_url: request_url
806
+ }
807
+ promise = @client.make_request_async(:get, path_template, options)
808
+
809
+ promise = promise.then do |result|
810
+ http_response = result.response
811
+ status_code = http_response.status
812
+ response_content = http_response.body
813
+ unless status_code == 200
814
+ error_model = JSON.load(response_content)
815
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
816
+ end
817
+
818
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
819
+ # Deserialize Response
820
+ if status_code == 200
821
+ begin
822
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
823
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
824
+ result.body = @client.deserialize(result_mapper, parsed_response)
825
+ rescue Exception => e
826
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
827
+ end
828
+ end
829
+
830
+ result
831
+ end
832
+
833
+ promise.execute
834
+ end
835
+
836
+ #
837
+ # Enables protection.
838
+ #
839
+ # The operation to create an ASR replication protected item (Enable
840
+ # replication).
841
+ #
842
+ # @param fabric_name [String] Name of the fabric.
843
+ # @param protection_container_name [String] Protection container name.
844
+ # @param replicated_protected_item_name [String] A name for the replication
845
+ # protected item.
846
+ # @param input [EnableProtectionInput] Enable Protection Input.
847
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
848
+ # will be added to the HTTP request.
849
+ #
850
+ # @return [ReplicationProtectedItem] operation results.
851
+ #
852
+ def create(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers = nil)
853
+ response = create_async(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers).value!
854
+ response.body unless response.nil?
855
+ end
856
+
857
+ #
858
+ # @param fabric_name [String] Name of the fabric.
859
+ # @param protection_container_name [String] Protection container name.
860
+ # @param replicated_protected_item_name [String] A name for the replication
861
+ # protected item.
862
+ # @param input [EnableProtectionInput] Enable Protection Input.
863
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
864
+ # will be added to the HTTP request.
865
+ #
866
+ # @return [Concurrent::Promise] promise which provides async access to http
867
+ # response.
868
+ #
869
+ def create_async(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers = nil)
870
+ # Send request
871
+ promise = begin_create_async(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers)
872
+
873
+ promise = promise.then do |response|
874
+ # Defining deserialization method.
875
+ deserialize_method = lambda do |parsed_response|
876
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
877
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
878
+ end
879
+
880
+ # Waiting for response.
881
+ @client.get_long_running_operation_result(response, deserialize_method)
882
+ end
883
+
884
+ promise
885
+ end
886
+
887
+ #
888
+ # Purges protection.
889
+ #
890
+ # The operation to delete or purge a replication protected item. This operation
891
+ # will force delete the replication protected item. Use the remove operation on
892
+ # replication protected item to perform a clean disable replication for the
893
+ # item.
894
+ #
895
+ # @param fabric_name [String] Fabric name.
896
+ # @param protection_container_name [String] Protection container name.
897
+ # @param replicated_protected_item_name [String] Replication protected item
898
+ # name.
899
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
900
+ # will be added to the HTTP request.
901
+ #
902
+ def purge(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
903
+ response = purge_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
904
+ nil
905
+ end
906
+
907
+ #
908
+ # @param fabric_name [String] Fabric name.
909
+ # @param protection_container_name [String] Protection container name.
910
+ # @param replicated_protected_item_name [String] Replication protected item
911
+ # name.
912
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
913
+ # will be added to the HTTP request.
914
+ #
915
+ # @return [Concurrent::Promise] promise which provides async access to http
916
+ # response.
917
+ #
918
+ def purge_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
919
+ # Send request
920
+ promise = begin_purge_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers)
921
+
922
+ promise = promise.then do |response|
923
+ # Defining deserialization method.
924
+ deserialize_method = lambda do |parsed_response|
925
+ end
926
+
927
+ # Waiting for response.
928
+ @client.get_long_running_operation_result(response, deserialize_method)
929
+ end
930
+
931
+ promise
932
+ end
933
+
934
+ #
935
+ # Updates protection.
936
+ #
937
+ # The operation to update the recovery settings of an ASR replication protected
938
+ # item.
939
+ #
940
+ # @param fabric_name [String] Fabric name.
941
+ # @param protection_container_name [String] Protection container name.
942
+ # @param replicated_protected_item_name [String] Replication protected item
943
+ # name.
944
+ # @param update_protection_input [UpdateReplicationProtectedItemInput] Update
945
+ # protection input.
946
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
947
+ # will be added to the HTTP request.
948
+ #
949
+ # @return [ReplicationProtectedItem] operation results.
950
+ #
951
+ def update(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers = nil)
952
+ response = update_async(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers).value!
953
+ response.body unless response.nil?
954
+ end
955
+
956
+ #
957
+ # @param fabric_name [String] Fabric name.
958
+ # @param protection_container_name [String] Protection container name.
959
+ # @param replicated_protected_item_name [String] Replication protected item
960
+ # name.
961
+ # @param update_protection_input [UpdateReplicationProtectedItemInput] Update
962
+ # protection input.
963
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
964
+ # will be added to the HTTP request.
965
+ #
966
+ # @return [Concurrent::Promise] promise which provides async access to http
967
+ # response.
968
+ #
969
+ def update_async(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers = nil)
970
+ # Send request
971
+ promise = begin_update_async(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers)
972
+
973
+ promise = promise.then do |response|
974
+ # Defining deserialization method.
975
+ deserialize_method = lambda do |parsed_response|
976
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
977
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
978
+ end
979
+
980
+ # Waiting for response.
981
+ @client.get_long_running_operation_result(response, deserialize_method)
982
+ end
983
+
984
+ promise
985
+ end
986
+
987
+ #
988
+ # Change or apply recovery point.
989
+ #
990
+ # The operation to change the recovery point of a failed over replication
991
+ # protected item.
992
+ #
993
+ # @param fabric_name [String] The ARM fabric name.
994
+ # @param protection_container_name [String] The protection container name.
995
+ # @param replicated_protected_item_name [String] The replicated protected
996
+ # item's name.
997
+ # @param apply_recovery_point_input [ApplyRecoveryPointInput] The
998
+ # ApplyRecoveryPointInput.
999
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1000
+ # will be added to the HTTP request.
1001
+ #
1002
+ # @return [ReplicationProtectedItem] operation results.
1003
+ #
1004
+ def begin_apply_recovery_point(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers = nil)
1005
+ response = begin_apply_recovery_point_async(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers).value!
1006
+ response.body unless response.nil?
1007
+ end
1008
+
1009
+ #
1010
+ # Change or apply recovery point.
1011
+ #
1012
+ # The operation to change the recovery point of a failed over replication
1013
+ # protected item.
1014
+ #
1015
+ # @param fabric_name [String] The ARM fabric name.
1016
+ # @param protection_container_name [String] The protection container name.
1017
+ # @param replicated_protected_item_name [String] The replicated protected
1018
+ # item's name.
1019
+ # @param apply_recovery_point_input [ApplyRecoveryPointInput] The
1020
+ # ApplyRecoveryPointInput.
1021
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1022
+ # will be added to the HTTP request.
1023
+ #
1024
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1025
+ #
1026
+ def begin_apply_recovery_point_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers = nil)
1027
+ begin_apply_recovery_point_async(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers).value!
1028
+ end
1029
+
1030
+ #
1031
+ # Change or apply recovery point.
1032
+ #
1033
+ # The operation to change the recovery point of a failed over replication
1034
+ # protected item.
1035
+ #
1036
+ # @param fabric_name [String] The ARM fabric name.
1037
+ # @param protection_container_name [String] The protection container name.
1038
+ # @param replicated_protected_item_name [String] The replicated protected
1039
+ # item's name.
1040
+ # @param apply_recovery_point_input [ApplyRecoveryPointInput] The
1041
+ # ApplyRecoveryPointInput.
1042
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1043
+ # to the HTTP request.
1044
+ #
1045
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1046
+ #
1047
+ def begin_apply_recovery_point_async(fabric_name, protection_container_name, replicated_protected_item_name, apply_recovery_point_input, custom_headers = nil)
1048
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1049
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1050
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1051
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1052
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1053
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1054
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1055
+ fail ArgumentError, 'apply_recovery_point_input is nil' if apply_recovery_point_input.nil?
1056
+
1057
+
1058
+ request_headers = {}
1059
+
1060
+ # Set Headers
1061
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1062
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1063
+
1064
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1065
+
1066
+ # Serialize Request
1067
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ApplyRecoveryPointInput.mapper()
1068
+ request_content = @client.serialize(request_mapper, apply_recovery_point_input)
1069
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1070
+
1071
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint'
1072
+
1073
+ request_url = @base_url || @client.base_url
1074
+
1075
+ options = {
1076
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1077
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1078
+ query_params: {'api-version' => @client.api_version},
1079
+ body: request_content,
1080
+ headers: request_headers.merge(custom_headers || {}),
1081
+ base_url: request_url
1082
+ }
1083
+ promise = @client.make_request_async(:post, path_template, options)
1084
+
1085
+ promise = promise.then do |result|
1086
+ http_response = result.response
1087
+ status_code = http_response.status
1088
+ response_content = http_response.body
1089
+ unless status_code == 200 || status_code == 202
1090
+ error_model = JSON.load(response_content)
1091
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1092
+ end
1093
+
1094
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1095
+ # Deserialize Response
1096
+ if status_code == 200
1097
+ begin
1098
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1099
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1100
+ result.body = @client.deserialize(result_mapper, parsed_response)
1101
+ rescue Exception => e
1102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1103
+ end
1104
+ end
1105
+
1106
+ result
1107
+ end
1108
+
1109
+ promise.execute
1110
+ end
1111
+
1112
+ #
1113
+ # Resynchronize or repair replication.
1114
+ #
1115
+ # The operation to start resynchronize/repair replication for a replication
1116
+ # protected item requiring resynchronization.
1117
+ #
1118
+ # @param fabric_name [String] The name of the fabric.
1119
+ # @param protection_container_name [String] The name of the container.
1120
+ # @param replicated_protected_item_name [String] The name of the replication
1121
+ # protected item.
1122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1123
+ # will be added to the HTTP request.
1124
+ #
1125
+ # @return [ReplicationProtectedItem] operation results.
1126
+ #
1127
+ def begin_repair_replication(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
1128
+ response = begin_repair_replication_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
1129
+ response.body unless response.nil?
1130
+ end
1131
+
1132
+ #
1133
+ # Resynchronize or repair replication.
1134
+ #
1135
+ # The operation to start resynchronize/repair replication for a replication
1136
+ # protected item requiring resynchronization.
1137
+ #
1138
+ # @param fabric_name [String] The name of the fabric.
1139
+ # @param protection_container_name [String] The name of the container.
1140
+ # @param replicated_protected_item_name [String] The name of the replication
1141
+ # protected item.
1142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1143
+ # will be added to the HTTP request.
1144
+ #
1145
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1146
+ #
1147
+ def begin_repair_replication_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
1148
+ begin_repair_replication_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
1149
+ end
1150
+
1151
+ #
1152
+ # Resynchronize or repair replication.
1153
+ #
1154
+ # The operation to start resynchronize/repair replication for a replication
1155
+ # protected item requiring resynchronization.
1156
+ #
1157
+ # @param fabric_name [String] The name of the fabric.
1158
+ # @param protection_container_name [String] The name of the container.
1159
+ # @param replicated_protected_item_name [String] The name of the replication
1160
+ # protected item.
1161
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1162
+ # to the HTTP request.
1163
+ #
1164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1165
+ #
1166
+ def begin_repair_replication_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
1167
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1168
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1169
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1170
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1171
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1172
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1173
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1174
+
1175
+
1176
+ request_headers = {}
1177
+
1178
+ # Set Headers
1179
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1180
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1181
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication'
1182
+
1183
+ request_url = @base_url || @client.base_url
1184
+
1185
+ options = {
1186
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1187
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1188
+ query_params: {'api-version' => @client.api_version},
1189
+ headers: request_headers.merge(custom_headers || {}),
1190
+ base_url: request_url
1191
+ }
1192
+ promise = @client.make_request_async(:post, path_template, options)
1193
+
1194
+ promise = promise.then do |result|
1195
+ http_response = result.response
1196
+ status_code = http_response.status
1197
+ response_content = http_response.body
1198
+ unless status_code == 200 || status_code == 202
1199
+ error_model = JSON.load(response_content)
1200
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1201
+ end
1202
+
1203
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1204
+ # Deserialize Response
1205
+ if status_code == 200
1206
+ begin
1207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1208
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1209
+ result.body = @client.deserialize(result_mapper, parsed_response)
1210
+ rescue Exception => e
1211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1212
+ end
1213
+ end
1214
+
1215
+ result
1216
+ end
1217
+
1218
+ promise.execute
1219
+ end
1220
+
1221
+ #
1222
+ # Update the mobility service on a protected item.
1223
+ #
1224
+ # The operation to update(push update) the installed mobility service software
1225
+ # on a replication protected item to the latest available version.
1226
+ #
1227
+ # @param fabric_name [String] The name of the fabric containing the protected
1228
+ # item.
1229
+ # @param protection_container_name [String] The name of the container
1230
+ # containing the protected item.
1231
+ # @param replication_protected_item_name [String] The name of the protected
1232
+ # item on which the agent is to be updated.
1233
+ # @param update_mobility_service_request [UpdateMobilityServiceRequest] Request
1234
+ # to update the mobility service on the protected item.
1235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1236
+ # will be added to the HTTP request.
1237
+ #
1238
+ # @return [ReplicationProtectedItem] operation results.
1239
+ #
1240
+ def begin_update_mobility_service(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers = nil)
1241
+ response = begin_update_mobility_service_async(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers).value!
1242
+ response.body unless response.nil?
1243
+ end
1244
+
1245
+ #
1246
+ # Update the mobility service on a protected item.
1247
+ #
1248
+ # The operation to update(push update) the installed mobility service software
1249
+ # on a replication protected item to the latest available version.
1250
+ #
1251
+ # @param fabric_name [String] The name of the fabric containing the protected
1252
+ # item.
1253
+ # @param protection_container_name [String] The name of the container
1254
+ # containing the protected item.
1255
+ # @param replication_protected_item_name [String] The name of the protected
1256
+ # item on which the agent is to be updated.
1257
+ # @param update_mobility_service_request [UpdateMobilityServiceRequest] Request
1258
+ # to update the mobility service on the protected item.
1259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1260
+ # will be added to the HTTP request.
1261
+ #
1262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1263
+ #
1264
+ def begin_update_mobility_service_with_http_info(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers = nil)
1265
+ begin_update_mobility_service_async(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers).value!
1266
+ end
1267
+
1268
+ #
1269
+ # Update the mobility service on a protected item.
1270
+ #
1271
+ # The operation to update(push update) the installed mobility service software
1272
+ # on a replication protected item to the latest available version.
1273
+ #
1274
+ # @param fabric_name [String] The name of the fabric containing the protected
1275
+ # item.
1276
+ # @param protection_container_name [String] The name of the container
1277
+ # containing the protected item.
1278
+ # @param replication_protected_item_name [String] The name of the protected
1279
+ # item on which the agent is to be updated.
1280
+ # @param update_mobility_service_request [UpdateMobilityServiceRequest] Request
1281
+ # to update the mobility service on the protected item.
1282
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1283
+ # to the HTTP request.
1284
+ #
1285
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1286
+ #
1287
+ def begin_update_mobility_service_async(fabric_name, protection_container_name, replication_protected_item_name, update_mobility_service_request, custom_headers = nil)
1288
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1289
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1290
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1291
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1292
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1293
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1294
+ fail ArgumentError, 'replication_protected_item_name is nil' if replication_protected_item_name.nil?
1295
+ fail ArgumentError, 'update_mobility_service_request is nil' if update_mobility_service_request.nil?
1296
+
1297
+
1298
+ request_headers = {}
1299
+
1300
+ # Set Headers
1301
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1302
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1303
+
1304
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1305
+
1306
+ # Serialize Request
1307
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::UpdateMobilityServiceRequest.mapper()
1308
+ request_content = @client.serialize(request_mapper, update_mobility_service_request)
1309
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1310
+
1311
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService'
1312
+
1313
+ request_url = @base_url || @client.base_url
1314
+
1315
+ options = {
1316
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1317
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicationProtectedItemName' => replication_protected_item_name},
1318
+ query_params: {'api-version' => @client.api_version},
1319
+ body: request_content,
1320
+ headers: request_headers.merge(custom_headers || {}),
1321
+ base_url: request_url
1322
+ }
1323
+ promise = @client.make_request_async(:post, path_template, options)
1324
+
1325
+ promise = promise.then do |result|
1326
+ http_response = result.response
1327
+ status_code = http_response.status
1328
+ response_content = http_response.body
1329
+ unless status_code == 200 || status_code == 202
1330
+ error_model = JSON.load(response_content)
1331
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1332
+ end
1333
+
1334
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1335
+ # Deserialize Response
1336
+ if status_code == 200
1337
+ begin
1338
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1339
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1340
+ result.body = @client.deserialize(result_mapper, parsed_response)
1341
+ rescue Exception => e
1342
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1343
+ end
1344
+ end
1345
+
1346
+ result
1347
+ end
1348
+
1349
+ promise.execute
1350
+ end
1351
+
1352
+ #
1353
+ # Execute Reverse Replication\Reprotect
1354
+ #
1355
+ # Operation to reprotect or reverse replicate a failed over replication
1356
+ # protected item.
1357
+ #
1358
+ # @param fabric_name [String] Unique fabric name.
1359
+ # @param protection_container_name [String] Protection container name.
1360
+ # @param replicated_protected_item_name [String] Replication protected item
1361
+ # name.
1362
+ # @param rr_input [ReverseReplicationInput] Disable protection input.
1363
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1364
+ # will be added to the HTTP request.
1365
+ #
1366
+ # @return [ReplicationProtectedItem] operation results.
1367
+ #
1368
+ def begin_reprotect(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers = nil)
1369
+ response = begin_reprotect_async(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers).value!
1370
+ response.body unless response.nil?
1371
+ end
1372
+
1373
+ #
1374
+ # Execute Reverse Replication\Reprotect
1375
+ #
1376
+ # Operation to reprotect or reverse replicate a failed over replication
1377
+ # protected item.
1378
+ #
1379
+ # @param fabric_name [String] Unique fabric name.
1380
+ # @param protection_container_name [String] Protection container name.
1381
+ # @param replicated_protected_item_name [String] Replication protected item
1382
+ # name.
1383
+ # @param rr_input [ReverseReplicationInput] Disable protection input.
1384
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1385
+ # will be added to the HTTP request.
1386
+ #
1387
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1388
+ #
1389
+ def begin_reprotect_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers = nil)
1390
+ begin_reprotect_async(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers).value!
1391
+ end
1392
+
1393
+ #
1394
+ # Execute Reverse Replication\Reprotect
1395
+ #
1396
+ # Operation to reprotect or reverse replicate a failed over replication
1397
+ # protected item.
1398
+ #
1399
+ # @param fabric_name [String] Unique fabric name.
1400
+ # @param protection_container_name [String] Protection container name.
1401
+ # @param replicated_protected_item_name [String] Replication protected item
1402
+ # name.
1403
+ # @param rr_input [ReverseReplicationInput] Disable protection input.
1404
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1405
+ # to the HTTP request.
1406
+ #
1407
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1408
+ #
1409
+ def begin_reprotect_async(fabric_name, protection_container_name, replicated_protected_item_name, rr_input, custom_headers = nil)
1410
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1411
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1412
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1413
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1414
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1415
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1416
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1417
+ fail ArgumentError, 'rr_input is nil' if rr_input.nil?
1418
+
1419
+
1420
+ request_headers = {}
1421
+
1422
+ # Set Headers
1423
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1424
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1425
+
1426
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1427
+
1428
+ # Serialize Request
1429
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReverseReplicationInput.mapper()
1430
+ request_content = @client.serialize(request_mapper, rr_input)
1431
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1432
+
1433
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect'
1434
+
1435
+ request_url = @base_url || @client.base_url
1436
+
1437
+ options = {
1438
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1439
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1440
+ query_params: {'api-version' => @client.api_version},
1441
+ body: request_content,
1442
+ headers: request_headers.merge(custom_headers || {}),
1443
+ base_url: request_url
1444
+ }
1445
+ promise = @client.make_request_async(:post, path_template, options)
1446
+
1447
+ promise = promise.then do |result|
1448
+ http_response = result.response
1449
+ status_code = http_response.status
1450
+ response_content = http_response.body
1451
+ unless status_code == 200 || status_code == 202
1452
+ error_model = JSON.load(response_content)
1453
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1454
+ end
1455
+
1456
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1457
+ # Deserialize Response
1458
+ if status_code == 200
1459
+ begin
1460
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1461
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1462
+ result.body = @client.deserialize(result_mapper, parsed_response)
1463
+ rescue Exception => e
1464
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1465
+ end
1466
+ end
1467
+
1468
+ result
1469
+ end
1470
+
1471
+ promise.execute
1472
+ end
1473
+
1474
+ #
1475
+ # Execute commit failover
1476
+ #
1477
+ # Operation to commit the failover of the replication protected item.
1478
+ #
1479
+ # @param fabric_name [String] Unique fabric name.
1480
+ # @param protection_container_name [String] Protection container name.
1481
+ # @param replicated_protected_item_name [String] Replication protected item
1482
+ # name.
1483
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1484
+ # will be added to the HTTP request.
1485
+ #
1486
+ # @return [ReplicationProtectedItem] operation results.
1487
+ #
1488
+ def begin_failover_commit(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
1489
+ response = begin_failover_commit_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
1490
+ response.body unless response.nil?
1491
+ end
1492
+
1493
+ #
1494
+ # Execute commit failover
1495
+ #
1496
+ # Operation to commit the failover of the replication protected item.
1497
+ #
1498
+ # @param fabric_name [String] Unique fabric name.
1499
+ # @param protection_container_name [String] Protection container name.
1500
+ # @param replicated_protected_item_name [String] Replication protected item
1501
+ # name.
1502
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1503
+ # will be added to the HTTP request.
1504
+ #
1505
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1506
+ #
1507
+ def begin_failover_commit_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
1508
+ begin_failover_commit_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
1509
+ end
1510
+
1511
+ #
1512
+ # Execute commit failover
1513
+ #
1514
+ # Operation to commit the failover of the replication protected item.
1515
+ #
1516
+ # @param fabric_name [String] Unique fabric name.
1517
+ # @param protection_container_name [String] Protection container name.
1518
+ # @param replicated_protected_item_name [String] Replication protected item
1519
+ # name.
1520
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1521
+ # to the HTTP request.
1522
+ #
1523
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1524
+ #
1525
+ def begin_failover_commit_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
1526
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1527
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1528
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1529
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1530
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1531
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1532
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1533
+
1534
+
1535
+ request_headers = {}
1536
+
1537
+ # Set Headers
1538
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1539
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1540
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit'
1541
+
1542
+ request_url = @base_url || @client.base_url
1543
+
1544
+ options = {
1545
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1546
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1547
+ query_params: {'api-version' => @client.api_version},
1548
+ headers: request_headers.merge(custom_headers || {}),
1549
+ base_url: request_url
1550
+ }
1551
+ promise = @client.make_request_async(:post, path_template, options)
1552
+
1553
+ promise = promise.then do |result|
1554
+ http_response = result.response
1555
+ status_code = http_response.status
1556
+ response_content = http_response.body
1557
+ unless status_code == 200 || status_code == 202
1558
+ error_model = JSON.load(response_content)
1559
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1560
+ end
1561
+
1562
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1563
+ # Deserialize Response
1564
+ if status_code == 200
1565
+ begin
1566
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1567
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1568
+ result.body = @client.deserialize(result_mapper, parsed_response)
1569
+ rescue Exception => e
1570
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1571
+ end
1572
+ end
1573
+
1574
+ result
1575
+ end
1576
+
1577
+ promise.execute
1578
+ end
1579
+
1580
+ #
1581
+ # Execute test failover cleanup.
1582
+ #
1583
+ # Operation to clean up the test failover of a replication protected item.
1584
+ #
1585
+ # @param fabric_name [String] Unique fabric name.
1586
+ # @param protection_container_name [String] Protection container name.
1587
+ # @param replicated_protected_item_name [String] Replication protected item
1588
+ # name.
1589
+ # @param cleanup_input [TestFailoverCleanupInput] Test failover cleanup input.
1590
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1591
+ # will be added to the HTTP request.
1592
+ #
1593
+ # @return [ReplicationProtectedItem] operation results.
1594
+ #
1595
+ def begin_test_failover_cleanup(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers = nil)
1596
+ response = begin_test_failover_cleanup_async(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers).value!
1597
+ response.body unless response.nil?
1598
+ end
1599
+
1600
+ #
1601
+ # Execute test failover cleanup.
1602
+ #
1603
+ # Operation to clean up the test failover of a replication protected item.
1604
+ #
1605
+ # @param fabric_name [String] Unique fabric name.
1606
+ # @param protection_container_name [String] Protection container name.
1607
+ # @param replicated_protected_item_name [String] Replication protected item
1608
+ # name.
1609
+ # @param cleanup_input [TestFailoverCleanupInput] Test failover cleanup input.
1610
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1611
+ # will be added to the HTTP request.
1612
+ #
1613
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1614
+ #
1615
+ def begin_test_failover_cleanup_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers = nil)
1616
+ begin_test_failover_cleanup_async(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers).value!
1617
+ end
1618
+
1619
+ #
1620
+ # Execute test failover cleanup.
1621
+ #
1622
+ # Operation to clean up the test failover of a replication protected item.
1623
+ #
1624
+ # @param fabric_name [String] Unique fabric name.
1625
+ # @param protection_container_name [String] Protection container name.
1626
+ # @param replicated_protected_item_name [String] Replication protected item
1627
+ # name.
1628
+ # @param cleanup_input [TestFailoverCleanupInput] Test failover cleanup input.
1629
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1630
+ # to the HTTP request.
1631
+ #
1632
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1633
+ #
1634
+ def begin_test_failover_cleanup_async(fabric_name, protection_container_name, replicated_protected_item_name, cleanup_input, custom_headers = nil)
1635
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1636
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1637
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1638
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1639
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1640
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1641
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1642
+ fail ArgumentError, 'cleanup_input is nil' if cleanup_input.nil?
1643
+
1644
+
1645
+ request_headers = {}
1646
+
1647
+ # Set Headers
1648
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1649
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1650
+
1651
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1652
+
1653
+ # Serialize Request
1654
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::TestFailoverCleanupInput.mapper()
1655
+ request_content = @client.serialize(request_mapper, cleanup_input)
1656
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1657
+
1658
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup'
1659
+
1660
+ request_url = @base_url || @client.base_url
1661
+
1662
+ options = {
1663
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1664
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1665
+ query_params: {'api-version' => @client.api_version},
1666
+ body: request_content,
1667
+ headers: request_headers.merge(custom_headers || {}),
1668
+ base_url: request_url
1669
+ }
1670
+ promise = @client.make_request_async(:post, path_template, options)
1671
+
1672
+ promise = promise.then do |result|
1673
+ http_response = result.response
1674
+ status_code = http_response.status
1675
+ response_content = http_response.body
1676
+ unless status_code == 200 || status_code == 202
1677
+ error_model = JSON.load(response_content)
1678
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1679
+ end
1680
+
1681
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1682
+ # Deserialize Response
1683
+ if status_code == 200
1684
+ begin
1685
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1686
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1687
+ result.body = @client.deserialize(result_mapper, parsed_response)
1688
+ rescue Exception => e
1689
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1690
+ end
1691
+ end
1692
+
1693
+ result
1694
+ end
1695
+
1696
+ promise.execute
1697
+ end
1698
+
1699
+ #
1700
+ # Execute test failover
1701
+ #
1702
+ # Operation to perform a test failover of the replication protected item.
1703
+ #
1704
+ # @param fabric_name [String] Unique fabric name.
1705
+ # @param protection_container_name [String] Protection container name.
1706
+ # @param replicated_protected_item_name [String] Replication protected item
1707
+ # name.
1708
+ # @param failover_input [TestFailoverInput] Test failover input.
1709
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1710
+ # will be added to the HTTP request.
1711
+ #
1712
+ # @return [ReplicationProtectedItem] operation results.
1713
+ #
1714
+ def begin_test_failover(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1715
+ response = begin_test_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
1716
+ response.body unless response.nil?
1717
+ end
1718
+
1719
+ #
1720
+ # Execute test failover
1721
+ #
1722
+ # Operation to perform a test failover of the replication protected item.
1723
+ #
1724
+ # @param fabric_name [String] Unique fabric name.
1725
+ # @param protection_container_name [String] Protection container name.
1726
+ # @param replicated_protected_item_name [String] Replication protected item
1727
+ # name.
1728
+ # @param failover_input [TestFailoverInput] Test failover input.
1729
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1730
+ # will be added to the HTTP request.
1731
+ #
1732
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1733
+ #
1734
+ def begin_test_failover_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1735
+ begin_test_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
1736
+ end
1737
+
1738
+ #
1739
+ # Execute test failover
1740
+ #
1741
+ # Operation to perform a test failover of the replication protected item.
1742
+ #
1743
+ # @param fabric_name [String] Unique fabric name.
1744
+ # @param protection_container_name [String] Protection container name.
1745
+ # @param replicated_protected_item_name [String] Replication protected item
1746
+ # name.
1747
+ # @param failover_input [TestFailoverInput] Test failover input.
1748
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1749
+ # to the HTTP request.
1750
+ #
1751
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1752
+ #
1753
+ def begin_test_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1754
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1755
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1756
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1757
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1758
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1759
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1760
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1761
+ fail ArgumentError, 'failover_input is nil' if failover_input.nil?
1762
+
1763
+
1764
+ request_headers = {}
1765
+
1766
+ # Set Headers
1767
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1768
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1769
+
1770
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1771
+
1772
+ # Serialize Request
1773
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::TestFailoverInput.mapper()
1774
+ request_content = @client.serialize(request_mapper, failover_input)
1775
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1776
+
1777
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover'
1778
+
1779
+ request_url = @base_url || @client.base_url
1780
+
1781
+ options = {
1782
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1783
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1784
+ query_params: {'api-version' => @client.api_version},
1785
+ body: request_content,
1786
+ headers: request_headers.merge(custom_headers || {}),
1787
+ base_url: request_url
1788
+ }
1789
+ promise = @client.make_request_async(:post, path_template, options)
1790
+
1791
+ promise = promise.then do |result|
1792
+ http_response = result.response
1793
+ status_code = http_response.status
1794
+ response_content = http_response.body
1795
+ unless status_code == 200 || status_code == 202
1796
+ error_model = JSON.load(response_content)
1797
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1798
+ end
1799
+
1800
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1801
+ # Deserialize Response
1802
+ if status_code == 200
1803
+ begin
1804
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1805
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1806
+ result.body = @client.deserialize(result_mapper, parsed_response)
1807
+ rescue Exception => e
1808
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1809
+ end
1810
+ end
1811
+
1812
+ result
1813
+ end
1814
+
1815
+ promise.execute
1816
+ end
1817
+
1818
+ #
1819
+ # Execute unplanned failover
1820
+ #
1821
+ # Operation to initiate a failover of the replication protected item.
1822
+ #
1823
+ # @param fabric_name [String] Unique fabric name.
1824
+ # @param protection_container_name [String] Protection container name.
1825
+ # @param replicated_protected_item_name [String] Replication protected item
1826
+ # name.
1827
+ # @param failover_input [UnplannedFailoverInput] Disable protection input.
1828
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1829
+ # will be added to the HTTP request.
1830
+ #
1831
+ # @return [ReplicationProtectedItem] operation results.
1832
+ #
1833
+ def begin_unplanned_failover(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1834
+ response = begin_unplanned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
1835
+ response.body unless response.nil?
1836
+ end
1837
+
1838
+ #
1839
+ # Execute unplanned failover
1840
+ #
1841
+ # Operation to initiate a failover of the replication protected item.
1842
+ #
1843
+ # @param fabric_name [String] Unique fabric name.
1844
+ # @param protection_container_name [String] Protection container name.
1845
+ # @param replicated_protected_item_name [String] Replication protected item
1846
+ # name.
1847
+ # @param failover_input [UnplannedFailoverInput] Disable protection input.
1848
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1849
+ # will be added to the HTTP request.
1850
+ #
1851
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1852
+ #
1853
+ def begin_unplanned_failover_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1854
+ begin_unplanned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
1855
+ end
1856
+
1857
+ #
1858
+ # Execute unplanned failover
1859
+ #
1860
+ # Operation to initiate a failover of the replication protected item.
1861
+ #
1862
+ # @param fabric_name [String] Unique fabric name.
1863
+ # @param protection_container_name [String] Protection container name.
1864
+ # @param replicated_protected_item_name [String] Replication protected item
1865
+ # name.
1866
+ # @param failover_input [UnplannedFailoverInput] Disable protection input.
1867
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1868
+ # to the HTTP request.
1869
+ #
1870
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1871
+ #
1872
+ def begin_unplanned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1873
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1874
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1875
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1876
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1877
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1878
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1879
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1880
+ fail ArgumentError, 'failover_input is nil' if failover_input.nil?
1881
+
1882
+
1883
+ request_headers = {}
1884
+
1885
+ # Set Headers
1886
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1887
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1888
+
1889
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1890
+
1891
+ # Serialize Request
1892
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::UnplannedFailoverInput.mapper()
1893
+ request_content = @client.serialize(request_mapper, failover_input)
1894
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1895
+
1896
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover'
1897
+
1898
+ request_url = @base_url || @client.base_url
1899
+
1900
+ options = {
1901
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1902
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
1903
+ query_params: {'api-version' => @client.api_version},
1904
+ body: request_content,
1905
+ headers: request_headers.merge(custom_headers || {}),
1906
+ base_url: request_url
1907
+ }
1908
+ promise = @client.make_request_async(:post, path_template, options)
1909
+
1910
+ promise = promise.then do |result|
1911
+ http_response = result.response
1912
+ status_code = http_response.status
1913
+ response_content = http_response.body
1914
+ unless status_code == 200 || status_code == 202
1915
+ error_model = JSON.load(response_content)
1916
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1917
+ end
1918
+
1919
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1920
+ # Deserialize Response
1921
+ if status_code == 200
1922
+ begin
1923
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1924
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
1925
+ result.body = @client.deserialize(result_mapper, parsed_response)
1926
+ rescue Exception => e
1927
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1928
+ end
1929
+ end
1930
+
1931
+ result
1932
+ end
1933
+
1934
+ promise.execute
1935
+ end
1936
+
1937
+ #
1938
+ # Execute planned failover
1939
+ #
1940
+ # Operation to initiate a planned failover of the replication protected item.
1941
+ #
1942
+ # @param fabric_name [String] Unique fabric name.
1943
+ # @param protection_container_name [String] Protection container name.
1944
+ # @param replicated_protected_item_name [String] Replication protected item
1945
+ # name.
1946
+ # @param failover_input [PlannedFailoverInput] Disable protection input.
1947
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1948
+ # will be added to the HTTP request.
1949
+ #
1950
+ # @return [ReplicationProtectedItem] operation results.
1951
+ #
1952
+ def begin_planned_failover(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1953
+ response = begin_planned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
1954
+ response.body unless response.nil?
1955
+ end
1956
+
1957
+ #
1958
+ # Execute planned failover
1959
+ #
1960
+ # Operation to initiate a planned failover of the replication protected item.
1961
+ #
1962
+ # @param fabric_name [String] Unique fabric name.
1963
+ # @param protection_container_name [String] Protection container name.
1964
+ # @param replicated_protected_item_name [String] Replication protected item
1965
+ # name.
1966
+ # @param failover_input [PlannedFailoverInput] Disable protection input.
1967
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1968
+ # will be added to the HTTP request.
1969
+ #
1970
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1971
+ #
1972
+ def begin_planned_failover_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1973
+ begin_planned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers).value!
1974
+ end
1975
+
1976
+ #
1977
+ # Execute planned failover
1978
+ #
1979
+ # Operation to initiate a planned failover of the replication protected item.
1980
+ #
1981
+ # @param fabric_name [String] Unique fabric name.
1982
+ # @param protection_container_name [String] Protection container name.
1983
+ # @param replicated_protected_item_name [String] Replication protected item
1984
+ # name.
1985
+ # @param failover_input [PlannedFailoverInput] Disable protection input.
1986
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1987
+ # to the HTTP request.
1988
+ #
1989
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1990
+ #
1991
+ def begin_planned_failover_async(fabric_name, protection_container_name, replicated_protected_item_name, failover_input, custom_headers = nil)
1992
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1993
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
1994
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
1995
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1996
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
1997
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
1998
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
1999
+ fail ArgumentError, 'failover_input is nil' if failover_input.nil?
2000
+
2001
+
2002
+ request_headers = {}
2003
+
2004
+ # Set Headers
2005
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2006
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2007
+
2008
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2009
+
2010
+ # Serialize Request
2011
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::PlannedFailoverInput.mapper()
2012
+ request_content = @client.serialize(request_mapper, failover_input)
2013
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2014
+
2015
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover'
2016
+
2017
+ request_url = @base_url || @client.base_url
2018
+
2019
+ options = {
2020
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2021
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
2022
+ query_params: {'api-version' => @client.api_version},
2023
+ body: request_content,
2024
+ headers: request_headers.merge(custom_headers || {}),
2025
+ base_url: request_url
2026
+ }
2027
+ promise = @client.make_request_async(:post, path_template, options)
2028
+
2029
+ promise = promise.then do |result|
2030
+ http_response = result.response
2031
+ status_code = http_response.status
2032
+ response_content = http_response.body
2033
+ unless status_code == 200 || status_code == 202
2034
+ error_model = JSON.load(response_content)
2035
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2036
+ end
2037
+
2038
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2039
+ # Deserialize Response
2040
+ if status_code == 200
2041
+ begin
2042
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2043
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
2044
+ result.body = @client.deserialize(result_mapper, parsed_response)
2045
+ rescue Exception => e
2046
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2047
+ end
2048
+ end
2049
+
2050
+ result
2051
+ end
2052
+
2053
+ promise.execute
2054
+ end
2055
+
2056
+ #
2057
+ # Disables protection.
2058
+ #
2059
+ # The operation to disable replication on a replication protected item. This
2060
+ # will also remove the item.
2061
+ #
2062
+ # @param fabric_name [String] Fabric name.
2063
+ # @param protection_container_name [String] Protection container name.
2064
+ # @param replicated_protected_item_name [String] Replication protected item
2065
+ # name.
2066
+ # @param disable_protection_input [DisableProtectionInput] Disable protection
2067
+ # input.
2068
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2069
+ # will be added to the HTTP request.
2070
+ #
2071
+ #
2072
+ def begin_delete(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers = nil)
2073
+ response = begin_delete_async(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers).value!
2074
+ nil
2075
+ end
2076
+
2077
+ #
2078
+ # Disables protection.
2079
+ #
2080
+ # The operation to disable replication on a replication protected item. This
2081
+ # will also remove the item.
2082
+ #
2083
+ # @param fabric_name [String] Fabric name.
2084
+ # @param protection_container_name [String] Protection container name.
2085
+ # @param replicated_protected_item_name [String] Replication protected item
2086
+ # name.
2087
+ # @param disable_protection_input [DisableProtectionInput] Disable protection
2088
+ # input.
2089
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2090
+ # will be added to the HTTP request.
2091
+ #
2092
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2093
+ #
2094
+ def begin_delete_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers = nil)
2095
+ begin_delete_async(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers).value!
2096
+ end
2097
+
2098
+ #
2099
+ # Disables protection.
2100
+ #
2101
+ # The operation to disable replication on a replication protected item. This
2102
+ # will also remove the item.
2103
+ #
2104
+ # @param fabric_name [String] Fabric name.
2105
+ # @param protection_container_name [String] Protection container name.
2106
+ # @param replicated_protected_item_name [String] Replication protected item
2107
+ # name.
2108
+ # @param disable_protection_input [DisableProtectionInput] Disable protection
2109
+ # input.
2110
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2111
+ # to the HTTP request.
2112
+ #
2113
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2114
+ #
2115
+ def begin_delete_async(fabric_name, protection_container_name, replicated_protected_item_name, disable_protection_input, custom_headers = nil)
2116
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2117
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
2118
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
2119
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2120
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
2121
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
2122
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
2123
+ fail ArgumentError, 'disable_protection_input is nil' if disable_protection_input.nil?
2124
+
2125
+
2126
+ request_headers = {}
2127
+
2128
+ # Set Headers
2129
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2130
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2131
+
2132
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2133
+
2134
+ # Serialize Request
2135
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::DisableProtectionInput.mapper()
2136
+ request_content = @client.serialize(request_mapper, disable_protection_input)
2137
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2138
+
2139
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove'
2140
+
2141
+ request_url = @base_url || @client.base_url
2142
+
2143
+ options = {
2144
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2145
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
2146
+ query_params: {'api-version' => @client.api_version},
2147
+ body: request_content,
2148
+ headers: request_headers.merge(custom_headers || {}),
2149
+ base_url: request_url
2150
+ }
2151
+ promise = @client.make_request_async(:post, path_template, options)
2152
+
2153
+ promise = promise.then do |result|
2154
+ http_response = result.response
2155
+ status_code = http_response.status
2156
+ response_content = http_response.body
2157
+ unless status_code == 202 || status_code == 204
2158
+ error_model = JSON.load(response_content)
2159
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2160
+ end
2161
+
2162
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2163
+
2164
+ result
2165
+ end
2166
+
2167
+ promise.execute
2168
+ end
2169
+
2170
+ #
2171
+ # Enables protection.
2172
+ #
2173
+ # The operation to create an ASR replication protected item (Enable
2174
+ # replication).
2175
+ #
2176
+ # @param fabric_name [String] Name of the fabric.
2177
+ # @param protection_container_name [String] Protection container name.
2178
+ # @param replicated_protected_item_name [String] A name for the replication
2179
+ # protected item.
2180
+ # @param input [EnableProtectionInput] Enable Protection Input.
2181
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2182
+ # will be added to the HTTP request.
2183
+ #
2184
+ # @return [ReplicationProtectedItem] operation results.
2185
+ #
2186
+ def begin_create(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers = nil)
2187
+ response = begin_create_async(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers).value!
2188
+ response.body unless response.nil?
2189
+ end
2190
+
2191
+ #
2192
+ # Enables protection.
2193
+ #
2194
+ # The operation to create an ASR replication protected item (Enable
2195
+ # replication).
2196
+ #
2197
+ # @param fabric_name [String] Name of the fabric.
2198
+ # @param protection_container_name [String] Protection container name.
2199
+ # @param replicated_protected_item_name [String] A name for the replication
2200
+ # protected item.
2201
+ # @param input [EnableProtectionInput] Enable Protection Input.
2202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2203
+ # will be added to the HTTP request.
2204
+ #
2205
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2206
+ #
2207
+ def begin_create_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers = nil)
2208
+ begin_create_async(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers).value!
2209
+ end
2210
+
2211
+ #
2212
+ # Enables protection.
2213
+ #
2214
+ # The operation to create an ASR replication protected item (Enable
2215
+ # replication).
2216
+ #
2217
+ # @param fabric_name [String] Name of the fabric.
2218
+ # @param protection_container_name [String] Protection container name.
2219
+ # @param replicated_protected_item_name [String] A name for the replication
2220
+ # protected item.
2221
+ # @param input [EnableProtectionInput] Enable Protection Input.
2222
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2223
+ # to the HTTP request.
2224
+ #
2225
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2226
+ #
2227
+ def begin_create_async(fabric_name, protection_container_name, replicated_protected_item_name, input, custom_headers = nil)
2228
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2229
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
2230
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
2231
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2232
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
2233
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
2234
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
2235
+ fail ArgumentError, 'input is nil' if input.nil?
2236
+
2237
+
2238
+ request_headers = {}
2239
+
2240
+ # Set Headers
2241
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2242
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2243
+
2244
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2245
+
2246
+ # Serialize Request
2247
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::EnableProtectionInput.mapper()
2248
+ request_content = @client.serialize(request_mapper, input)
2249
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2250
+
2251
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'
2252
+
2253
+ request_url = @base_url || @client.base_url
2254
+
2255
+ options = {
2256
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2257
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
2258
+ query_params: {'api-version' => @client.api_version},
2259
+ body: request_content,
2260
+ headers: request_headers.merge(custom_headers || {}),
2261
+ base_url: request_url
2262
+ }
2263
+ promise = @client.make_request_async(:put, path_template, options)
2264
+
2265
+ promise = promise.then do |result|
2266
+ http_response = result.response
2267
+ status_code = http_response.status
2268
+ response_content = http_response.body
2269
+ unless status_code == 200 || status_code == 202
2270
+ error_model = JSON.load(response_content)
2271
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2272
+ end
2273
+
2274
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2275
+ # Deserialize Response
2276
+ if status_code == 200
2277
+ begin
2278
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2279
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
2280
+ result.body = @client.deserialize(result_mapper, parsed_response)
2281
+ rescue Exception => e
2282
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2283
+ end
2284
+ end
2285
+
2286
+ result
2287
+ end
2288
+
2289
+ promise.execute
2290
+ end
2291
+
2292
+ #
2293
+ # Purges protection.
2294
+ #
2295
+ # The operation to delete or purge a replication protected item. This operation
2296
+ # will force delete the replication protected item. Use the remove operation on
2297
+ # replication protected item to perform a clean disable replication for the
2298
+ # item.
2299
+ #
2300
+ # @param fabric_name [String] Fabric name.
2301
+ # @param protection_container_name [String] Protection container name.
2302
+ # @param replicated_protected_item_name [String] Replication protected item
2303
+ # name.
2304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2305
+ # will be added to the HTTP request.
2306
+ #
2307
+ #
2308
+ def begin_purge(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
2309
+ response = begin_purge_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
2310
+ nil
2311
+ end
2312
+
2313
+ #
2314
+ # Purges protection.
2315
+ #
2316
+ # The operation to delete or purge a replication protected item. This operation
2317
+ # will force delete the replication protected item. Use the remove operation on
2318
+ # replication protected item to perform a clean disable replication for the
2319
+ # item.
2320
+ #
2321
+ # @param fabric_name [String] Fabric name.
2322
+ # @param protection_container_name [String] Protection container name.
2323
+ # @param replicated_protected_item_name [String] Replication protected item
2324
+ # name.
2325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2326
+ # will be added to the HTTP request.
2327
+ #
2328
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2329
+ #
2330
+ def begin_purge_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
2331
+ begin_purge_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers).value!
2332
+ end
2333
+
2334
+ #
2335
+ # Purges protection.
2336
+ #
2337
+ # The operation to delete or purge a replication protected item. This operation
2338
+ # will force delete the replication protected item. Use the remove operation on
2339
+ # replication protected item to perform a clean disable replication for the
2340
+ # item.
2341
+ #
2342
+ # @param fabric_name [String] Fabric name.
2343
+ # @param protection_container_name [String] Protection container name.
2344
+ # @param replicated_protected_item_name [String] Replication protected item
2345
+ # name.
2346
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2347
+ # to the HTTP request.
2348
+ #
2349
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2350
+ #
2351
+ def begin_purge_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers = nil)
2352
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2353
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
2354
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
2355
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2356
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
2357
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
2358
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
2359
+
2360
+
2361
+ request_headers = {}
2362
+
2363
+ # Set Headers
2364
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2365
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2366
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'
2367
+
2368
+ request_url = @base_url || @client.base_url
2369
+
2370
+ options = {
2371
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2372
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
2373
+ query_params: {'api-version' => @client.api_version},
2374
+ headers: request_headers.merge(custom_headers || {}),
2375
+ base_url: request_url
2376
+ }
2377
+ promise = @client.make_request_async(:delete, path_template, options)
2378
+
2379
+ promise = promise.then do |result|
2380
+ http_response = result.response
2381
+ status_code = http_response.status
2382
+ response_content = http_response.body
2383
+ unless status_code == 202 || status_code == 204
2384
+ error_model = JSON.load(response_content)
2385
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2386
+ end
2387
+
2388
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2389
+
2390
+ result
2391
+ end
2392
+
2393
+ promise.execute
2394
+ end
2395
+
2396
+ #
2397
+ # Updates protection.
2398
+ #
2399
+ # The operation to update the recovery settings of an ASR replication protected
2400
+ # item.
2401
+ #
2402
+ # @param fabric_name [String] Fabric name.
2403
+ # @param protection_container_name [String] Protection container name.
2404
+ # @param replicated_protected_item_name [String] Replication protected item
2405
+ # name.
2406
+ # @param update_protection_input [UpdateReplicationProtectedItemInput] Update
2407
+ # protection input.
2408
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2409
+ # will be added to the HTTP request.
2410
+ #
2411
+ # @return [ReplicationProtectedItem] operation results.
2412
+ #
2413
+ def begin_update(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers = nil)
2414
+ response = begin_update_async(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers).value!
2415
+ response.body unless response.nil?
2416
+ end
2417
+
2418
+ #
2419
+ # Updates protection.
2420
+ #
2421
+ # The operation to update the recovery settings of an ASR replication protected
2422
+ # item.
2423
+ #
2424
+ # @param fabric_name [String] Fabric name.
2425
+ # @param protection_container_name [String] Protection container name.
2426
+ # @param replicated_protected_item_name [String] Replication protected item
2427
+ # name.
2428
+ # @param update_protection_input [UpdateReplicationProtectedItemInput] Update
2429
+ # protection input.
2430
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2431
+ # will be added to the HTTP request.
2432
+ #
2433
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2434
+ #
2435
+ def begin_update_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers = nil)
2436
+ begin_update_async(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers).value!
2437
+ end
2438
+
2439
+ #
2440
+ # Updates protection.
2441
+ #
2442
+ # The operation to update the recovery settings of an ASR replication protected
2443
+ # item.
2444
+ #
2445
+ # @param fabric_name [String] Fabric name.
2446
+ # @param protection_container_name [String] Protection container name.
2447
+ # @param replicated_protected_item_name [String] Replication protected item
2448
+ # name.
2449
+ # @param update_protection_input [UpdateReplicationProtectedItemInput] Update
2450
+ # protection input.
2451
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2452
+ # to the HTTP request.
2453
+ #
2454
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2455
+ #
2456
+ def begin_update_async(fabric_name, protection_container_name, replicated_protected_item_name, update_protection_input, custom_headers = nil)
2457
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2458
+ fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
2459
+ fail ArgumentError, '@client.resource_group_name is nil' if @client.resource_group_name.nil?
2460
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2461
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
2462
+ fail ArgumentError, 'protection_container_name is nil' if protection_container_name.nil?
2463
+ fail ArgumentError, 'replicated_protected_item_name is nil' if replicated_protected_item_name.nil?
2464
+ fail ArgumentError, 'update_protection_input is nil' if update_protection_input.nil?
2465
+
2466
+
2467
+ request_headers = {}
2468
+
2469
+ # Set Headers
2470
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2471
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2472
+
2473
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2474
+
2475
+ # Serialize Request
2476
+ request_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::UpdateReplicationProtectedItemInput.mapper()
2477
+ request_content = @client.serialize(request_mapper, update_protection_input)
2478
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2479
+
2480
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'
2481
+
2482
+ request_url = @base_url || @client.base_url
2483
+
2484
+ options = {
2485
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2486
+ path_params: {'resourceName' => @client.resource_name,'resourceGroupName' => @client.resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'protectionContainerName' => protection_container_name,'replicatedProtectedItemName' => replicated_protected_item_name},
2487
+ query_params: {'api-version' => @client.api_version},
2488
+ body: request_content,
2489
+ headers: request_headers.merge(custom_headers || {}),
2490
+ base_url: request_url
2491
+ }
2492
+ promise = @client.make_request_async(:patch, path_template, options)
2493
+
2494
+ promise = promise.then do |result|
2495
+ http_response = result.response
2496
+ status_code = http_response.status
2497
+ response_content = http_response.body
2498
+ unless status_code == 200 || status_code == 202
2499
+ error_model = JSON.load(response_content)
2500
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2501
+ end
2502
+
2503
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2504
+ # Deserialize Response
2505
+ if status_code == 200
2506
+ begin
2507
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2508
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItem.mapper()
2509
+ result.body = @client.deserialize(result_mapper, parsed_response)
2510
+ rescue Exception => e
2511
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2512
+ end
2513
+ end
2514
+
2515
+ result
2516
+ end
2517
+
2518
+ promise.execute
2519
+ end
2520
+
2521
+ #
2522
+ # Gets the list of Replication protected items.
2523
+ #
2524
+ # Gets the list of ASR replication protected items in the protection container.
2525
+ #
2526
+ # @param next_page_link [String] The NextLink from the previous successful call
2527
+ # to List operation.
2528
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2529
+ # will be added to the HTTP request.
2530
+ #
2531
+ # @return [ReplicationProtectedItemCollection] operation results.
2532
+ #
2533
+ def list_by_replication_protection_containers_next(next_page_link, custom_headers = nil)
2534
+ response = list_by_replication_protection_containers_next_async(next_page_link, custom_headers).value!
2535
+ response.body unless response.nil?
2536
+ end
2537
+
2538
+ #
2539
+ # Gets the list of Replication protected items.
2540
+ #
2541
+ # Gets the list of ASR replication protected items in the protection container.
2542
+ #
2543
+ # @param next_page_link [String] The NextLink from the previous successful call
2544
+ # to List operation.
2545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2546
+ # will be added to the HTTP request.
2547
+ #
2548
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2549
+ #
2550
+ def list_by_replication_protection_containers_next_with_http_info(next_page_link, custom_headers = nil)
2551
+ list_by_replication_protection_containers_next_async(next_page_link, custom_headers).value!
2552
+ end
2553
+
2554
+ #
2555
+ # Gets the list of Replication protected items.
2556
+ #
2557
+ # Gets the list of ASR replication protected items in the protection container.
2558
+ #
2559
+ # @param next_page_link [String] The NextLink from the previous successful call
2560
+ # to List operation.
2561
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2562
+ # to the HTTP request.
2563
+ #
2564
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2565
+ #
2566
+ def list_by_replication_protection_containers_next_async(next_page_link, custom_headers = nil)
2567
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2568
+
2569
+
2570
+ request_headers = {}
2571
+
2572
+ # Set Headers
2573
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2574
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2575
+ path_template = '{nextLink}'
2576
+
2577
+ request_url = @base_url || @client.base_url
2578
+
2579
+ options = {
2580
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2581
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2582
+ headers: request_headers.merge(custom_headers || {}),
2583
+ base_url: request_url
2584
+ }
2585
+ promise = @client.make_request_async(:get, path_template, options)
2586
+
2587
+ promise = promise.then do |result|
2588
+ http_response = result.response
2589
+ status_code = http_response.status
2590
+ response_content = http_response.body
2591
+ unless status_code == 200
2592
+ error_model = JSON.load(response_content)
2593
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2594
+ end
2595
+
2596
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2597
+ # Deserialize Response
2598
+ if status_code == 200
2599
+ begin
2600
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2601
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItemCollection.mapper()
2602
+ result.body = @client.deserialize(result_mapper, parsed_response)
2603
+ rescue Exception => e
2604
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2605
+ end
2606
+ end
2607
+
2608
+ result
2609
+ end
2610
+
2611
+ promise.execute
2612
+ end
2613
+
2614
+ #
2615
+ # Gets the list of replication protected items.
2616
+ #
2617
+ # Gets the list of ASR replication protected items in the vault.
2618
+ #
2619
+ # @param next_page_link [String] The NextLink from the previous successful call
2620
+ # to List operation.
2621
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2622
+ # will be added to the HTTP request.
2623
+ #
2624
+ # @return [ReplicationProtectedItemCollection] operation results.
2625
+ #
2626
+ def list_next(next_page_link, custom_headers = nil)
2627
+ response = list_next_async(next_page_link, custom_headers).value!
2628
+ response.body unless response.nil?
2629
+ end
2630
+
2631
+ #
2632
+ # Gets the list of replication protected items.
2633
+ #
2634
+ # Gets the list of ASR replication protected items in the vault.
2635
+ #
2636
+ # @param next_page_link [String] The NextLink from the previous successful call
2637
+ # to List operation.
2638
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2639
+ # will be added to the HTTP request.
2640
+ #
2641
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2642
+ #
2643
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
2644
+ list_next_async(next_page_link, custom_headers).value!
2645
+ end
2646
+
2647
+ #
2648
+ # Gets the list of replication protected items.
2649
+ #
2650
+ # Gets the list of ASR replication protected items in the vault.
2651
+ #
2652
+ # @param next_page_link [String] The NextLink from the previous successful call
2653
+ # to List operation.
2654
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2655
+ # to the HTTP request.
2656
+ #
2657
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2658
+ #
2659
+ def list_next_async(next_page_link, custom_headers = nil)
2660
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2661
+
2662
+
2663
+ request_headers = {}
2664
+
2665
+ # Set Headers
2666
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2667
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2668
+ path_template = '{nextLink}'
2669
+
2670
+ request_url = @base_url || @client.base_url
2671
+
2672
+ options = {
2673
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2674
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2675
+ headers: request_headers.merge(custom_headers || {}),
2676
+ base_url: request_url
2677
+ }
2678
+ promise = @client.make_request_async(:get, path_template, options)
2679
+
2680
+ promise = promise.then do |result|
2681
+ http_response = result.response
2682
+ status_code = http_response.status
2683
+ response_content = http_response.body
2684
+ unless status_code == 200
2685
+ error_model = JSON.load(response_content)
2686
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2687
+ end
2688
+
2689
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2690
+ # Deserialize Response
2691
+ if status_code == 200
2692
+ begin
2693
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2694
+ result_mapper = Azure::ARM::RecoveryServicesSiteRecovery::Models::ReplicationProtectedItemCollection.mapper()
2695
+ result.body = @client.deserialize(result_mapper, parsed_response)
2696
+ rescue Exception => e
2697
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2698
+ end
2699
+ end
2700
+
2701
+ result
2702
+ end
2703
+
2704
+ promise.execute
2705
+ end
2706
+
2707
+ #
2708
+ # Gets the list of Replication protected items.
2709
+ #
2710
+ # Gets the list of ASR replication protected items in the protection container.
2711
+ #
2712
+ # @param fabric_name [String] Fabric name.
2713
+ # @param protection_container_name [String] Protection container name.
2714
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2715
+ # will be added to the HTTP request.
2716
+ #
2717
+ # @return [ReplicationProtectedItemCollection] which provide lazy access to
2718
+ # pages of the response.
2719
+ #
2720
+ def list_by_replication_protection_containers_as_lazy(fabric_name, protection_container_name, custom_headers = nil)
2721
+ response = list_by_replication_protection_containers_async(fabric_name, protection_container_name, custom_headers).value!
2722
+ unless response.nil?
2723
+ page = response.body
2724
+ page.next_method = Proc.new do |next_page_link|
2725
+ list_by_replication_protection_containers_next_async(next_page_link, custom_headers)
2726
+ end
2727
+ page
2728
+ end
2729
+ end
2730
+
2731
+ #
2732
+ # Gets the list of replication protected items.
2733
+ #
2734
+ # Gets the list of ASR replication protected items in the vault.
2735
+ #
2736
+ # @param skip_token [String] The pagination token. Possible values: "FabricId"
2737
+ # or "FabricId_CloudId" or null
2738
+ # @param filter [String] OData filter options.
2739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2740
+ # will be added to the HTTP request.
2741
+ #
2742
+ # @return [ReplicationProtectedItemCollection] which provide lazy access to
2743
+ # pages of the response.
2744
+ #
2745
+ def list_as_lazy(skip_token = nil, filter = nil, custom_headers = nil)
2746
+ response = list_async(skip_token, filter, custom_headers).value!
2747
+ unless response.nil?
2748
+ page = response.body
2749
+ page.next_method = Proc.new do |next_page_link|
2750
+ list_next_async(next_page_link, custom_headers)
2751
+ end
2752
+ page
2753
+ end
2754
+ end
2755
+
2756
+ end
2757
+ end