Class: Azure::RecoveryServicesBackup::Mgmt::V2019_05_13::RecoveryServicesBackupClient
- Inherits:
-
MsRestAzure::AzureServiceClient
- Object
- MsRestAzure::AzureServiceClient
- Azure::RecoveryServicesBackup::Mgmt::V2019_05_13::RecoveryServicesBackupClient
- Includes:
- MsRestAzure, MsRestAzure::Serialization
- Defined in:
- lib/2019-05-13/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_jobs ⇒ BackupJobs
readonly
Backup_jobs.
-
#backup_policies ⇒ BackupPolicies
readonly
Backup_policies.
-
#backup_protected_items ⇒ BackupProtectedItems
readonly
Backup_protected_items.
-
#backup_resource_vault_configs ⇒ BackupResourceVaultConfigs
readonly
Backup_resource_vault_configs.
-
#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.
-
#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.
-
#operation ⇒ Operation
readonly
Operation.
-
#protected_item_operation_results ⇒ ProtectedItemOperationResults
readonly
Protected_item_operation_results.
-
#protected_items ⇒ ProtectedItems
readonly
Protected_items.
-
#protection_policies ⇒ ProtectionPolicies
readonly
Protection_policies.
-
#protection_policy_operation_results ⇒ ProtectionPolicyOperationResults
readonly
protection_policy_operation_results.
-
#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.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 93 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 @backup_resource_vault_configs = BackupResourceVaultConfigs.new(self) @protected_items = ProtectedItems.new(self) @protected_item_operation_results = ProtectedItemOperationResults.new(self) @recovery_points = RecoveryPoints.new(self) @restores = Restores.new(self) @backup_policies = BackupPolicies.new(self) @protection_policies = ProtectionPolicies.new(self) @protection_policy_operation_results = ProtectionPolicyOperationResults.new(self) @backup_jobs = BackupJobs.new(self) @job_details = JobDetails.new(self) @job_cancellations = JobCancellations.new(self) @job_operation_results = JobOperationResults.new(self) @export_jobs_operation_results = ExportJobsOperationResults.new(self) @jobs = Jobs.new(self) @backup_protected_items = BackupProtectedItems.new(self) @operation = Operation.new(self) @api_version = '2019-05-13' @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.
27 28 29 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 27 def accept_language @accept_language end |
#api_version ⇒ String (readonly)
Returns Client Api Version.
24 25 26 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 24 def api_version @api_version end |
#backup_jobs ⇒ BackupJobs (readonly)
Returns backup_jobs.
64 65 66 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 64 def backup_jobs @backup_jobs end |
#backup_policies ⇒ BackupPolicies (readonly)
Returns backup_policies.
54 55 56 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 54 def backup_policies @backup_policies end |
#backup_protected_items ⇒ BackupProtectedItems (readonly)
Returns backup_protected_items.
82 83 84 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 82 def backup_protected_items @backup_protected_items end |
#backup_resource_vault_configs ⇒ BackupResourceVaultConfigs (readonly)
Returns backup_resource_vault_configs.
39 40 41 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 39 def backup_resource_vault_configs @backup_resource_vault_configs end |
#base_url ⇒ String
Returns the base URI of the service.
15 16 17 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 15 def base_url @base_url end |
#credentials ⇒ Object (readonly)
Returns Credentials needed for the client to connect to Azure.
18 19 20 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 18 def credentials @credentials end |
#export_jobs_operation_results ⇒ ExportJobsOperationResults (readonly)
Returns export_jobs_operation_results.
76 77 78 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 76 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.
36 37 38 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 36 def generate_client_request_id @generate_client_request_id end |
#job_cancellations ⇒ JobCancellations (readonly)
Returns job_cancellations.
70 71 72 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 70 def job_cancellations @job_cancellations end |
#job_details ⇒ JobDetails (readonly)
Returns job_details.
67 68 69 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 67 def job_details @job_details end |
#job_operation_results ⇒ JobOperationResults (readonly)
Returns job_operation_results.
73 74 75 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 73 def job_operation_results @job_operation_results end |
#jobs ⇒ Jobs (readonly)
Returns jobs.
79 80 81 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 79 def jobs @jobs end |
#long_running_operation_retry_timeout ⇒ Integer
Operations. Default value is 30.
31 32 33 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 31 def long_running_operation_retry_timeout @long_running_operation_retry_timeout end |
#operation ⇒ Operation (readonly)
Returns operation.
85 86 87 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 85 def operation @operation end |
#protected_item_operation_results ⇒ ProtectedItemOperationResults (readonly)
Returns protected_item_operation_results.
45 46 47 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 45 def protected_item_operation_results @protected_item_operation_results end |
#protected_items ⇒ ProtectedItems (readonly)
Returns protected_items.
42 43 44 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 42 def protected_items @protected_items end |
#protection_policies ⇒ ProtectionPolicies (readonly)
Returns protection_policies.
57 58 59 |
# File 'lib/2019-05-13/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
61 62 63 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 61 def protection_policy_operation_results @protection_policy_operation_results end |
#recovery_points ⇒ RecoveryPoints (readonly)
Returns recovery_points.
48 49 50 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 48 def recovery_points @recovery_points end |
#restores ⇒ Restores (readonly)
Returns restores.
51 52 53 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 51 def restores @restores end |
#subscription_id ⇒ String
Returns The subscription Id.
21 22 23 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 21 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, )
139 140 141 142 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 139 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.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 164 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.
151 152 153 154 155 |
# File 'lib/2019-05-13/generated/azure_mgmt_recovery_services_backup/recovery_services_backup_client.rb', line 151 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 |