azure_mgmt_recovery_services_backup 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_recovery_services_backup.rb +5 -0
  4. data/lib/generated/azure_mgmt_recovery_services_backup.rb +175 -0
  5. data/lib/generated/azure_mgmt_recovery_services_backup/backup_engines.rb +253 -0
  6. data/lib/generated/azure_mgmt_recovery_services_backup/backup_operation_results.rb +128 -0
  7. data/lib/generated/azure_mgmt_recovery_services_backup/backup_operation_statuses.rb +136 -0
  8. data/lib/generated/azure_mgmt_recovery_services_backup/backups.rb +149 -0
  9. data/lib/generated/azure_mgmt_recovery_services_backup/export_jobs_operation_results.rb +124 -0
  10. data/lib/generated/azure_mgmt_recovery_services_backup/item_level_recovery_connections.rb +276 -0
  11. data/lib/generated/azure_mgmt_recovery_services_backup/job_cancellations.rb +116 -0
  12. data/lib/generated/azure_mgmt_recovery_services_backup/job_details.rb +124 -0
  13. data/lib/generated/azure_mgmt_recovery_services_backup/job_operation_results.rb +117 -0
  14. data/lib/generated/azure_mgmt_recovery_services_backup/jobs.rb +369 -0
  15. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_backup_server_engine.rb +92 -0
  16. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_sclassic_compute_vmcontainer.rb +107 -0
  17. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_sclassic_compute_vmprotectable_item.rb +77 -0
  18. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_sclassic_compute_vmprotected_item.rb +136 -0
  19. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_scompute_vmcontainer.rb +107 -0
  20. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_scompute_vmprotectable_item.rb +77 -0
  21. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_scompute_vmprotected_item.rb +137 -0
  22. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmerror_info.rb +82 -0
  23. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmjob.rb +169 -0
  24. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmjob_extended_info.rb +91 -0
  25. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmjob_task_details.rb +104 -0
  26. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmprotected_item.rb +165 -0
  27. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmprotected_item_extended_info.rb +68 -0
  28. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmprotection_policy.rb +83 -0
  29. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_container.rb +85 -0
  30. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_protected_item.rb +121 -0
  31. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_protected_item_extended_info.rb +67 -0
  32. data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_protection_policy.rb +68 -0
  33. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_engine_base.rb +112 -0
  34. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_engine_base_resource.rb +97 -0
  35. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_engine_base_resource_list.rb +90 -0
  36. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_item_type.rb +22 -0
  37. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_management_type.rb +20 -0
  38. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_request.rb +46 -0
  39. data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_request_resource.rb +97 -0
  40. data/lib/generated/azure_mgmt_recovery_services_backup/models/bekdetails.rb +65 -0
  41. data/lib/generated/azure_mgmt_recovery_services_backup/models/bmsbackup_engine_query_object.rb +47 -0
  42. data/lib/generated/azure_mgmt_recovery_services_backup/models/bmscontainer_query_object.rb +68 -0
  43. data/lib/generated/azure_mgmt_recovery_services_backup/models/bmspoquery_object.rb +67 -0
  44. data/lib/generated/azure_mgmt_recovery_services_backup/models/bmsrpquery_object.rb +54 -0
  45. data/lib/generated/azure_mgmt_recovery_services_backup/models/client_script_for_connect.rb +67 -0
  46. data/lib/generated/azure_mgmt_recovery_services_backup/models/daily_retention_format.rb +52 -0
  47. data/lib/generated/azure_mgmt_recovery_services_backup/models/daily_retention_schedule.rb +62 -0
  48. data/lib/generated/azure_mgmt_recovery_services_backup/models/data_source_type.rb +22 -0
  49. data/lib/generated/azure_mgmt_recovery_services_backup/models/day.rb +54 -0
  50. data/lib/generated/azure_mgmt_recovery_services_backup/models/day_of_week.rb +21 -0
  51. data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_backup_engine.rb +92 -0
  52. data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_error_info.rb +62 -0
  53. data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_job.rb +198 -0
  54. data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_job_extended_info.rb +80 -0
  55. data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_job_task_details.rb +84 -0
  56. data/lib/generated/azure_mgmt_recovery_services_backup/models/encryption_details.rb +87 -0
  57. data/lib/generated/azure_mgmt_recovery_services_backup/models/export_jobs_operation_result_info.rb +70 -0
  58. data/lib/generated/azure_mgmt_recovery_services_backup/models/generic_recovery_point.rb +89 -0
  59. data/lib/generated/azure_mgmt_recovery_services_backup/models/get_protected_item_query_object.rb +45 -0
  60. data/lib/generated/azure_mgmt_recovery_services_backup/models/http_status_code.rb +61 -0
  61. data/lib/generated/azure_mgmt_recovery_services_backup/models/iaa_svmcontainer.rb +118 -0
  62. data/lib/generated/azure_mgmt_recovery_services_backup/models/iaa_svmprotectable_item.rb +82 -0
  63. data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmbackup_request.rb +60 -0
  64. data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmilrregistration_request.rb +92 -0
  65. data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmrecovery_point.rb +124 -0
  66. data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmrestore_request.rb +202 -0
  67. data/lib/generated/azure_mgmt_recovery_services_backup/models/ilrrequest.rb +45 -0
  68. data/lib/generated/azure_mgmt_recovery_services_backup/models/ilrrequest_resource.rb +96 -0
  69. data/lib/generated/azure_mgmt_recovery_services_backup/models/instant_item_recovery_target.rb +52 -0
  70. data/lib/generated/azure_mgmt_recovery_services_backup/models/job.rb +121 -0
  71. data/lib/generated/azure_mgmt_recovery_services_backup/models/job_operation_type.rb +20 -0
  72. data/lib/generated/azure_mgmt_recovery_services_backup/models/job_query_object.rb +103 -0
  73. data/lib/generated/azure_mgmt_recovery_services_backup/models/job_resource.rb +96 -0
  74. data/lib/generated/azure_mgmt_recovery_services_backup/models/job_resource_list.rb +90 -0
  75. data/lib/generated/azure_mgmt_recovery_services_backup/models/job_status.rb +21 -0
  76. data/lib/generated/azure_mgmt_recovery_services_backup/models/job_supported_action.rb +17 -0
  77. data/lib/generated/azure_mgmt_recovery_services_backup/models/kekdetails.rb +67 -0
  78. data/lib/generated/azure_mgmt_recovery_services_backup/models/key_and_secret_details.rb +63 -0
  79. data/lib/generated/azure_mgmt_recovery_services_backup/models/long_term_retention_policy.rb +96 -0
  80. data/lib/generated/azure_mgmt_recovery_services_backup/models/long_term_schedule_policy.rb +48 -0
  81. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_container.rb +137 -0
  82. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_container_extended_info.rb +95 -0
  83. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_error_info.rb +61 -0
  84. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_file_folder_protected_item.rb +149 -0
  85. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_file_folder_protected_item_extended_info.rb +66 -0
  86. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_job.rb +194 -0
  87. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_job_extended_info.rb +79 -0
  88. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_job_task_details.rb +84 -0
  89. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_protection_policy.rb +82 -0
  90. data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_server_type.rb +25 -0
  91. data/lib/generated/azure_mgmt_recovery_services_backup/models/month_of_year.rb +27 -0
  92. data/lib/generated/azure_mgmt_recovery_services_backup/models/monthly_retention_schedule.rb +99 -0
  93. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_result_info.rb +65 -0
  94. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_result_info_base.rb +46 -0
  95. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_result_info_base_resource.rb +76 -0
  96. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status.rb +114 -0
  97. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_error.rb +54 -0
  98. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_extended_info.rb +47 -0
  99. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_job_extended_info.rb +58 -0
  100. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_jobs_extended_info.rb +83 -0
  101. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_provision_ilrextended_info.rb +61 -0
  102. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_values.rb +19 -0
  103. data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_worker_response.rb +83 -0
  104. data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item.rb +107 -0
  105. data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_query_object.rb +81 -0
  106. data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_resource.rb +96 -0
  107. data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_resource_list.rb +90 -0
  108. data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_state.rb +20 -0
  109. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_container.rb +110 -0
  110. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_container_resource.rb +97 -0
  111. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_container_resource_list.rb +90 -0
  112. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy.rb +58 -0
  113. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy_query_object.rb +47 -0
  114. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy_resource.rb +97 -0
  115. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy_resource_list.rb +90 -0
  116. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_state.rb +20 -0
  117. data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_status.rb +18 -0
  118. data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_point.rb +47 -0
  119. data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_point_resource.rb +97 -0
  120. data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_point_resource_list.rb +90 -0
  121. data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_type.rb +18 -0
  122. data/lib/generated/azure_mgmt_recovery_services_backup/models/resource_list.rb +45 -0
  123. data/lib/generated/azure_mgmt_recovery_services_backup/models/restore_request.rb +46 -0
  124. data/lib/generated/azure_mgmt_recovery_services_backup/models/restore_request_resource.rb +97 -0
  125. data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_duration.rb +60 -0
  126. data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_duration_type.rb +19 -0
  127. data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_policy.rb +46 -0
  128. data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_schedule_format.rb +17 -0
  129. data/lib/generated/azure_mgmt_recovery_services_backup/models/schedule_policy.rb +46 -0
  130. data/lib/generated/azure_mgmt_recovery_services_backup/models/schedule_run_type.rb +17 -0
  131. data/lib/generated/azure_mgmt_recovery_services_backup/models/simple_retention_policy.rb +60 -0
  132. data/lib/generated/azure_mgmt_recovery_services_backup/models/simple_schedule_policy.rb +108 -0
  133. data/lib/generated/azure_mgmt_recovery_services_backup/models/week_of_month.rb +19 -0
  134. data/lib/generated/azure_mgmt_recovery_services_backup/models/weekly_retention_format.rb +70 -0
  135. data/lib/generated/azure_mgmt_recovery_services_backup/models/weekly_retention_schedule.rb +81 -0
  136. data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_protectable_item.rb +80 -0
  137. data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_protectable_item_resource.rb +97 -0
  138. data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_protectable_item_resource_list.rb +90 -0
  139. data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_type.rb +22 -0
  140. data/lib/generated/azure_mgmt_recovery_services_backup/models/yearly_retention_schedule.rb +119 -0
  141. data/lib/generated/azure_mgmt_recovery_services_backup/module_definition.rb +8 -0
  142. data/lib/generated/azure_mgmt_recovery_services_backup/protectable_items.rb +276 -0
  143. data/lib/generated/azure_mgmt_recovery_services_backup/protected_item_operation_results.rb +142 -0
  144. data/lib/generated/azure_mgmt_recovery_services_backup/protected_item_operation_statuses.rb +154 -0
  145. data/lib/generated/azure_mgmt_recovery_services_backup/protected_items.rb +609 -0
  146. data/lib/generated/azure_mgmt_recovery_services_backup/protection_container_operation_results.rb +135 -0
  147. data/lib/generated/azure_mgmt_recovery_services_backup/protection_container_refresh_operation_results.rb +120 -0
  148. data/lib/generated/azure_mgmt_recovery_services_backup/protection_containers.rb +538 -0
  149. data/lib/generated/azure_mgmt_recovery_services_backup/protection_policies.rb +566 -0
  150. data/lib/generated/azure_mgmt_recovery_services_backup/protection_policy_operation_results.rb +131 -0
  151. data/lib/generated/azure_mgmt_recovery_services_backup/protection_policy_operation_statuses.rb +143 -0
  152. data/lib/generated/azure_mgmt_recovery_services_backup/recovery_points.rb +386 -0
  153. data/lib/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb +215 -0
  154. data/lib/generated/azure_mgmt_recovery_services_backup/restores.rb +150 -0
  155. data/lib/generated/azure_mgmt_recovery_services_backup/version.rb +8 -0
  156. metadata +268 -0
@@ -0,0 +1,276 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServicesBackup
7
+ #
8
+ # Composite Swagger for Recovery Services Backup Client
9
+ #
10
+ class ItemLevelRecoveryConnections
11
+ include Azure::ARM::RecoveryServicesBackup::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the ItemLevelRecoveryConnections class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [RecoveryServicesBackupClient] reference to the RecoveryServicesBackupClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Revokes an iSCSI connection which can be used to download a script. Executing
27
+ # this script opens a file explorer displaying all recoverable files and
28
+ # folders. This is an asynchronous operation.
29
+ #
30
+ # @param vault_name [String] The name of the Recovery Services vault.
31
+ # @param resource_group_name [String] The name of the resource group associated
32
+ # with the Recovery Services vault.
33
+ # @param fabric_name [String] The fabric name associated with the backup items.
34
+ # The value allowed is Azure.
35
+ # @param container_name [String] The container name associated with the backup
36
+ # items.
37
+ # @param protected_item_name [String] The name of the backup items whose files
38
+ # or folders will be restored.
39
+ # @param recovery_point_id [String] The string that identifies the recovery
40
+ # point. The iSCSI connection will be revoked for this protected data.
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ #
45
+ def revoke(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers = nil)
46
+ response = revoke_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers).value!
47
+ nil
48
+ end
49
+
50
+ #
51
+ # Revokes an iSCSI connection which can be used to download a script. Executing
52
+ # this script opens a file explorer displaying all recoverable files and
53
+ # folders. This is an asynchronous operation.
54
+ #
55
+ # @param vault_name [String] The name of the Recovery Services vault.
56
+ # @param resource_group_name [String] The name of the resource group associated
57
+ # with the Recovery Services vault.
58
+ # @param fabric_name [String] The fabric name associated with the backup items.
59
+ # The value allowed is Azure.
60
+ # @param container_name [String] The container name associated with the backup
61
+ # items.
62
+ # @param protected_item_name [String] The name of the backup items whose files
63
+ # or folders will be restored.
64
+ # @param recovery_point_id [String] The string that identifies the recovery
65
+ # point. The iSCSI connection will be revoked for this protected data.
66
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
67
+ # will be added to the HTTP request.
68
+ #
69
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
70
+ #
71
+ def revoke_with_http_info(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers = nil)
72
+ revoke_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers).value!
73
+ end
74
+
75
+ #
76
+ # Revokes an iSCSI connection which can be used to download a script. Executing
77
+ # this script opens a file explorer displaying all recoverable files and
78
+ # folders. This is an asynchronous operation.
79
+ #
80
+ # @param vault_name [String] The name of the Recovery Services vault.
81
+ # @param resource_group_name [String] The name of the resource group associated
82
+ # with the Recovery Services vault.
83
+ # @param fabric_name [String] The fabric name associated with the backup items.
84
+ # The value allowed is Azure.
85
+ # @param container_name [String] The container name associated with the backup
86
+ # items.
87
+ # @param protected_item_name [String] The name of the backup items whose files
88
+ # or folders will be restored.
89
+ # @param recovery_point_id [String] The string that identifies the recovery
90
+ # point. The iSCSI connection will be revoked for this protected data.
91
+ # @param [Hash{String => String}] A hash of custom headers that will be added
92
+ # to the HTTP request.
93
+ #
94
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
95
+ #
96
+ def revoke_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers = nil)
97
+ api_version = '2016-06-01'
98
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
99
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
100
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
101
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
102
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
103
+ fail ArgumentError, 'protected_item_name is nil' if protected_item_name.nil?
104
+ fail ArgumentError, 'recovery_point_id is nil' if recovery_point_id.nil?
105
+
106
+
107
+ request_headers = {}
108
+
109
+ # Set Headers
110
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
111
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
112
+ path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery'
113
+
114
+ request_url = @base_url || @client.base_url
115
+
116
+ options = {
117
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
118
+ path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'containerName' => container_name,'protectedItemName' => protected_item_name,'recoveryPointId' => recovery_point_id},
119
+ query_params: {'api-version' => api_version},
120
+ headers: request_headers.merge(custom_headers || {}),
121
+ base_url: request_url
122
+ }
123
+ promise = @client.make_request_async(:post, path_template, options)
124
+
125
+ promise = promise.then do |result|
126
+ http_response = result.response
127
+ status_code = http_response.status
128
+ response_content = http_response.body
129
+ unless status_code == 202
130
+ error_model = JSON.load(response_content)
131
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
132
+ end
133
+
134
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
135
+
136
+ result
137
+ end
138
+
139
+ promise.execute
140
+ end
141
+
142
+ #
143
+ # Provisions a script which invokes an iSCSI connection to the backup data.
144
+ # Executing this script opens File Explorer which displays the recoverable
145
+ # files and folders. This is an asynchronous operation. To get the provisioning
146
+ # status, call GetProtectedItemOperationResult API.
147
+ #
148
+ # @param vault_name [String] The name of the Recovery Services vault.
149
+ # @param resource_group_name [String] The name of the resource group associated
150
+ # with the Recovery Services vault.
151
+ # @param fabric_name [String] The fabric name associated with the backup items.
152
+ # @param container_name [String] The container name associated with the backup
153
+ # items.
154
+ # @param protected_item_name [String] The name of the backup item whose files
155
+ # or folders are to be restored.
156
+ # @param recovery_point_id [String] The recovery point ID for backup data. The
157
+ # iSCSI connection will be provisioned for this backup data.
158
+ # @param resource_ilrrequest [ILRRequestResource] The resource Item Level
159
+ # Recovery (ILR) request.
160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
161
+ # will be added to the HTTP request.
162
+ #
163
+ #
164
+ def provision(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, resource_ilrrequest, custom_headers = nil)
165
+ response = provision_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, resource_ilrrequest, custom_headers).value!
166
+ nil
167
+ end
168
+
169
+ #
170
+ # Provisions a script which invokes an iSCSI connection to the backup data.
171
+ # Executing this script opens File Explorer which displays the recoverable
172
+ # files and folders. This is an asynchronous operation. To get the provisioning
173
+ # status, call GetProtectedItemOperationResult API.
174
+ #
175
+ # @param vault_name [String] The name of the Recovery Services vault.
176
+ # @param resource_group_name [String] The name of the resource group associated
177
+ # with the Recovery Services vault.
178
+ # @param fabric_name [String] The fabric name associated with the backup items.
179
+ # @param container_name [String] The container name associated with the backup
180
+ # items.
181
+ # @param protected_item_name [String] The name of the backup item whose files
182
+ # or folders are to be restored.
183
+ # @param recovery_point_id [String] The recovery point ID for backup data. The
184
+ # iSCSI connection will be provisioned for this backup data.
185
+ # @param resource_ilrrequest [ILRRequestResource] The resource Item Level
186
+ # Recovery (ILR) request.
187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
188
+ # will be added to the HTTP request.
189
+ #
190
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
191
+ #
192
+ def provision_with_http_info(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, resource_ilrrequest, custom_headers = nil)
193
+ provision_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, resource_ilrrequest, custom_headers).value!
194
+ end
195
+
196
+ #
197
+ # Provisions a script which invokes an iSCSI connection to the backup data.
198
+ # Executing this script opens File Explorer which displays the recoverable
199
+ # files and folders. This is an asynchronous operation. To get the provisioning
200
+ # status, call GetProtectedItemOperationResult API.
201
+ #
202
+ # @param vault_name [String] The name of the Recovery Services vault.
203
+ # @param resource_group_name [String] The name of the resource group associated
204
+ # with the Recovery Services vault.
205
+ # @param fabric_name [String] The fabric name associated with the backup items.
206
+ # @param container_name [String] The container name associated with the backup
207
+ # items.
208
+ # @param protected_item_name [String] The name of the backup item whose files
209
+ # or folders are to be restored.
210
+ # @param recovery_point_id [String] The recovery point ID for backup data. The
211
+ # iSCSI connection will be provisioned for this backup data.
212
+ # @param resource_ilrrequest [ILRRequestResource] The resource Item Level
213
+ # Recovery (ILR) request.
214
+ # @param [Hash{String => String}] A hash of custom headers that will be added
215
+ # to the HTTP request.
216
+ #
217
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
218
+ #
219
+ def provision_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, resource_ilrrequest, custom_headers = nil)
220
+ api_version = '2016-06-01'
221
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
222
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
223
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
224
+ fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
225
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
226
+ fail ArgumentError, 'protected_item_name is nil' if protected_item_name.nil?
227
+ fail ArgumentError, 'recovery_point_id is nil' if recovery_point_id.nil?
228
+ fail ArgumentError, 'resource_ilrrequest is nil' if resource_ilrrequest.nil?
229
+
230
+
231
+ request_headers = {}
232
+
233
+ # Set Headers
234
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
235
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
236
+
237
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
238
+
239
+ # Serialize Request
240
+ request_mapper = ILRRequestResource.mapper()
241
+ request_content = @client.serialize(request_mapper, resource_ilrrequest, 'resource_ilrrequest')
242
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
243
+
244
+ path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery'
245
+
246
+ request_url = @base_url || @client.base_url
247
+
248
+ options = {
249
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
250
+ path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'containerName' => container_name,'protectedItemName' => protected_item_name,'recoveryPointId' => recovery_point_id},
251
+ query_params: {'api-version' => api_version},
252
+ body: request_content,
253
+ headers: request_headers.merge(custom_headers || {}),
254
+ base_url: request_url
255
+ }
256
+ promise = @client.make_request_async(:post, path_template, options)
257
+
258
+ promise = promise.then do |result|
259
+ http_response = result.response
260
+ status_code = http_response.status
261
+ response_content = http_response.body
262
+ unless status_code == 202
263
+ error_model = JSON.load(response_content)
264
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
265
+ end
266
+
267
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
268
+
269
+ result
270
+ end
271
+
272
+ promise.execute
273
+ end
274
+
275
+ end
276
+ end
@@ -0,0 +1,116 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServicesBackup
7
+ #
8
+ # Composite Swagger for Recovery Services Backup Client
9
+ #
10
+ class JobCancellations
11
+ include Azure::ARM::RecoveryServicesBackup::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the JobCancellations class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [RecoveryServicesBackupClient] reference to the RecoveryServicesBackupClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Cancels the job. This is an asynchronous operation. To know the status of the
27
+ # cancellation, call the GetCancelOperationResult API.
28
+ #
29
+ # @param vault_name [String] The name of the Recovery Services vault.
30
+ # @param resource_group_name [String] The name of the resource group associated
31
+ # with the Recovery Services vault.
32
+ # @param job_name [String] Name of the job to cancel.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ #
37
+ def trigger(vault_name, resource_group_name, job_name, custom_headers = nil)
38
+ response = trigger_async(vault_name, resource_group_name, job_name, custom_headers).value!
39
+ nil
40
+ end
41
+
42
+ #
43
+ # Cancels the job. This is an asynchronous operation. To know the status of the
44
+ # cancellation, call the GetCancelOperationResult API.
45
+ #
46
+ # @param vault_name [String] The name of the Recovery Services vault.
47
+ # @param resource_group_name [String] The name of the resource group associated
48
+ # with the Recovery Services vault.
49
+ # @param job_name [String] Name of the job to cancel.
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 trigger_with_http_info(vault_name, resource_group_name, job_name, custom_headers = nil)
56
+ trigger_async(vault_name, resource_group_name, job_name, custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Cancels the job. This is an asynchronous operation. To know the status of the
61
+ # cancellation, call the GetCancelOperationResult API.
62
+ #
63
+ # @param vault_name [String] The name of the Recovery Services vault.
64
+ # @param resource_group_name [String] The name of the resource group associated
65
+ # with the Recovery Services vault.
66
+ # @param job_name [String] Name of the job to cancel.
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 trigger_async(vault_name, resource_group_name, job_name, custom_headers = nil)
73
+ api_version = '2016-06-01'
74
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
77
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
78
+
79
+
80
+ request_headers = {}
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'jobName' => job_name},
92
+ query_params: {'api-version' => api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:post, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 202
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ end
116
+ end
@@ -0,0 +1,124 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServicesBackup
7
+ #
8
+ # Composite Swagger for Recovery Services Backup Client
9
+ #
10
+ class JobDetails
11
+ include Azure::ARM::RecoveryServicesBackup::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the JobDetails class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [RecoveryServicesBackupClient] reference to the RecoveryServicesBackupClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets extended information associated with the job.
27
+ #
28
+ # @param vault_name [String] The name of the Recovery Services vault.
29
+ # @param resource_group_name [String] The name of the resource group associated
30
+ # with the Recovery Services vault.
31
+ # @param job_name [String] Name of the job associated with this GET operation.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [JobResource] operation results.
36
+ #
37
+ def get(vault_name, resource_group_name, job_name, custom_headers = nil)
38
+ response = get_async(vault_name, resource_group_name, job_name, custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Gets extended information associated with the job.
44
+ #
45
+ # @param vault_name [String] The name of the Recovery Services vault.
46
+ # @param resource_group_name [String] The name of the resource group associated
47
+ # with the Recovery Services vault.
48
+ # @param job_name [String] Name of the job associated with this GET operation.
49
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
+ # will be added to the HTTP request.
51
+ #
52
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
53
+ #
54
+ def get_with_http_info(vault_name, resource_group_name, job_name, custom_headers = nil)
55
+ get_async(vault_name, resource_group_name, job_name, custom_headers).value!
56
+ end
57
+
58
+ #
59
+ # Gets extended information associated with the job.
60
+ #
61
+ # @param vault_name [String] The name of the Recovery Services vault.
62
+ # @param resource_group_name [String] The name of the resource group associated
63
+ # with the Recovery Services vault.
64
+ # @param job_name [String] Name of the job associated with this GET operation.
65
+ # @param [Hash{String => String}] A hash of custom headers that will be added
66
+ # to the HTTP request.
67
+ #
68
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
69
+ #
70
+ def get_async(vault_name, resource_group_name, job_name, custom_headers = nil)
71
+ api_version = '2016-06-01'
72
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
73
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'job_name is nil' if job_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/{vaultName}/backupJobs/{jobName}'
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: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'jobName' => job_name},
90
+ query_params: {'api-version' => 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 = JobResource.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
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
+ end
124
+ end