azure_mgmt_recovery_services 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_recovery_services.rb +40 -1
  3. data/lib/generated/azure_mgmt_recovery_services/backup_storage_configs.rb +215 -0
  4. data/lib/generated/azure_mgmt_recovery_services/backup_vault_configs.rb +226 -0
  5. data/lib/generated/azure_mgmt_recovery_services/models/auth_type.rb +19 -0
  6. data/lib/generated/azure_mgmt_recovery_services/models/backup_storage_config.rb +100 -0
  7. data/lib/generated/azure_mgmt_recovery_services/models/backup_vault_config.rb +100 -0
  8. data/lib/generated/azure_mgmt_recovery_services/models/certificate_request.rb +46 -0
  9. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_display.rb +79 -0
  10. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_for_log_specification.rb +68 -0
  11. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_for_service_specification.rb +55 -0
  12. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_response.rb +97 -0
  13. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_value_for_single_api.rb +82 -0
  14. data/lib/generated/azure_mgmt_recovery_services/models/enhanced_security_state.rb +17 -0
  15. data/lib/generated/azure_mgmt_recovery_services/models/jobs_summary.rb +65 -0
  16. data/lib/generated/azure_mgmt_recovery_services/models/monitoring_summary.rb +97 -0
  17. data/lib/generated/azure_mgmt_recovery_services/models/name_info.rb +55 -0
  18. data/lib/generated/azure_mgmt_recovery_services/models/raw_certificate_data.rb +57 -0
  19. data/lib/generated/azure_mgmt_recovery_services/models/replication_usage.rb +100 -0
  20. data/lib/generated/azure_mgmt_recovery_services/models/replication_usage_list.rb +54 -0
  21. data/lib/generated/azure_mgmt_recovery_services/models/resource.rb +7 -29
  22. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_and_aad_details.rb +155 -0
  23. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_and_acs_details.rb +135 -0
  24. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_details.rb +128 -0
  25. data/lib/generated/azure_mgmt_recovery_services/models/sku.rb +2 -1
  26. data/lib/generated/azure_mgmt_recovery_services/models/sku_name.rb +1 -1
  27. data/lib/generated/azure_mgmt_recovery_services/models/storage_model_type.rb +17 -0
  28. data/lib/generated/azure_mgmt_recovery_services/models/storage_type.rb +17 -0
  29. data/lib/generated/azure_mgmt_recovery_services/models/storage_type_state.rb +17 -0
  30. data/lib/generated/azure_mgmt_recovery_services/models/tracked_resource.rb +93 -0
  31. data/lib/generated/azure_mgmt_recovery_services/models/trigger_type.rb +16 -0
  32. data/lib/generated/azure_mgmt_recovery_services/models/upgrade_details.rb +138 -0
  33. data/lib/generated/azure_mgmt_recovery_services/models/usages_unit.rb +20 -0
  34. data/lib/generated/azure_mgmt_recovery_services/models/vault.rb +19 -19
  35. data/lib/generated/azure_mgmt_recovery_services/models/vault_certificate_response.rb +79 -0
  36. data/lib/generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb +106 -0
  37. data/lib/generated/azure_mgmt_recovery_services/models/vault_list.rb +13 -32
  38. data/lib/generated/azure_mgmt_recovery_services/models/vault_properties.rb +13 -1
  39. data/lib/generated/azure_mgmt_recovery_services/models/vault_upgrade_state.rb +18 -0
  40. data/lib/generated/azure_mgmt_recovery_services/models/vault_usage.rb +98 -0
  41. data/lib/generated/azure_mgmt_recovery_services/models/vault_usage_list.rb +53 -0
  42. data/lib/generated/azure_mgmt_recovery_services/module_definition.rb +1 -1
  43. data/lib/generated/azure_mgmt_recovery_services/operations.rb +224 -0
  44. data/lib/generated/azure_mgmt_recovery_services/recovery_services_client.rb +33 -5
  45. data/lib/generated/azure_mgmt_recovery_services/registered_identities.rb +112 -0
  46. data/lib/generated/azure_mgmt_recovery_services/replication_usages.rb +119 -0
  47. data/lib/generated/azure_mgmt_recovery_services/usages.rb +119 -0
  48. data/lib/generated/azure_mgmt_recovery_services/vault_certificates.rb +139 -0
  49. data/lib/generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb +339 -0
  50. data/lib/generated/azure_mgmt_recovery_services/vaults.rb +230 -139
  51. data/lib/generated/azure_mgmt_recovery_services/version.rb +2 -2
  52. metadata +43 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4706c5b3e4f21c5e578f54b318eb47376e4a3b22
4
- data.tar.gz: 290af34ad9182e3a6be7c8630d1b9f51d22b1f98
3
+ metadata.gz: f2ea864bc6110b847b60a90a64f6c550091940b3
4
+ data.tar.gz: 9693e12195080937e9ebf3915fcdd835547ecf3d
5
5
  SHA512:
6
- metadata.gz: 5301116343eb763f2f0c45a267217262927c537a6c4f76c226a220e8f51310d70e92227e4bdd049cf5b99b409b294dce3742edcd7b9d286b35ea4b62e7bb8118
7
- data.tar.gz: adb00e2723d0b20b0d36d724928915263934cebeeffd6c22728c6c460c44c63445d96676a646412774ece4ed0233e2851ec54eea3109441e7538838d87a8b389
6
+ metadata.gz: 91e3a1c42c0ea1405d8a793e1f554c4a079b17d5fdb119497008ca267015566af7c28a1e48b71eadcbfb7ea3fd54dcc0d662b1ab37f1bc9161fd634345451bb1
7
+ data.tar.gz: 8247f68c181038d842482fc7e03d8e23d6383b6d15f7011b4678d45f59190b79c1ac2cfb92f108bcba666fba9748a2ff9f45816a7e24ae66076f7f7477af1df8
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -20,15 +20,54 @@ require 'generated/azure_mgmt_recovery_services/module_definition'
20
20
  require 'ms_rest_azure'
21
21
 
22
22
  module Azure::ARM::RecoveryServices
23
+ autoload :BackupVaultConfigs, 'generated/azure_mgmt_recovery_services/backup_vault_configs.rb'
24
+ autoload :BackupStorageConfigs, 'generated/azure_mgmt_recovery_services/backup_storage_configs.rb'
25
+ autoload :VaultCertificates, 'generated/azure_mgmt_recovery_services/vault_certificates.rb'
26
+ autoload :RegisteredIdentities, 'generated/azure_mgmt_recovery_services/registered_identities.rb'
27
+ autoload :ReplicationUsages, 'generated/azure_mgmt_recovery_services/replication_usages.rb'
23
28
  autoload :Vaults, 'generated/azure_mgmt_recovery_services/vaults.rb'
29
+ autoload :Operations, 'generated/azure_mgmt_recovery_services/operations.rb'
30
+ autoload :VaultExtendedInfoOperations, 'generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb'
31
+ autoload :Usages, 'generated/azure_mgmt_recovery_services/usages.rb'
24
32
  autoload :RecoveryServicesClient, 'generated/azure_mgmt_recovery_services/recovery_services_client.rb'
25
33
 
26
34
  module Models
35
+ autoload :VaultCertificateResponse, 'generated/azure_mgmt_recovery_services/models/vault_certificate_response.rb'
27
36
  autoload :VaultList, 'generated/azure_mgmt_recovery_services/models/vault_list.rb'
37
+ autoload :ClientDiscoveryResponse, 'generated/azure_mgmt_recovery_services/models/client_discovery_response.rb'
28
38
  autoload :Sku, 'generated/azure_mgmt_recovery_services/models/sku.rb'
39
+ autoload :ResourceCertificateDetails, 'generated/azure_mgmt_recovery_services/models/resource_certificate_details.rb'
29
40
  autoload :VaultProperties, 'generated/azure_mgmt_recovery_services/models/vault_properties.rb'
41
+ autoload :ClientDiscoveryValueForSingleApi, 'generated/azure_mgmt_recovery_services/models/client_discovery_value_for_single_api.rb'
42
+ autoload :NameInfo, 'generated/azure_mgmt_recovery_services/models/name_info.rb'
43
+ autoload :JobsSummary, 'generated/azure_mgmt_recovery_services/models/jobs_summary.rb'
44
+ autoload :RawCertificateData, 'generated/azure_mgmt_recovery_services/models/raw_certificate_data.rb'
45
+ autoload :MonitoringSummary, 'generated/azure_mgmt_recovery_services/models/monitoring_summary.rb'
46
+ autoload :VaultUsageList, 'generated/azure_mgmt_recovery_services/models/vault_usage_list.rb'
47
+ autoload :ReplicationUsage, 'generated/azure_mgmt_recovery_services/models/replication_usage.rb'
48
+ autoload :VaultUsage, 'generated/azure_mgmt_recovery_services/models/vault_usage.rb'
49
+ autoload :ReplicationUsageList, 'generated/azure_mgmt_recovery_services/models/replication_usage_list.rb'
50
+ autoload :CertificateRequest, 'generated/azure_mgmt_recovery_services/models/certificate_request.rb'
51
+ autoload :ClientDiscoveryDisplay, 'generated/azure_mgmt_recovery_services/models/client_discovery_display.rb'
30
52
  autoload :Resource, 'generated/azure_mgmt_recovery_services/models/resource.rb'
53
+ autoload :ClientDiscoveryForLogSpecification, 'generated/azure_mgmt_recovery_services/models/client_discovery_for_log_specification.rb'
54
+ autoload :UpgradeDetails, 'generated/azure_mgmt_recovery_services/models/upgrade_details.rb'
55
+ autoload :ClientDiscoveryForServiceSpecification, 'generated/azure_mgmt_recovery_services/models/client_discovery_for_service_specification.rb'
56
+ autoload :BackupStorageConfig, 'generated/azure_mgmt_recovery_services/models/backup_storage_config.rb'
57
+ autoload :BackupVaultConfig, 'generated/azure_mgmt_recovery_services/models/backup_vault_config.rb'
58
+ autoload :VaultExtendedInfoResource, 'generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb'
59
+ autoload :TrackedResource, 'generated/azure_mgmt_recovery_services/models/tracked_resource.rb'
31
60
  autoload :Vault, 'generated/azure_mgmt_recovery_services/models/vault.rb'
61
+ autoload :ResourceCertificateAndAadDetails, 'generated/azure_mgmt_recovery_services/models/resource_certificate_and_aad_details.rb'
62
+ autoload :ResourceCertificateAndAcsDetails, 'generated/azure_mgmt_recovery_services/models/resource_certificate_and_acs_details.rb'
63
+ autoload :StorageModelType, 'generated/azure_mgmt_recovery_services/models/storage_model_type.rb'
64
+ autoload :StorageType, 'generated/azure_mgmt_recovery_services/models/storage_type.rb'
65
+ autoload :StorageTypeState, 'generated/azure_mgmt_recovery_services/models/storage_type_state.rb'
66
+ autoload :EnhancedSecurityState, 'generated/azure_mgmt_recovery_services/models/enhanced_security_state.rb'
32
67
  autoload :SkuName, 'generated/azure_mgmt_recovery_services/models/sku_name.rb'
68
+ autoload :VaultUpgradeState, 'generated/azure_mgmt_recovery_services/models/vault_upgrade_state.rb'
69
+ autoload :TriggerType, 'generated/azure_mgmt_recovery_services/models/trigger_type.rb'
70
+ autoload :AuthType, 'generated/azure_mgmt_recovery_services/models/auth_type.rb'
71
+ autoload :UsagesUnit, 'generated/azure_mgmt_recovery_services/models/usages_unit.rb'
33
72
  end
34
73
  end
@@ -0,0 +1,215 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServices
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class BackupStorageConfigs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BackupStorageConfigs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Fetches resource storage config.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group where the
28
+ # recovery services vault is present.
29
+ # @param vault_name [String] The name of the recovery services vault.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [BackupStorageConfig] operation results.
34
+ #
35
+ def get(resource_group_name, vault_name, custom_headers = nil)
36
+ response = get_async(resource_group_name, vault_name, custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Fetches resource storage config.
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group where the
44
+ # recovery services vault is present.
45
+ # @param vault_name [String] The name of the recovery services vault.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(resource_group_name, vault_name, custom_headers = nil)
52
+ get_async(resource_group_name, vault_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Fetches resource storage config.
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group where the
59
+ # recovery services vault is present.
60
+ # @param vault_name [String] The name of the recovery services vault.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(resource_group_name, vault_name, custom_headers = nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ api_version = '2016-12-01'
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
71
+
72
+
73
+ request_headers = {}
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
85
+ query_params: {'api-version' => api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:get, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+ # Deserialize Response
102
+ if status_code == 200
103
+ begin
104
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
+ result_mapper = Azure::ARM::RecoveryServices::Models::BackupStorageConfig.mapper()
106
+ result.body = @client.deserialize(result_mapper, parsed_response)
107
+ rescue Exception => e
108
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
+ end
110
+ end
111
+
112
+ result
113
+ end
114
+
115
+ promise.execute
116
+ end
117
+
118
+ #
119
+ # Updates vault storage model type.
120
+ #
121
+ # @param resource_group_name [String] The name of the resource group where the
122
+ # recovery services vault is present.
123
+ # @param vault_name [String] The name of the recovery services vault.
124
+ # @param backup_storage_config [BackupStorageConfig] Backup storage config.
125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
+ # will be added to the HTTP request.
127
+ #
128
+ #
129
+ def update(resource_group_name, vault_name, backup_storage_config, custom_headers = nil)
130
+ response = update_async(resource_group_name, vault_name, backup_storage_config, custom_headers).value!
131
+ nil
132
+ end
133
+
134
+ #
135
+ # Updates vault storage model type.
136
+ #
137
+ # @param resource_group_name [String] The name of the resource group where the
138
+ # recovery services vault is present.
139
+ # @param vault_name [String] The name of the recovery services vault.
140
+ # @param backup_storage_config [BackupStorageConfig] Backup storage config.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
145
+ #
146
+ def update_with_http_info(resource_group_name, vault_name, backup_storage_config, custom_headers = nil)
147
+ update_async(resource_group_name, vault_name, backup_storage_config, custom_headers).value!
148
+ end
149
+
150
+ #
151
+ # Updates vault storage model type.
152
+ #
153
+ # @param resource_group_name [String] The name of the resource group where the
154
+ # recovery services vault is present.
155
+ # @param vault_name [String] The name of the recovery services vault.
156
+ # @param backup_storage_config [BackupStorageConfig] Backup storage config.
157
+ # @param [Hash{String => String}] A hash of custom headers that will be added
158
+ # to the HTTP request.
159
+ #
160
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
+ #
162
+ def update_async(resource_group_name, vault_name, backup_storage_config, custom_headers = nil)
163
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
164
+ api_version = '2016-12-01'
165
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
166
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
167
+ fail ArgumentError, 'backup_storage_config is nil' if backup_storage_config.nil?
168
+
169
+
170
+ request_headers = {}
171
+
172
+ # Set Headers
173
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
174
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
175
+
176
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
177
+
178
+ # Serialize Request
179
+ request_mapper = Azure::ARM::RecoveryServices::Models::BackupStorageConfig.mapper()
180
+ request_content = @client.serialize(request_mapper, backup_storage_config)
181
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
182
+
183
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'
184
+
185
+ request_url = @base_url || @client.base_url
186
+
187
+ options = {
188
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
189
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
190
+ query_params: {'api-version' => api_version},
191
+ body: request_content,
192
+ headers: request_headers.merge(custom_headers || {}),
193
+ base_url: request_url
194
+ }
195
+ promise = @client.make_request_async(:patch, path_template, options)
196
+
197
+ promise = promise.then do |result|
198
+ http_response = result.response
199
+ status_code = http_response.status
200
+ response_content = http_response.body
201
+ unless status_code == 204
202
+ error_model = JSON.load(response_content)
203
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
204
+ end
205
+
206
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
207
+
208
+ result
209
+ end
210
+
211
+ promise.execute
212
+ end
213
+
214
+ end
215
+ end
@@ -0,0 +1,226 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServices
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class BackupVaultConfigs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BackupVaultConfigs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Fetches vault config.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group where the
28
+ # recovery services vault is present.
29
+ # @param vault_name [String] The name of the recovery services vault.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [BackupVaultConfig] operation results.
34
+ #
35
+ def get(resource_group_name, vault_name, custom_headers = nil)
36
+ response = get_async(resource_group_name, vault_name, custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Fetches vault config.
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group where the
44
+ # recovery services vault is present.
45
+ # @param vault_name [String] The name of the recovery services vault.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(resource_group_name, vault_name, custom_headers = nil)
52
+ get_async(resource_group_name, vault_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Fetches vault config.
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group where the
59
+ # recovery services vault is present.
60
+ # @param vault_name [String] The name of the recovery services vault.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(resource_group_name, vault_name, custom_headers = nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ api_version = '2016-12-01'
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
71
+
72
+
73
+ request_headers = {}
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
85
+ query_params: {'api-version' => api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:get, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+ # Deserialize Response
102
+ if status_code == 200
103
+ begin
104
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
+ result_mapper = Azure::ARM::RecoveryServices::Models::BackupVaultConfig.mapper()
106
+ result.body = @client.deserialize(result_mapper, parsed_response)
107
+ rescue Exception => e
108
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
+ end
110
+ end
111
+
112
+ result
113
+ end
114
+
115
+ promise.execute
116
+ end
117
+
118
+ #
119
+ # Updates vault config model type.
120
+ #
121
+ # @param resource_group_name [String] The name of the resource group where the
122
+ # recovery services vault is present.
123
+ # @param vault_name [String] The name of the recovery services vault.
124
+ # @param backup_vault_config [BackupVaultConfig] Backup vault config.
125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
+ # will be added to the HTTP request.
127
+ #
128
+ # @return [BackupVaultConfig] operation results.
129
+ #
130
+ def update(resource_group_name, vault_name, backup_vault_config, custom_headers = nil)
131
+ response = update_async(resource_group_name, vault_name, backup_vault_config, custom_headers).value!
132
+ response.body unless response.nil?
133
+ end
134
+
135
+ #
136
+ # Updates vault config model type.
137
+ #
138
+ # @param resource_group_name [String] The name of the resource group where the
139
+ # recovery services vault is present.
140
+ # @param vault_name [String] The name of the recovery services vault.
141
+ # @param backup_vault_config [BackupVaultConfig] Backup vault config.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
146
+ #
147
+ def update_with_http_info(resource_group_name, vault_name, backup_vault_config, custom_headers = nil)
148
+ update_async(resource_group_name, vault_name, backup_vault_config, custom_headers).value!
149
+ end
150
+
151
+ #
152
+ # Updates vault config model type.
153
+ #
154
+ # @param resource_group_name [String] The name of the resource group where the
155
+ # recovery services vault is present.
156
+ # @param vault_name [String] The name of the recovery services vault.
157
+ # @param backup_vault_config [BackupVaultConfig] Backup vault config.
158
+ # @param [Hash{String => String}] A hash of custom headers that will be added
159
+ # to the HTTP request.
160
+ #
161
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
162
+ #
163
+ def update_async(resource_group_name, vault_name, backup_vault_config, custom_headers = nil)
164
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
165
+ api_version = '2016-12-01'
166
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
167
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
168
+ fail ArgumentError, 'backup_vault_config is nil' if backup_vault_config.nil?
169
+
170
+
171
+ request_headers = {}
172
+
173
+ # Set Headers
174
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
175
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
176
+
177
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
178
+
179
+ # Serialize Request
180
+ request_mapper = Azure::ARM::RecoveryServices::Models::BackupVaultConfig.mapper()
181
+ request_content = @client.serialize(request_mapper, backup_vault_config)
182
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
183
+
184
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'
185
+
186
+ request_url = @base_url || @client.base_url
187
+
188
+ options = {
189
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
190
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
191
+ query_params: {'api-version' => api_version},
192
+ body: request_content,
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
+ }
196
+ promise = @client.make_request_async(:patch, path_template, options)
197
+
198
+ promise = promise.then do |result|
199
+ http_response = result.response
200
+ status_code = http_response.status
201
+ response_content = http_response.body
202
+ unless status_code == 200
203
+ error_model = JSON.load(response_content)
204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
205
+ end
206
+
207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
+ # Deserialize Response
209
+ if status_code == 200
210
+ begin
211
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
212
+ result_mapper = Azure::ARM::RecoveryServices::Models::BackupVaultConfig.mapper()
213
+ result.body = @client.deserialize(result_mapper, parsed_response)
214
+ rescue Exception => e
215
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
216
+ end
217
+ end
218
+
219
+ result
220
+ end
221
+
222
+ promise.execute
223
+ end
224
+
225
+ end
226
+ end