Class: Azure::RecoveryServicesBackup::Mgmt::V2016_06_01::RecoveryServicesBackupClient
- Inherits:
-
MsRestAzure::AzureServiceClient
- Object
- MsRestAzure::AzureServiceClient
- Azure::RecoveryServicesBackup::Mgmt::V2016_06_01::RecoveryServicesBackupClient
- Includes:
- MsRestAzure, MsRestAzure::Serialization
- Defined in:
- lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb
Overview
A service client - single point of access to the REST API.
Instance Attribute Summary collapse
-
#accept_language ⇒ String
The preferred language for the response.
-
#api_version ⇒ String
readonly
Client API version.
-
#backup_engines ⇒ BackupEngines
readonly
Backup_engines.
-
#backup_operation_results ⇒ BackupOperationResults
readonly
Backup_operation_results.
-
#backup_operation_statuses ⇒ BackupOperationStatuses
readonly
Backup_operation_statuses.
-
#backups ⇒ Backups
readonly
Backups.
-
#base_url ⇒ String
The base URI of the service.
-
#credentials ⇒ Object
readonly
Credentials needed for the client to connect to Azure.
-
#export_jobs_operation_results ⇒ ExportJobsOperationResults
readonly
Export_jobs_operation_results.
-
#generate_client_request_id ⇒ Boolean
generated.
-
#item_level_recovery_connections ⇒ ItemLevelRecoveryConnections
readonly
Item_level_recovery_connections.
-
#job_cancellations ⇒ JobCancellations
readonly
Job_cancellations.
-
#job_details ⇒ JobDetails
readonly
Job_details.
-
#job_operation_results ⇒ JobOperationResults
readonly
Job_operation_results.
-
#jobs ⇒ Jobs
readonly
Jobs.
-
#long_running_operation_retry_timeout ⇒ Integer
Operations.
-
#protectable_items ⇒ ProtectableItems
readonly
Protectable_items.
-
#protected_item_operation_results ⇒ ProtectedItemOperationResults
readonly
Protected_item_operation_results.
-
#protected_item_operation_statuses ⇒ ProtectedItemOperationStatuses
readonly
protected_item_operation_statuses.
-
#protected_items ⇒ ProtectedItems
readonly
Protected_items.
-
#protection_container_operation_results ⇒ ProtectionContainerOperationResults
readonly
protection_container_operation_results.
-
#protection_container_refresh_operation_results ⇒ ProtectionContainerRefreshOperationResults
readonly
protection_container_refresh_operation_results.
-
#protection_containers ⇒ ProtectionContainers
readonly
Protection_containers.
-
#protection_policies ⇒ ProtectionPolicies
readonly
Protection_policies.
-
#protection_policy_operation_results ⇒ ProtectionPolicyOperationResults
readonly
protection_policy_operation_results.
-
#protection_policy_operation_statuses ⇒ ProtectionPolicyOperationStatuses
readonly
protection_policy_operation_statuses.
-
#recovery_points ⇒ RecoveryPoints
readonly
Recovery_points.
-
#restores ⇒ Restores
readonly
Restores.
-
#subscription_id ⇒ String
The subscription ID.
Instance Method Summary collapse
-
#initialize(credentials = nil, base_url = nil, options = nil) ⇒ RecoveryServicesBackupClient
constructor
Creates initializes a new instance of the RecoveryServicesBackupClient class.
-
#make_request(method, path, options = {}) ⇒ Hash{String=>String}
Makes a request and returns the body of the response.
-
#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise
Makes a request asynchronously.
-
#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse
Makes a request and returns the operation response.
Constructor Details
#initialize(credentials = nil, base_url = nil, options = nil) ⇒ RecoveryServicesBackupClient
Creates initializes a new instance of the RecoveryServicesBackupClient class.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 119 def initialize(credentials = nil, base_url = nil, = nil) super(credentials, ) @base_url = base_url || 'https://management.azure.com' fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials @item_level_recovery_connections = ItemLevelRecoveryConnections.new(self) @restores = Restores.new(self) @protection_policy_operation_statuses = ProtectionPolicyOperationStatuses.new(self) @protection_policy_operation_results = ProtectionPolicyOperationResults.new(self) @protection_policies = ProtectionPolicies.new(self) @protection_container_operation_results = ProtectionContainerOperationResults.new(self) @protection_container_refresh_operation_results = ProtectionContainerRefreshOperationResults.new(self) @protection_containers = ProtectionContainers.new(self) @recovery_points = RecoveryPoints.new(self) @backups = Backups.new(self) @protected_item_operation_statuses = ProtectedItemOperationStatuses.new(self) @protected_item_operation_results = ProtectedItemOperationResults.new(self) @protected_items = ProtectedItems.new(self) @protectable_items = ProtectableItems.new(self) @export_jobs_operation_results = ExportJobsOperationResults.new(self) @job_operation_results = JobOperationResults.new(self) @jobs = Jobs.new(self) @job_cancellations = JobCancellations.new(self) @job_details = JobDetails.new(self) @backup_operation_statuses = BackupOperationStatuses.new(self) @backup_operation_results = BackupOperationResults.new(self) @backup_engines = BackupEngines.new(self) @api_version = '2016-06-01' @accept_language = 'en-US' @long_running_operation_retry_timeout = 30 @generate_client_request_id = true add_telemetry end |
Instance Attribute Details
#accept_language ⇒ String
Returns The preferred language for the response.
31 32 33 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 31 def accept_language @accept_language end |
#api_version ⇒ String (readonly)
Returns Client API version.
28 29 30 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 28 def api_version @api_version end |
#backup_engines ⇒ BackupEngines (readonly)
Returns backup_engines.
111 112 113 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 111 def backup_engines @backup_engines end |
#backup_operation_results ⇒ BackupOperationResults (readonly)
Returns backup_operation_results.
108 109 110 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 108 def backup_operation_results @backup_operation_results end |
#backup_operation_statuses ⇒ BackupOperationStatuses (readonly)
Returns backup_operation_statuses.
105 106 107 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 105 def backup_operation_statuses @backup_operation_statuses end |
#backups ⇒ Backups (readonly)
Returns backups.
74 75 76 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 74 def backups @backups end |
#base_url ⇒ String
Returns the base URI of the service.
19 20 21 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 19 def base_url @base_url end |
#credentials ⇒ Object (readonly)
Returns Credentials needed for the client to connect to Azure.
22 23 24 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 22 def credentials @credentials end |
#export_jobs_operation_results ⇒ ExportJobsOperationResults (readonly)
Returns export_jobs_operation_results.
90 91 92 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 90 def export_jobs_operation_results @export_jobs_operation_results end |
#generate_client_request_id ⇒ Boolean
generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
40 41 42 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 40 def generate_client_request_id @generate_client_request_id end |
#item_level_recovery_connections ⇒ ItemLevelRecoveryConnections (readonly)
Returns item_level_recovery_connections.
43 44 45 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 43 def item_level_recovery_connections @item_level_recovery_connections end |
#job_cancellations ⇒ JobCancellations (readonly)
Returns job_cancellations.
99 100 101 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 99 def job_cancellations @job_cancellations end |
#job_details ⇒ JobDetails (readonly)
Returns job_details.
102 103 104 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 102 def job_details @job_details end |
#job_operation_results ⇒ JobOperationResults (readonly)
Returns job_operation_results.
93 94 95 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 93 def job_operation_results @job_operation_results end |
#jobs ⇒ Jobs (readonly)
Returns jobs.
96 97 98 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 96 def jobs @jobs end |
#long_running_operation_retry_timeout ⇒ Integer
Operations. Default value is 30.
35 36 37 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 35 def long_running_operation_retry_timeout @long_running_operation_retry_timeout end |
#protectable_items ⇒ ProtectableItems (readonly)
Returns protectable_items.
87 88 89 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 87 def protectable_items @protectable_items end |
#protected_item_operation_results ⇒ ProtectedItemOperationResults (readonly)
Returns protected_item_operation_results.
81 82 83 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 81 def protected_item_operation_results @protected_item_operation_results end |
#protected_item_operation_statuses ⇒ ProtectedItemOperationStatuses (readonly)
protected_item_operation_statuses
78 79 80 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 78 def protected_item_operation_statuses @protected_item_operation_statuses end |
#protected_items ⇒ ProtectedItems (readonly)
Returns protected_items.
84 85 86 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 84 def protected_items @protected_items end |
#protection_container_operation_results ⇒ ProtectionContainerOperationResults (readonly)
protection_container_operation_results
61 62 63 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 61 def protection_container_operation_results @protection_container_operation_results end |
#protection_container_refresh_operation_results ⇒ ProtectionContainerRefreshOperationResults (readonly)
protection_container_refresh_operation_results
65 66 67 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 65 def protection_container_refresh_operation_results @protection_container_refresh_operation_results end |
#protection_containers ⇒ ProtectionContainers (readonly)
Returns protection_containers.
68 69 70 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 68 def protection_containers @protection_containers end |
#protection_policies ⇒ ProtectionPolicies (readonly)
Returns protection_policies.
57 58 59 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 57 def protection_policies @protection_policies end |
#protection_policy_operation_results ⇒ ProtectionPolicyOperationResults (readonly)
protection_policy_operation_results
54 55 56 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 54 def protection_policy_operation_results @protection_policy_operation_results end |
#protection_policy_operation_statuses ⇒ ProtectionPolicyOperationStatuses (readonly)
protection_policy_operation_statuses
50 51 52 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 50 def protection_policy_operation_statuses @protection_policy_operation_statuses end |
#recovery_points ⇒ RecoveryPoints (readonly)
Returns recovery_points.
71 72 73 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 71 def recovery_points @recovery_points end |
#restores ⇒ Restores (readonly)
Returns restores.
46 47 48 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 46 def restores @restores end |
#subscription_id ⇒ String
Returns The subscription ID.
25 26 27 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 25 def subscription_id @subscription_id end |
Instance Method Details
#make_request(method, path, options = {}) ⇒ Hash{String=>String}
Makes a request and returns the body of the response. Example:
request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
= {
body: request_content,
query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, )
171 172 173 174 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 171 def make_request(method, path, = {}) result = make_request_with_http_info(method, path, ) result.body unless result.nil? end |
#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise
Makes a request asynchronously.
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 196 def make_request_async(method, path, = {}) fail ArgumentError, 'method is nil' if method.nil? fail ArgumentError, 'path is nil' if path.nil? request_url = [:base_url] || @base_url if(![:headers].nil? && ![:headers]['Content-Type'].nil?) @request_headers['Content-Type'] = [:headers]['Content-Type'] end request_headers = @request_headers request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? .merge!({headers: request_headers.merge([:headers] || {})}) .merge!({credentials: @credentials}) unless @credentials.nil? super(request_url, method, path, ) end |
#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse
Makes a request and returns the operation response.
183 184 185 186 187 |
# File 'lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 183 def make_request_with_http_info(method, path, = {}) result = make_request_async(method, path, ).value! result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) result end |