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.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/azure_mgmt_recovery_services_backup.rb +5 -0
- data/lib/generated/azure_mgmt_recovery_services_backup.rb +175 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/backup_engines.rb +253 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/backup_operation_results.rb +128 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/backup_operation_statuses.rb +136 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/backups.rb +149 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/export_jobs_operation_results.rb +124 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/item_level_recovery_connections.rb +276 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/job_cancellations.rb +116 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/job_details.rb +124 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/job_operation_results.rb +117 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/jobs.rb +369 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_backup_server_engine.rb +92 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_sclassic_compute_vmcontainer.rb +107 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_sclassic_compute_vmprotectable_item.rb +77 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_sclassic_compute_vmprotected_item.rb +136 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_scompute_vmcontainer.rb +107 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_scompute_vmprotectable_item.rb +77 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_scompute_vmprotected_item.rb +137 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmerror_info.rb +82 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmjob.rb +169 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmjob_extended_info.rb +91 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmjob_task_details.rb +104 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmprotected_item.rb +165 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmprotected_item_extended_info.rb +68 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_iaa_svmprotection_policy.rb +83 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_container.rb +85 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_protected_item.rb +121 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_protected_item_extended_info.rb +67 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/azure_sql_protection_policy.rb +68 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_engine_base.rb +112 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_engine_base_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_engine_base_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_item_type.rb +22 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_management_type.rb +20 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_request.rb +46 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/backup_request_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/bekdetails.rb +65 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/bmsbackup_engine_query_object.rb +47 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/bmscontainer_query_object.rb +68 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/bmspoquery_object.rb +67 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/bmsrpquery_object.rb +54 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/client_script_for_connect.rb +67 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/daily_retention_format.rb +52 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/daily_retention_schedule.rb +62 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/data_source_type.rb +22 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/day.rb +54 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/day_of_week.rb +21 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_backup_engine.rb +92 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_error_info.rb +62 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_job.rb +198 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_job_extended_info.rb +80 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/dpm_job_task_details.rb +84 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/encryption_details.rb +87 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/export_jobs_operation_result_info.rb +70 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/generic_recovery_point.rb +89 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/get_protected_item_query_object.rb +45 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/http_status_code.rb +61 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/iaa_svmcontainer.rb +118 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/iaa_svmprotectable_item.rb +82 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmbackup_request.rb +60 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmilrregistration_request.rb +92 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmrecovery_point.rb +124 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/iaas_vmrestore_request.rb +202 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/ilrrequest.rb +45 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/ilrrequest_resource.rb +96 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/instant_item_recovery_target.rb +52 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job.rb +121 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job_operation_type.rb +20 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job_query_object.rb +103 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job_resource.rb +96 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job_status.rb +21 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/job_supported_action.rb +17 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/kekdetails.rb +67 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/key_and_secret_details.rb +63 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/long_term_retention_policy.rb +96 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/long_term_schedule_policy.rb +48 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_container.rb +137 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_container_extended_info.rb +95 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_error_info.rb +61 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_file_folder_protected_item.rb +149 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_file_folder_protected_item_extended_info.rb +66 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_job.rb +194 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_job_extended_info.rb +79 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_job_task_details.rb +84 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_protection_policy.rb +82 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/mab_server_type.rb +25 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/month_of_year.rb +27 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/monthly_retention_schedule.rb +99 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_result_info.rb +65 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_result_info_base.rb +46 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_result_info_base_resource.rb +76 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status.rb +114 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_error.rb +54 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_extended_info.rb +47 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_job_extended_info.rb +58 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_jobs_extended_info.rb +83 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_provision_ilrextended_info.rb +61 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_status_values.rb +19 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/operation_worker_response.rb +83 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item.rb +107 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_query_object.rb +81 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_resource.rb +96 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protected_item_state.rb +20 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_container.rb +110 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_container_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_container_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy.rb +58 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy_query_object.rb +47 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_policy_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_state.rb +20 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/protection_status.rb +18 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_point.rb +47 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_point_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_point_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/recovery_type.rb +18 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/resource_list.rb +45 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/restore_request.rb +46 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/restore_request_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_duration.rb +60 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_duration_type.rb +19 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_policy.rb +46 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/retention_schedule_format.rb +17 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/schedule_policy.rb +46 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/schedule_run_type.rb +17 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/simple_retention_policy.rb +60 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/simple_schedule_policy.rb +108 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/week_of_month.rb +19 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/weekly_retention_format.rb +70 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/weekly_retention_schedule.rb +81 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_protectable_item.rb +80 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_protectable_item_resource.rb +97 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_protectable_item_resource_list.rb +90 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/workload_type.rb +22 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/models/yearly_retention_schedule.rb +119 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/module_definition.rb +8 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protectable_items.rb +276 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protected_item_operation_results.rb +142 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protected_item_operation_statuses.rb +154 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protected_items.rb +609 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protection_container_operation_results.rb +135 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protection_container_refresh_operation_results.rb +120 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protection_containers.rb +538 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protection_policies.rb +566 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protection_policy_operation_results.rb +131 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/protection_policy_operation_statuses.rb +143 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/recovery_points.rb +386 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb +215 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/restores.rb +150 -0
- data/lib/generated/azure_mgmt_recovery_services_backup/version.rb +8 -0
- metadata +268 -0
@@ -0,0 +1,128 @@
|
|
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 BackupOperationResults
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the BackupOperationResults 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
|
+
# Provides the status of the delete operations, for example, deleting a backup
|
27
|
+
# item. Once the operation starts, the response status code is Accepted. The
|
28
|
+
# response status code remains in this state until the operation reaches
|
29
|
+
# completion. On successful completion, the status code changes to OK. This
|
30
|
+
# method expects OperationID as an argument. OperationID is part of the
|
31
|
+
# Location header of the operation response.
|
32
|
+
#
|
33
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
34
|
+
# @param resource_group_name [String] The name of the resource group associated
|
35
|
+
# with the Recovery Services vault.
|
36
|
+
# @param operation_id [String] The ID of the operation.
|
37
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
38
|
+
# will be added to the HTTP request.
|
39
|
+
#
|
40
|
+
#
|
41
|
+
def get(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
42
|
+
response = get_async(vault_name, resource_group_name, operation_id, custom_headers).value!
|
43
|
+
nil
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Provides the status of the delete operations, for example, deleting a backup
|
48
|
+
# item. Once the operation starts, the response status code is Accepted. The
|
49
|
+
# response status code remains in this state until the operation reaches
|
50
|
+
# completion. On successful completion, the status code changes to OK. This
|
51
|
+
# method expects OperationID as an argument. OperationID is part of the
|
52
|
+
# Location header of the operation response.
|
53
|
+
#
|
54
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
55
|
+
# @param resource_group_name [String] The name of the resource group associated
|
56
|
+
# with the Recovery Services vault.
|
57
|
+
# @param operation_id [String] The ID of the operation.
|
58
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
59
|
+
# will be added to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
62
|
+
#
|
63
|
+
def get_with_http_info(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
64
|
+
get_async(vault_name, resource_group_name, operation_id, custom_headers).value!
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# Provides the status of the delete operations, for example, deleting a backup
|
69
|
+
# item. Once the operation starts, the response status code is Accepted. The
|
70
|
+
# response status code remains in this state until the operation reaches
|
71
|
+
# completion. On successful completion, the status code changes to OK. This
|
72
|
+
# method expects OperationID as an argument. OperationID is part of the
|
73
|
+
# Location header of the operation response.
|
74
|
+
#
|
75
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
76
|
+
# @param resource_group_name [String] The name of the resource group associated
|
77
|
+
# with the Recovery Services vault.
|
78
|
+
# @param operation_id [String] The ID of the operation.
|
79
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
80
|
+
# to the HTTP request.
|
81
|
+
#
|
82
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
83
|
+
#
|
84
|
+
def get_async(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
85
|
+
api_version = '2016-06-01'
|
86
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
87
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
88
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
89
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
90
|
+
|
91
|
+
|
92
|
+
request_headers = {}
|
93
|
+
|
94
|
+
# Set Headers
|
95
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
96
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
97
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}'
|
98
|
+
|
99
|
+
request_url = @base_url || @client.base_url
|
100
|
+
|
101
|
+
options = {
|
102
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
103
|
+
path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'operationId' => operation_id},
|
104
|
+
query_params: {'api-version' => api_version},
|
105
|
+
headers: request_headers.merge(custom_headers || {}),
|
106
|
+
base_url: request_url
|
107
|
+
}
|
108
|
+
promise = @client.make_request_async(:get, path_template, options)
|
109
|
+
|
110
|
+
promise = promise.then do |result|
|
111
|
+
http_response = result.response
|
112
|
+
status_code = http_response.status
|
113
|
+
response_content = http_response.body
|
114
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
115
|
+
error_model = JSON.load(response_content)
|
116
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
117
|
+
end
|
118
|
+
|
119
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
120
|
+
|
121
|
+
result
|
122
|
+
end
|
123
|
+
|
124
|
+
promise.execute
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,136 @@
|
|
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 BackupOperationStatuses
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the BackupOperationStatuses 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 the status of an operation such as triggering a backup or restore. The
|
27
|
+
# status can be In progress, Completed or Failed. You can refer to the
|
28
|
+
# OperationStatus enum for all the possible states of an operation. Some
|
29
|
+
# operations create jobs. This method returns the list of jobs when the
|
30
|
+
# operation is complete.
|
31
|
+
#
|
32
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
33
|
+
# @param resource_group_name [String] The name of the resource group associated
|
34
|
+
# with the Recovery Services vault.
|
35
|
+
# @param operation_id [String] The ID of the operation.
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
37
|
+
# will be added to the HTTP request.
|
38
|
+
#
|
39
|
+
# @return [OperationStatus] operation results.
|
40
|
+
#
|
41
|
+
def get(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
42
|
+
response = get_async(vault_name, resource_group_name, operation_id, custom_headers).value!
|
43
|
+
response.body unless response.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Gets the status of an operation such as triggering a backup or restore. The
|
48
|
+
# status can be In progress, Completed or Failed. You can refer to the
|
49
|
+
# OperationStatus enum for all the possible states of an operation. Some
|
50
|
+
# operations create jobs. This method returns the list of jobs when the
|
51
|
+
# operation is complete.
|
52
|
+
#
|
53
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
54
|
+
# @param resource_group_name [String] The name of the resource group associated
|
55
|
+
# with the Recovery Services vault.
|
56
|
+
# @param operation_id [String] The ID of the operation.
|
57
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
58
|
+
# will be added to the HTTP request.
|
59
|
+
#
|
60
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
61
|
+
#
|
62
|
+
def get_with_http_info(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
63
|
+
get_async(vault_name, resource_group_name, operation_id, custom_headers).value!
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Gets the status of an operation such as triggering a backup or restore. The
|
68
|
+
# status can be In progress, Completed or Failed. You can refer to the
|
69
|
+
# OperationStatus enum for all the possible states of an operation. Some
|
70
|
+
# operations create jobs. This method returns the list of jobs when the
|
71
|
+
# operation is complete.
|
72
|
+
#
|
73
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
74
|
+
# @param resource_group_name [String] The name of the resource group associated
|
75
|
+
# with the Recovery Services vault.
|
76
|
+
# @param operation_id [String] The ID of the operation.
|
77
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
78
|
+
# to the HTTP request.
|
79
|
+
#
|
80
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
81
|
+
#
|
82
|
+
def get_async(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
83
|
+
api_version = '2016-06-01'
|
84
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
85
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
86
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
87
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
88
|
+
|
89
|
+
|
90
|
+
request_headers = {}
|
91
|
+
|
92
|
+
# Set Headers
|
93
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
94
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
95
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}'
|
96
|
+
|
97
|
+
request_url = @base_url || @client.base_url
|
98
|
+
|
99
|
+
options = {
|
100
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
101
|
+
path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'operationId' => operation_id},
|
102
|
+
query_params: {'api-version' => api_version},
|
103
|
+
headers: request_headers.merge(custom_headers || {}),
|
104
|
+
base_url: request_url
|
105
|
+
}
|
106
|
+
promise = @client.make_request_async(:get, path_template, options)
|
107
|
+
|
108
|
+
promise = promise.then do |result|
|
109
|
+
http_response = result.response
|
110
|
+
status_code = http_response.status
|
111
|
+
response_content = http_response.body
|
112
|
+
unless status_code == 200
|
113
|
+
error_model = JSON.load(response_content)
|
114
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
115
|
+
end
|
116
|
+
|
117
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
118
|
+
# Deserialize Response
|
119
|
+
if status_code == 200
|
120
|
+
begin
|
121
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
122
|
+
result_mapper = OperationStatus.mapper()
|
123
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
124
|
+
rescue Exception => e
|
125
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
result
|
130
|
+
end
|
131
|
+
|
132
|
+
promise.execute
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,149 @@
|
|
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 Backups
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the Backups 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
|
+
# Triggers the backup job for the specified backup item. This is an
|
27
|
+
# asynchronous operation. To know the status of the operation, call
|
28
|
+
# GetProtectedItemOperationResult API.
|
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 item.
|
34
|
+
# @param container_name [String] The container name associated with the backup
|
35
|
+
# item.
|
36
|
+
# @param protected_item_name [String] The name of backup item used in this POST
|
37
|
+
# operation.
|
38
|
+
# @param resource_backup_request [BackupRequestResource] The resource backup
|
39
|
+
# request.
|
40
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
41
|
+
# will be added to the HTTP request.
|
42
|
+
#
|
43
|
+
#
|
44
|
+
def trigger(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, resource_backup_request, custom_headers = nil)
|
45
|
+
response = trigger_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, resource_backup_request, custom_headers).value!
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Triggers the backup job for the specified backup item. This is an
|
51
|
+
# asynchronous operation. To know the status of the operation, call
|
52
|
+
# GetProtectedItemOperationResult API.
|
53
|
+
#
|
54
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
55
|
+
# @param resource_group_name [String] The name of the resource group associated
|
56
|
+
# with the Recovery Services vault.
|
57
|
+
# @param fabric_name [String] The fabric name associated with the backup item.
|
58
|
+
# @param container_name [String] The container name associated with the backup
|
59
|
+
# item.
|
60
|
+
# @param protected_item_name [String] The name of backup item used in this POST
|
61
|
+
# operation.
|
62
|
+
# @param resource_backup_request [BackupRequestResource] The resource backup
|
63
|
+
# request.
|
64
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
65
|
+
# will be added to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
68
|
+
#
|
69
|
+
def trigger_with_http_info(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, resource_backup_request, custom_headers = nil)
|
70
|
+
trigger_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, resource_backup_request, custom_headers).value!
|
71
|
+
end
|
72
|
+
|
73
|
+
#
|
74
|
+
# Triggers the backup job for the specified backup item. This is an
|
75
|
+
# asynchronous operation. To know the status of the operation, call
|
76
|
+
# GetProtectedItemOperationResult API.
|
77
|
+
#
|
78
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
79
|
+
# @param resource_group_name [String] The name of the resource group associated
|
80
|
+
# with the Recovery Services vault.
|
81
|
+
# @param fabric_name [String] The fabric name associated with the backup item.
|
82
|
+
# @param container_name [String] The container name associated with the backup
|
83
|
+
# item.
|
84
|
+
# @param protected_item_name [String] The name of backup item used in this POST
|
85
|
+
# operation.
|
86
|
+
# @param resource_backup_request [BackupRequestResource] The resource backup
|
87
|
+
# request.
|
88
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
89
|
+
# to the HTTP request.
|
90
|
+
#
|
91
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
92
|
+
#
|
93
|
+
def trigger_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, resource_backup_request, custom_headers = nil)
|
94
|
+
api_version = '2016-06-01'
|
95
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
96
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
97
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
98
|
+
fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
|
99
|
+
fail ArgumentError, 'container_name is nil' if container_name.nil?
|
100
|
+
fail ArgumentError, 'protected_item_name is nil' if protected_item_name.nil?
|
101
|
+
fail ArgumentError, 'resource_backup_request is nil' if resource_backup_request.nil?
|
102
|
+
|
103
|
+
|
104
|
+
request_headers = {}
|
105
|
+
|
106
|
+
# Set Headers
|
107
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
108
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
109
|
+
|
110
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
111
|
+
|
112
|
+
# Serialize Request
|
113
|
+
request_mapper = BackupRequestResource.mapper()
|
114
|
+
request_content = @client.serialize(request_mapper, resource_backup_request, 'resource_backup_request')
|
115
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
116
|
+
|
117
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup'
|
118
|
+
|
119
|
+
request_url = @base_url || @client.base_url
|
120
|
+
|
121
|
+
options = {
|
122
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
123
|
+
path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'containerName' => container_name,'protectedItemName' => protected_item_name},
|
124
|
+
query_params: {'api-version' => api_version},
|
125
|
+
body: request_content,
|
126
|
+
headers: request_headers.merge(custom_headers || {}),
|
127
|
+
base_url: request_url
|
128
|
+
}
|
129
|
+
promise = @client.make_request_async(:post, path_template, options)
|
130
|
+
|
131
|
+
promise = promise.then do |result|
|
132
|
+
http_response = result.response
|
133
|
+
status_code = http_response.status
|
134
|
+
response_content = http_response.body
|
135
|
+
unless status_code == 202
|
136
|
+
error_model = JSON.load(response_content)
|
137
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
138
|
+
end
|
139
|
+
|
140
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
141
|
+
|
142
|
+
result
|
143
|
+
end
|
144
|
+
|
145
|
+
promise.execute
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
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 ExportJobsOperationResults
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the ExportJobsOperationResults 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 the result of the operation triggered by the ExportJob API.
|
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 operation_id [String] The ID associated with the export job.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [OperationResultInfoBaseResource] operation results.
|
36
|
+
#
|
37
|
+
def get(vault_name, resource_group_name, operation_id, custom_headers = nil)
|
38
|
+
response = get_async(vault_name, resource_group_name, operation_id, custom_headers).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Gets the result of the operation triggered by the ExportJob API.
|
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 operation_id [String] The ID associated with the export job.
|
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, operation_id, custom_headers = nil)
|
55
|
+
get_async(vault_name, resource_group_name, operation_id, custom_headers).value!
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Gets the result of the operation triggered by the ExportJob API.
|
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 operation_id [String] The ID associated with the export job.
|
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, operation_id, 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, 'operation_id is nil' if operation_id.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/operationResults/{operationId}'
|
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,'operationId' => operation_id},
|
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 || status_code == 202
|
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 = OperationResultInfoBaseResource.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
|