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,131 @@
|
|
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 ProtectionPolicyOperationResults
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the ProtectionPolicyOperationResults 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 result of an operation.
|
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 policy_name [String] The backup policy name used in this GET
|
32
|
+
# operation.
|
33
|
+
# @param operation_id [String] The ID associated with this GET operation.
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
# @return [ProtectionPolicyResource] operation results.
|
38
|
+
#
|
39
|
+
def get(vault_name, resource_group_name, policy_name, operation_id, custom_headers = nil)
|
40
|
+
response = get_async(vault_name, resource_group_name, policy_name, operation_id, custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Provides the result of an operation.
|
46
|
+
#
|
47
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
48
|
+
# @param resource_group_name [String] The name of the resource group associated
|
49
|
+
# with the Recovery Services vault.
|
50
|
+
# @param policy_name [String] The backup policy name used in this GET
|
51
|
+
# operation.
|
52
|
+
# @param operation_id [String] The ID associated with this GET operation.
|
53
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
54
|
+
# will be added to the HTTP request.
|
55
|
+
#
|
56
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
57
|
+
#
|
58
|
+
def get_with_http_info(vault_name, resource_group_name, policy_name, operation_id, custom_headers = nil)
|
59
|
+
get_async(vault_name, resource_group_name, policy_name, operation_id, custom_headers).value!
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Provides the result of an operation.
|
64
|
+
#
|
65
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
66
|
+
# @param resource_group_name [String] The name of the resource group associated
|
67
|
+
# with the Recovery Services vault.
|
68
|
+
# @param policy_name [String] The backup policy name used in this GET
|
69
|
+
# operation.
|
70
|
+
# @param operation_id [String] The ID associated with this GET operation.
|
71
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
72
|
+
# to the HTTP request.
|
73
|
+
#
|
74
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
75
|
+
#
|
76
|
+
def get_async(vault_name, resource_group_name, policy_name, operation_id, custom_headers = nil)
|
77
|
+
api_version = '2016-06-01'
|
78
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
79
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
81
|
+
fail ArgumentError, 'policy_name is nil' if policy_name.nil?
|
82
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
83
|
+
|
84
|
+
|
85
|
+
request_headers = {}
|
86
|
+
|
87
|
+
# Set Headers
|
88
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
89
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
90
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}'
|
91
|
+
|
92
|
+
request_url = @base_url || @client.base_url
|
93
|
+
|
94
|
+
options = {
|
95
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
96
|
+
path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'policyName' => policy_name,'operationId' => operation_id},
|
97
|
+
query_params: {'api-version' => api_version},
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
100
|
+
}
|
101
|
+
promise = @client.make_request_async(:get, path_template, options)
|
102
|
+
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
105
|
+
status_code = http_response.status
|
106
|
+
response_content = http_response.body
|
107
|
+
unless status_code == 200
|
108
|
+
error_model = JSON.load(response_content)
|
109
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
110
|
+
end
|
111
|
+
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
113
|
+
# Deserialize Response
|
114
|
+
if status_code == 200
|
115
|
+
begin
|
116
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
117
|
+
result_mapper = ProtectionPolicyResource.mapper()
|
118
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
119
|
+
rescue Exception => e
|
120
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
result
|
125
|
+
end
|
126
|
+
|
127
|
+
promise.execute
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
end
|
data/lib/generated/azure_mgmt_recovery_services_backup/protection_policy_operation_statuses.rb
ADDED
@@ -0,0 +1,143 @@
|
|
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 ProtectionPolicyOperationStatuses
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the ProtectionPolicyOperationStatuses 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 asynchronous operations like backup or restore.
|
27
|
+
# The status can be: in progress, completed, or failed. You can refer to the
|
28
|
+
# Operation Status enumeration for the possible states of an operation. Some
|
29
|
+
# operations create jobs. This method returns the list of jobs associated with
|
30
|
+
# the operation.
|
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 policy_name [String] The backup policy name used in this GET
|
36
|
+
# operation.
|
37
|
+
# @param operation_id [String] The ID associated with this GET operation.
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
39
|
+
# will be added to the HTTP request.
|
40
|
+
#
|
41
|
+
# @return [OperationStatus] operation results.
|
42
|
+
#
|
43
|
+
def get(vault_name, resource_group_name, policy_name, operation_id, custom_headers = nil)
|
44
|
+
response = get_async(vault_name, resource_group_name, policy_name, operation_id, custom_headers).value!
|
45
|
+
response.body unless response.nil?
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# Provides the status of the asynchronous operations like backup or restore.
|
50
|
+
# The status can be: in progress, completed, or failed. You can refer to the
|
51
|
+
# Operation Status enumeration for the possible states of an operation. Some
|
52
|
+
# operations create jobs. This method returns the list of jobs associated with
|
53
|
+
# the 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 policy_name [String] The backup policy name used in this GET
|
59
|
+
# operation.
|
60
|
+
# @param operation_id [String] The ID associated with this GET operation.
|
61
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
62
|
+
# will be added to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
65
|
+
#
|
66
|
+
def get_with_http_info(vault_name, resource_group_name, policy_name, operation_id, custom_headers = nil)
|
67
|
+
get_async(vault_name, resource_group_name, policy_name, operation_id, custom_headers).value!
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
# Provides the status of the asynchronous operations like backup or restore.
|
72
|
+
# The status can be: in progress, completed, or failed. You can refer to the
|
73
|
+
# Operation Status enumeration for the possible states of an operation. Some
|
74
|
+
# operations create jobs. This method returns the list of jobs associated with
|
75
|
+
# the operation.
|
76
|
+
#
|
77
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
78
|
+
# @param resource_group_name [String] The name of the resource group associated
|
79
|
+
# with the Recovery Services vault.
|
80
|
+
# @param policy_name [String] The backup policy name used in this GET
|
81
|
+
# operation.
|
82
|
+
# @param operation_id [String] The ID associated with this GET operation.
|
83
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
84
|
+
# to the HTTP request.
|
85
|
+
#
|
86
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
87
|
+
#
|
88
|
+
def get_async(vault_name, resource_group_name, policy_name, operation_id, custom_headers = nil)
|
89
|
+
api_version = '2016-06-01'
|
90
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
91
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
92
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
93
|
+
fail ArgumentError, 'policy_name is nil' if policy_name.nil?
|
94
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
95
|
+
|
96
|
+
|
97
|
+
request_headers = {}
|
98
|
+
|
99
|
+
# Set Headers
|
100
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
101
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
102
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}'
|
103
|
+
|
104
|
+
request_url = @base_url || @client.base_url
|
105
|
+
|
106
|
+
options = {
|
107
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
108
|
+
path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'policyName' => policy_name,'operationId' => operation_id},
|
109
|
+
query_params: {'api-version' => api_version},
|
110
|
+
headers: request_headers.merge(custom_headers || {}),
|
111
|
+
base_url: request_url
|
112
|
+
}
|
113
|
+
promise = @client.make_request_async(:get, path_template, options)
|
114
|
+
|
115
|
+
promise = promise.then do |result|
|
116
|
+
http_response = result.response
|
117
|
+
status_code = http_response.status
|
118
|
+
response_content = http_response.body
|
119
|
+
unless status_code == 200
|
120
|
+
error_model = JSON.load(response_content)
|
121
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
122
|
+
end
|
123
|
+
|
124
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
125
|
+
# Deserialize Response
|
126
|
+
if status_code == 200
|
127
|
+
begin
|
128
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
129
|
+
result_mapper = OperationStatus.mapper()
|
130
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
131
|
+
rescue Exception => e
|
132
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
result
|
137
|
+
end
|
138
|
+
|
139
|
+
promise.execute
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,386 @@
|
|
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 RecoveryPoints
|
11
|
+
include Azure::ARM::RecoveryServicesBackup::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the RecoveryPoints 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 backup data for the RecoveryPointID. This is an asynchronous
|
27
|
+
# operation. To learn the status of the operation, call the
|
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 backup item.
|
34
|
+
# @param container_name [String] The container name associated with backup
|
35
|
+
# item.
|
36
|
+
# @param protected_item_name [String] The name of the backup item used in this
|
37
|
+
# GET operation.
|
38
|
+
# @param recovery_point_id [String] The RecoveryPointID associated with this
|
39
|
+
# GET operation.
|
40
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
41
|
+
# will be added to the HTTP request.
|
42
|
+
#
|
43
|
+
# @return [RecoveryPointResource] operation results.
|
44
|
+
#
|
45
|
+
def get(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers = nil)
|
46
|
+
response = get_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers).value!
|
47
|
+
response.body unless response.nil?
|
48
|
+
end
|
49
|
+
|
50
|
+
#
|
51
|
+
# Provides the backup data for the RecoveryPointID. This is an asynchronous
|
52
|
+
# operation. To learn the status of the operation, call the
|
53
|
+
# GetProtectedItemOperationResult API.
|
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 backup item.
|
59
|
+
# @param container_name [String] The container name associated with backup
|
60
|
+
# item.
|
61
|
+
# @param protected_item_name [String] The name of the backup item used in this
|
62
|
+
# GET operation.
|
63
|
+
# @param recovery_point_id [String] The RecoveryPointID associated with this
|
64
|
+
# GET operation.
|
65
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
66
|
+
# will be added to the HTTP request.
|
67
|
+
#
|
68
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
69
|
+
#
|
70
|
+
def get_with_http_info(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers = nil)
|
71
|
+
get_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers).value!
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Provides the backup data for the RecoveryPointID. This is an asynchronous
|
76
|
+
# operation. To learn the status of the operation, call the
|
77
|
+
# GetProtectedItemOperationResult API.
|
78
|
+
#
|
79
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
80
|
+
# @param resource_group_name [String] The name of the resource group associated
|
81
|
+
# with the Recovery Services vault.
|
82
|
+
# @param fabric_name [String] The fabric name associated with backup item.
|
83
|
+
# @param container_name [String] The container name associated with backup
|
84
|
+
# item.
|
85
|
+
# @param protected_item_name [String] The name of the backup item used in this
|
86
|
+
# GET operation.
|
87
|
+
# @param recovery_point_id [String] The RecoveryPointID associated with this
|
88
|
+
# GET operation.
|
89
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
90
|
+
# to the HTTP request.
|
91
|
+
#
|
92
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
93
|
+
#
|
94
|
+
def get_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers = nil)
|
95
|
+
api_version = '2016-06-01'
|
96
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
97
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
98
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
99
|
+
fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
|
100
|
+
fail ArgumentError, 'container_name is nil' if container_name.nil?
|
101
|
+
fail ArgumentError, 'protected_item_name is nil' if protected_item_name.nil?
|
102
|
+
fail ArgumentError, 'recovery_point_id is nil' if recovery_point_id.nil?
|
103
|
+
|
104
|
+
|
105
|
+
request_headers = {}
|
106
|
+
|
107
|
+
# Set Headers
|
108
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
109
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
110
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}'
|
111
|
+
|
112
|
+
request_url = @base_url || @client.base_url
|
113
|
+
|
114
|
+
options = {
|
115
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
116
|
+
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},
|
117
|
+
query_params: {'api-version' => api_version},
|
118
|
+
headers: request_headers.merge(custom_headers || {}),
|
119
|
+
base_url: request_url
|
120
|
+
}
|
121
|
+
promise = @client.make_request_async(:get, path_template, options)
|
122
|
+
|
123
|
+
promise = promise.then do |result|
|
124
|
+
http_response = result.response
|
125
|
+
status_code = http_response.status
|
126
|
+
response_content = http_response.body
|
127
|
+
unless status_code == 200
|
128
|
+
error_model = JSON.load(response_content)
|
129
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
130
|
+
end
|
131
|
+
|
132
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
133
|
+
# Deserialize Response
|
134
|
+
if status_code == 200
|
135
|
+
begin
|
136
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
137
|
+
result_mapper = RecoveryPointResource.mapper()
|
138
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
139
|
+
rescue Exception => e
|
140
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
result
|
145
|
+
end
|
146
|
+
|
147
|
+
promise.execute
|
148
|
+
end
|
149
|
+
|
150
|
+
#
|
151
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
152
|
+
#
|
153
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
154
|
+
# @param resource_group_name [String] The name of the resource group associated
|
155
|
+
# with the Recovery Services vault.
|
156
|
+
# @param fabric_name [String] The fabric name associated with the backup item.
|
157
|
+
# @param container_name [String] The container name associated with the backup
|
158
|
+
# item.
|
159
|
+
# @param protected_item_name [String] The name of backup item used in this GET
|
160
|
+
# operation.
|
161
|
+
# @param filter [String] startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate {
|
162
|
+
# yyyy-mm-dd hh:mm:ss PM}.
|
163
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
164
|
+
# will be added to the HTTP request.
|
165
|
+
#
|
166
|
+
# @return [Array<RecoveryPointResource>] operation results.
|
167
|
+
#
|
168
|
+
def list(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter = nil, custom_headers = nil)
|
169
|
+
first_page = list_as_lazy(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter, custom_headers)
|
170
|
+
first_page.get_all_items
|
171
|
+
end
|
172
|
+
|
173
|
+
#
|
174
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
175
|
+
#
|
176
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
177
|
+
# @param resource_group_name [String] The name of the resource group associated
|
178
|
+
# with the Recovery Services vault.
|
179
|
+
# @param fabric_name [String] The fabric name associated with the backup item.
|
180
|
+
# @param container_name [String] The container name associated with the backup
|
181
|
+
# item.
|
182
|
+
# @param protected_item_name [String] The name of backup item used in this GET
|
183
|
+
# operation.
|
184
|
+
# @param filter [String] startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate {
|
185
|
+
# yyyy-mm-dd hh:mm:ss PM}.
|
186
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
187
|
+
# will be added to the HTTP request.
|
188
|
+
#
|
189
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
190
|
+
#
|
191
|
+
def list_with_http_info(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter = nil, custom_headers = nil)
|
192
|
+
list_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter, custom_headers).value!
|
193
|
+
end
|
194
|
+
|
195
|
+
#
|
196
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
197
|
+
#
|
198
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
199
|
+
# @param resource_group_name [String] The name of the resource group associated
|
200
|
+
# with the Recovery Services vault.
|
201
|
+
# @param fabric_name [String] The fabric name associated with the backup item.
|
202
|
+
# @param container_name [String] The container name associated with the backup
|
203
|
+
# item.
|
204
|
+
# @param protected_item_name [String] The name of backup item used in this GET
|
205
|
+
# operation.
|
206
|
+
# @param filter [String] startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate {
|
207
|
+
# yyyy-mm-dd hh:mm:ss PM}.
|
208
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
209
|
+
# to the HTTP request.
|
210
|
+
#
|
211
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
212
|
+
#
|
213
|
+
def list_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter = nil, custom_headers = nil)
|
214
|
+
api_version = '2016-06-01'
|
215
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
216
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
217
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
218
|
+
fail ArgumentError, 'fabric_name is nil' if fabric_name.nil?
|
219
|
+
fail ArgumentError, 'container_name is nil' if container_name.nil?
|
220
|
+
fail ArgumentError, 'protected_item_name is nil' if protected_item_name.nil?
|
221
|
+
|
222
|
+
|
223
|
+
request_headers = {}
|
224
|
+
|
225
|
+
# Set Headers
|
226
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
227
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
228
|
+
path_template = '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints'
|
229
|
+
|
230
|
+
request_url = @base_url || @client.base_url
|
231
|
+
|
232
|
+
options = {
|
233
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
234
|
+
path_params: {'vaultName' => vault_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'fabricName' => fabric_name,'containerName' => container_name,'protectedItemName' => protected_item_name},
|
235
|
+
query_params: {'api-version' => api_version,'$filter' => filter},
|
236
|
+
headers: request_headers.merge(custom_headers || {}),
|
237
|
+
base_url: request_url
|
238
|
+
}
|
239
|
+
promise = @client.make_request_async(:get, path_template, options)
|
240
|
+
|
241
|
+
promise = promise.then do |result|
|
242
|
+
http_response = result.response
|
243
|
+
status_code = http_response.status
|
244
|
+
response_content = http_response.body
|
245
|
+
unless status_code == 200
|
246
|
+
error_model = JSON.load(response_content)
|
247
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
248
|
+
end
|
249
|
+
|
250
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
251
|
+
# Deserialize Response
|
252
|
+
if status_code == 200
|
253
|
+
begin
|
254
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
255
|
+
result_mapper = RecoveryPointResourceList.mapper()
|
256
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
257
|
+
rescue Exception => e
|
258
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
result
|
263
|
+
end
|
264
|
+
|
265
|
+
promise.execute
|
266
|
+
end
|
267
|
+
|
268
|
+
#
|
269
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
270
|
+
#
|
271
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
272
|
+
# to List operation.
|
273
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
274
|
+
# will be added to the HTTP request.
|
275
|
+
#
|
276
|
+
# @return [RecoveryPointResourceList] operation results.
|
277
|
+
#
|
278
|
+
def list_next(next_page_link, custom_headers = nil)
|
279
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
280
|
+
response.body unless response.nil?
|
281
|
+
end
|
282
|
+
|
283
|
+
#
|
284
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
285
|
+
#
|
286
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
287
|
+
# to List operation.
|
288
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
289
|
+
# will be added to the HTTP request.
|
290
|
+
#
|
291
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
292
|
+
#
|
293
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
294
|
+
list_next_async(next_page_link, custom_headers).value!
|
295
|
+
end
|
296
|
+
|
297
|
+
#
|
298
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
299
|
+
#
|
300
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
301
|
+
# to List operation.
|
302
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
303
|
+
# to the HTTP request.
|
304
|
+
#
|
305
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
306
|
+
#
|
307
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
308
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
309
|
+
|
310
|
+
|
311
|
+
request_headers = {}
|
312
|
+
|
313
|
+
# Set Headers
|
314
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
315
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
316
|
+
path_template = '{nextLink}'
|
317
|
+
|
318
|
+
request_url = @base_url || @client.base_url
|
319
|
+
|
320
|
+
options = {
|
321
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
322
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
323
|
+
headers: request_headers.merge(custom_headers || {}),
|
324
|
+
base_url: request_url
|
325
|
+
}
|
326
|
+
promise = @client.make_request_async(:get, path_template, options)
|
327
|
+
|
328
|
+
promise = promise.then do |result|
|
329
|
+
http_response = result.response
|
330
|
+
status_code = http_response.status
|
331
|
+
response_content = http_response.body
|
332
|
+
unless status_code == 200
|
333
|
+
error_model = JSON.load(response_content)
|
334
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
335
|
+
end
|
336
|
+
|
337
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
338
|
+
# Deserialize Response
|
339
|
+
if status_code == 200
|
340
|
+
begin
|
341
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
342
|
+
result_mapper = RecoveryPointResourceList.mapper()
|
343
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
344
|
+
rescue Exception => e
|
345
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
349
|
+
result
|
350
|
+
end
|
351
|
+
|
352
|
+
promise.execute
|
353
|
+
end
|
354
|
+
|
355
|
+
#
|
356
|
+
# Lists the recovery points, or backup copies, for the specified backup item.
|
357
|
+
#
|
358
|
+
# @param vault_name [String] The name of the Recovery Services vault.
|
359
|
+
# @param resource_group_name [String] The name of the resource group associated
|
360
|
+
# with the Recovery Services vault.
|
361
|
+
# @param fabric_name [String] The fabric name associated with the backup item.
|
362
|
+
# @param container_name [String] The container name associated with the backup
|
363
|
+
# item.
|
364
|
+
# @param protected_item_name [String] The name of backup item used in this GET
|
365
|
+
# operation.
|
366
|
+
# @param filter [String] startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate {
|
367
|
+
# yyyy-mm-dd hh:mm:ss PM}.
|
368
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
369
|
+
# will be added to the HTTP request.
|
370
|
+
#
|
371
|
+
# @return [RecoveryPointResourceList] which provide lazy access to pages of the
|
372
|
+
# response.
|
373
|
+
#
|
374
|
+
def list_as_lazy(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter = nil, custom_headers = nil)
|
375
|
+
response = list_async(vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter, custom_headers).value!
|
376
|
+
unless response.nil?
|
377
|
+
page = response.body
|
378
|
+
page.next_method = Proc.new do |next_page_link|
|
379
|
+
list_next_async(next_page_link, custom_headers)
|
380
|
+
end
|
381
|
+
page
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
end
|
386
|
+
end
|