class Azure::KeyVault::V7_2_preview::KeyVaultClient
A service client - single point of access to the REST API.
Attributes
@return [String] The preferred language for the response.
@return [String] Client API version.
@return [String] the base URI of the service.
@return Credentials needed for the client to connect to Azure
.
@return [Boolean] Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
@return [HSMSecurityDomain] hsmsecurity_domain
@return [Integer] The retry timeout in seconds for Long Running Operations. Default value is 30.
@return [RoleAssignments] role_assignments
@return [RoleDefinitions] role_definitions
Public Class Methods
Creates initializes a new instance of the KeyVaultClient
class. @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. @param options [Array] filters to be applied to the HTTP requests.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 49 def initialize(credentials = nil, options = nil) super(credentials, options) @base_url = '{vaultBaseUrl}' fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials @role_definitions = RoleDefinitions.new(self) @role_assignments = RoleAssignments.new(self) @hsmsecurity_domain = HSMSecurityDomain.new(self) @api_version = '7.2-preview' @accept_language = 'en-US' @long_running_operation_retry_timeout = 30 @generate_client_request_id = true add_telemetry end
Public Instance Methods
Backs up the specified certificate.
Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [BackupCertificateResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2697 def backup_certificate(vault_base_url, certificate_name, custom_headers:nil) response = backup_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Backs up the specified certificate.
Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2736 def backup_certificate_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}/backup' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::BackupCertificateResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Backs up the specified certificate.
Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2717 def backup_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil) backup_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Requests that a backup of the specified key be downloaded to the client.
The Key Backup operation exports a key from Azure
Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure
Key Vault system, the returned key material is either protected to a Azure
Key Vault HSM or to Azure
Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
Key Vault instance, BACKUP the key, and then RESTORE it into another Azure
Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure
Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [BackupKeyResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4323 def backup_key(vault_base_url, key_name, custom_headers:nil) response = backup_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Requests that a backup of the specified key be downloaded to the client.
The Key Backup operation exports a key from Azure
Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure
Key Vault system, the returned key material is either protected to a Azure
Key Vault HSM or to Azure
Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
Key Vault instance, BACKUP the key, and then RESTORE it into another Azure
Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure
Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4382 def backup_key_async(vault_base_url, key_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'keys/{key-name}/backup' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::BackupKeyResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Requests that a backup of the specified key be downloaded to the client.
The Key Backup operation exports a key from Azure
Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure
Key Vault system, the returned key material is either protected to a Azure
Key Vault HSM or to Azure
Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure
Key Vault instance, BACKUP the key, and then RESTORE it into another Azure
Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure
Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4353 def backup_key_with_http_info(vault_base_url, key_name, custom_headers:nil) backup_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! end
Backs up the specified secret.
Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [BackupSecretResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7223 def backup_secret(vault_base_url, secret_name, custom_headers:nil) response = backup_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Backs up the specified secret.
Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7262 def backup_secret_async(vault_base_url, secret_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'secrets/{secret-name}/backup' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::BackupSecretResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Backs up the specified secret.
Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7243 def backup_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil) backup_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! end
Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [BackupStorageResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7984 def backup_storage_account(vault_base_url, storage_account_name, custom_headers:nil) response = backup_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8021 def backup_storage_account_async(vault_base_url, storage_account_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage/{storage-account-name}/backup' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::BackupStorageResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8003 def backup_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers:nil) backup_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! end
Creates a full backup using a user-provided SAS token to an Azure
blob storage container.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param azure_storage_blob_container_uri [SASTokenParameter] Azure
blob shared access signature token pointing to a valid Azure
blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FullBackupOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10339 def begin_full_backup(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil) response = begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a full backup using a user-provided SAS token to an Azure
blob storage container.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param azure_storage_blob_container_uri [SASTokenParameter] Azure
blob shared access signature token pointing to a valid Azure
blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10378 def begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SASTokenParameter.mapper() request_content = self.serialize(request_mapper, azure_storage_blob_container_uri) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'backup' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::FullBackupOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates a full backup using a user-provided SAS token to an Azure
blob storage container.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param azure_storage_blob_container_uri [SASTokenParameter] Azure
blob shared access signature token pointing to a valid Azure
blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10359 def begin_full_backup_with_http_info(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil) begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value! end
Restores all key materials using the SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param restore_blob_details [RestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [RestoreOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10452 def begin_full_restore_operation(vault_base_url, restore_blob_details:nil, custom_headers:nil) response = begin_full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores all key materials using the SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param restore_blob_details [RestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10489 def begin_full_restore_operation_async(vault_base_url, restore_blob_details:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperationParameters.mapper() request_content = self.serialize(request_mapper, restore_blob_details) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores all key materials using the SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param restore_blob_details [RestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10471 def begin_full_restore_operation_with_http_info(vault_base_url, restore_blob_details:nil, custom_headers:nil) begin_full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! end
Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to be restored from the user supplied backup @param restore_blob_details [SelectiveKeyRestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SelectiveKeyRestoreOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10565 def begin_selective_key_restore_operation_method(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil) response = begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to be restored from the user supplied backup @param restore_blob_details [SelectiveKeyRestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10606 def begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperationParameters.mapper() request_content = self.serialize(request_mapper, restore_blob_details) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{keyName}/restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'keyName' => key_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to be restored from the user supplied backup @param restore_blob_details [SelectiveKeyRestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10586 def begin_selective_key_restore_operation_method_with_http_info(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil) begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! end
Creates a new certificate.
If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1301 def create_certificate(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) response = create_certificate_async(vault_base_url, certificate_name, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a new certificate.
If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1350 def create_certificate_async(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameters = Azure::KeyVault::V7_2_preview::Models::CertificateCreateParameters.new unless certificate_policy.nil? && certificate_attributes.nil? && tags.nil? parameters.certificate_policy = certificate_policy parameters.certificate_attributes = certificate_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateCreateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/{certificate-name}/create' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates a new certificate.
If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1326 def create_certificate_with_http_info(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) create_certificate_async(vault_base_url, certificate_name, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! end
Creates a new key, stores it, then returns key parameters and attributes to the client.
The create key operation can be used to create any key type in Azure
Key Vault. If the named key already exists, Azure
Key Vault creates a new version of the key. It requires the keys/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name for the new key. The system will generate the version name for the new key. @param kty [JsonWebKeyType] The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' @param key_size [Integer] The key size in bits. For example: 2048, 3072, or 4096 for RSA. @param public_exponent [Integer] The public exponent for a RSA key. @param key_ops [Array<JsonWebKeyOperation>] @param key_attributes [KeyAttributes] @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param curve [JsonWebKeyCurveName] Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3398 def create_key(vault_base_url, key_name, kty, key_size:nil, public_exponent:nil, key_ops:nil, key_attributes:nil, tags:nil, curve:nil, custom_headers:nil) response = create_key_async(vault_base_url, key_name, kty, key_size:key_size, public_exponent:public_exponent, key_ops:key_ops, key_attributes:key_attributes, tags:tags, curve:curve, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a new key, stores it, then returns key parameters and attributes to the client.
The create key operation can be used to create any key type in Azure
Key Vault. If the named key already exists, Azure
Key Vault creates a new version of the key. It requires the keys/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name for the new key. The system will generate the version name for the new key. @param kty [JsonWebKeyType] The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' @param key_size [Integer] The key size in bits. For example: 2048, 3072, or 4096 for RSA. @param public_exponent [Integer] The public exponent for a RSA key. @param key_ops [Array<JsonWebKeyOperation>] @param key_attributes [KeyAttributes] @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param curve [JsonWebKeyCurveName] Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3467 def create_key_async(vault_base_url, key_name, kty, key_size:nil, public_exponent:nil, key_ops:nil, key_attributes:nil, tags:nil, curve:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !key_name.nil? && key_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'kty is nil' if kty.nil? fail ArgumentError, "'kty' should satisfy the constraint - 'MinLength': '1'" if !kty.nil? && kty.length < 1 parameters = Azure::KeyVault::V7_2_preview::Models::KeyCreateParameters.new unless kty.nil? && key_size.nil? && public_exponent.nil? && key_ops.nil? && key_attributes.nil? && tags.nil? && curve.nil? parameters.kty = kty parameters.key_size = key_size parameters.public_exponent = public_exponent parameters.key_ops = key_ops parameters.key_attributes = key_attributes parameters.tags = tags parameters.curve = curve end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyCreateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/create' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates a new key, stores it, then returns key parameters and attributes to the client.
The create key operation can be used to create any key type in Azure
Key Vault. If the named key already exists, Azure
Key Vault creates a new version of the key. It requires the keys/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name for the new key. The system will generate the version name for the new key. @param kty [JsonWebKeyType] The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct', 'oct-HSM' @param key_size [Integer] The key size in bits. For example: 2048, 3072, or 4096 for RSA. @param public_exponent [Integer] The public exponent for a RSA key. @param key_ops [Array<JsonWebKeyOperation>] @param key_attributes [KeyAttributes] @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param curve [JsonWebKeyCurveName] Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3433 def create_key_with_http_info(vault_base_url, key_name, kty, key_size:nil, public_exponent:nil, key_ops:nil, key_attributes:nil, tags:nil, curve:nil, custom_headers:nil) create_key_async(vault_base_url, key_name, kty, key_size:key_size, public_exponent:public_exponent, key_ops:key_ops, key_attributes:key_attributes, tags:tags, curve:curve, custom_headers:custom_headers).value! end
Decrypts a single block of encrypted data.
The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure
Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyOperationResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4801 def decrypt(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) response = decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! response.body unless response.nil? end
Decrypts a single block of encrypted data.
The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure
Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4870 def decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'algorithm is nil' if algorithm.nil? fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1 fail ArgumentError, 'value is nil' if value.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil? parameters.algorithm = algorithm parameters.value = value parameters.iv = iv parameters.aad = aad parameters.tag = tag end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}/decrypt' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Decrypts a single block of encrypted data.
The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure
Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4836 def decrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! end
Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedCertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 258 def delete_certificate(vault_base_url, certificate_name, custom_headers:nil) response = delete_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 299 def delete_certificate_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedCertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes the certificate contacts for a specified key vault.
Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Contacts] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 583 def delete_certificate_contacts(vault_base_url, custom_headers:nil) response = delete_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes the certificate contacts for a specified key vault.
Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 618 def delete_certificate_contacts_async(vault_base_url, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/contacts' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::Contacts.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes the certificate contacts for a specified key vault.
Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 601 def delete_certificate_contacts_with_http_info(vault_base_url, custom_headers:nil) delete_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value! end
Deletes the specified certificate issuer.
The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [IssuerBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1187 def delete_certificate_issuer(vault_base_url, issuer_name, custom_headers:nil) response = delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes the specified certificate issuer.
The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1226 def delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'issuer_name is nil' if issuer_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/issuers/{issuer-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'issuer-name' => issuer_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::IssuerBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes the specified certificate issuer.
The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1207 def delete_certificate_issuer_with_http_info(vault_base_url, issuer_name, custom_headers:nil) delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value! end
Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2444 def delete_certificate_operation(vault_base_url, certificate_name, custom_headers:nil) response = delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2483 def delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}/pending' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2464 def delete_certificate_operation_with_http_info(vault_base_url, certificate_name, custom_headers:nil) delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Deletes a certificate from a specified key vault.
Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 279 def delete_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil) delete_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Deletes a key of any type from storage in Azure
Key Vault.
The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to delete. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedKeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3705 def delete_key(vault_base_url, key_name, custom_headers:nil) response = delete_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes a key of any type from storage in Azure
Key Vault.
The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to delete. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3748 def delete_key_async(vault_base_url, key_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'keys/{key-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedKeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes a key of any type from storage in Azure
Key Vault.
The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to delete. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3727 def delete_key_with_http_info(vault_base_url, key_name, custom_headers:nil) delete_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! end
Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSasDefinitionBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9276 def delete_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) response = delete_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9311 def delete_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil? fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name,'sas-definition-name' => sas_definition_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSasDefinitionBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9294 def delete_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) delete_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! end
Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure
Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6197 def delete_secret(vault_base_url, secret_name, custom_headers:nil) response = delete_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure
Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6236 def delete_secret_async(vault_base_url, secret_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'secrets/{secret-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure
Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6217 def delete_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil) delete_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! end
Deletes a storage account. This operation requires the storage/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedStorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8207 def delete_storage_account(vault_base_url, storage_account_name, custom_headers:nil) response = delete_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes a storage account. This operation requires the storage/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8240 def delete_storage_account_async(vault_base_url, storage_account_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage/{storage-account-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedStorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Deletes a storage account. This operation requires the storage/delete permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8224 def delete_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers:nil) delete_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! end
Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure
Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure
Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyOperationResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4620 def encrypt(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) response = encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! response.body unless response.nil? end
Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure
Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure
Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4697 def encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'algorithm is nil' if algorithm.nil? fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1 fail ArgumentError, 'value is nil' if value.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil? parameters.algorithm = algorithm parameters.value = value parameters.iv = iv parameters.aad = aad parameters.tag = tag end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}/encrypt' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure
Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure
Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4659 def encrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! end
Creates a full backup using a user-provided SAS token to an Azure
blob storage container.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param azure_storage_blob_container_uri [SASTokenParameter] Azure
blob shared access signature token pointing to a valid Azure
blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FullBackupOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9801 def full_backup(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil) response = full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a full backup using a user-provided SAS token to an Azure
blob storage container.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param azure_storage_blob_container_uri [SASTokenParameter] Azure
blob shared access signature token pointing to a valid Azure
blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9840 def full_backup_async(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SASTokenParameter.mapper() request_content = self.serialize(request_mapper, azure_storage_blob_container_uri) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'backup' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::FullBackupOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Returns the status of full backup operation
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param job_id [String] The id returned as part of the backup request @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FullBackupOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9911 def full_backup_status(vault_base_url, job_id, custom_headers:nil) response = full_backup_status_async(vault_base_url, job_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Returns the status of full backup operation
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param job_id [String] The id returned as part of the backup request @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9942 def full_backup_status_async(vault_base_url, job_id, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'job_id is nil' if job_id.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'backup/{jobId}/pending' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'jobId' => job_id}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::FullBackupOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Returns the status of full backup operation
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param job_id [String] The id returned as part of the backup request @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9927 def full_backup_status_with_http_info(vault_base_url, job_id, custom_headers:nil) full_backup_status_async(vault_base_url, job_id, custom_headers:custom_headers).value! end
Creates a full backup using a user-provided SAS token to an Azure
blob storage container.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param azure_storage_blob_container_uri [SASTokenParameter] Azure
blob shared access signature token pointing to a valid Azure
blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9821 def full_backup_with_http_info(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil) full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value! end
Restores all key materials using the SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param restore_blob_details [RestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [RestoreOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10011 def full_restore_operation(vault_base_url, restore_blob_details:nil, custom_headers:nil) response = full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores all key materials using the SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param restore_blob_details [RestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10048 def full_restore_operation_async(vault_base_url, restore_blob_details:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperationParameters.mapper() request_content = self.serialize(request_mapper, restore_blob_details) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores all key materials using the SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param restore_blob_details [RestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10030 def full_restore_operation_with_http_info(vault_base_url, restore_blob_details:nil, custom_headers:nil) full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! end
Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_version [String] The version of the certificate. This URI fragment is optional. If not specified, the latest version of the certificate is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2098 def get_certificate(vault_base_url, certificate_name, certificate_version, custom_headers:nil) response = get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_version [String] The version of the certificate. This URI fragment is optional. If not specified, the latest version of the certificate is returned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2143 def get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'certificate_version is nil' if certificate_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}/{certificate-version}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name,'certificate-version' => certificate_version}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the certificate contacts for a specified key vault.
The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Contacts] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 480 def get_certificate_contacts(vault_base_url, custom_headers:nil) response = get_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the certificate contacts for a specified key vault.
The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 517 def get_certificate_contacts_async(vault_base_url, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/contacts' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::Contacts.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the certificate contacts for a specified key vault.
The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 499 def get_certificate_contacts_with_http_info(vault_base_url, custom_headers:nil) get_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value! end
Lists the specified certificate issuer.
The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [IssuerBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1078 def get_certificate_issuer(vault_base_url, issuer_name, custom_headers:nil) response = get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the specified certificate issuer.
The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1117 def get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'issuer_name is nil' if issuer_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/issuers/{issuer-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'issuer-name' => issuer_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::IssuerBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the specified certificate issuer.
The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1098 def get_certificate_issuer_with_http_info(vault_base_url, issuer_name, custom_headers:nil) get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value! end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<CertificateIssuerItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 687 def get_certificate_issuers(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_certificate_issuers_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateIssuerListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12231 def get_certificate_issuers_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12272 def get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'certificates/issuers' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12252 def get_certificate_issuers_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 728 def get_certificate_issuers_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/issuers' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateIssuerListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10784 def get_certificate_issuers_next(next_page_link, custom_headers:nil) response = get_certificate_issuers_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10821 def get_certificate_issuers_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10803 def get_certificate_issuers_next_with_http_info(next_page_link, custom_headers:nil) get_certificate_issuers_next_async(next_page_link, custom_headers:custom_headers).value! end
List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 708 def get_certificate_issuers_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_certificate_issuers_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the creation operation of a certificate.
Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2337 def get_certificate_operation(vault_base_url, certificate_name, custom_headers:nil) response = get_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the creation operation of a certificate.
Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2374 def get_certificate_operation_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}/pending' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the creation operation of a certificate.
Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2356 def get_certificate_operation_with_http_info(vault_base_url, certificate_name, custom_headers:nil) get_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Lists the policy for a certificate.
The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in a given key vault. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificatePolicy] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1717 def get_certificate_policy(vault_base_url, certificate_name, custom_headers:nil) response = get_certificate_policy_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the policy for a certificate.
The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in a given key vault. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1758 def get_certificate_policy_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}/policy' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificatePolicy.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the policy for a certificate.
The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in a given key vault. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1738 def get_certificate_policy_with_http_info(vault_base_url, certificate_name, custom_headers:nil) get_certificate_policy_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<CertificateItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1601 def get_certificate_versions(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) first_page = get_certificate_versions_as_lazy(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12339 def get_certificate_versions_as_lazy(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) first_page = get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12382 def get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'certificates/{certificate-name}/versions' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12361 def get_certificate_versions_as_lazy_with_http_info(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers).value! end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1644 def get_certificate_versions_async(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates/{certificate-name}/versions' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10886 def get_certificate_versions_next(next_page_link, custom_headers:nil) response = get_certificate_versions_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10923 def get_certificate_versions_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10905 def get_certificate_versions_next_with_http_info(next_page_link, custom_headers:nil) get_certificate_versions_next_async(next_page_link, custom_headers:custom_headers).value! end
List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1623 def get_certificate_versions_with_http_info(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) get_certificate_versions_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_version [String] The version of the certificate. This URI fragment is optional. If not specified, the latest version of the certificate is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2121 def get_certificate_with_http_info(vault_base_url, certificate_name, certificate_version, custom_headers:nil) get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:custom_headers).value! end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<CertificateItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 142 def get_certificates(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) first_page = get_certificates_as_lazy(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers) first_page.get_all_items end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12120 def get_certificates_as_lazy(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) first_page = get_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers) first_page.get_all_items end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12165 def get_certificates_as_lazy_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'certificates' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'includePending' => include_pending}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12143 def get_certificates_as_lazy_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) get_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value! end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 187 def get_certificates_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'certificates' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'includePending' => include_pending,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10682 def get_certificates_next(next_page_link, custom_headers:nil) response = get_certificates_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10719 def get_certificates_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10701 def get_certificates_next_with_http_info(next_page_link, custom_headers:nil) get_certificates_next_async(next_page_link, custom_headers:custom_headers).value! end
List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 165 def get_certificates_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) get_certificates_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value! end
Retrieves information about the specified deleted certificate.
The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedCertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3053 def get_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil) response = get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Retrieves information about the specified deleted certificate.
The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3094 def get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedcertificates/{certificate-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedCertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Retrieves information about the specified deleted certificate.
The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3074 def get_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil) get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<DeletedCertificateItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2931 def get_deleted_certificates(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) first_page = get_deleted_certificates_as_lazy(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers) first_page.get_all_items end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedCertificateListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12455 def get_deleted_certificates_as_lazy(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) first_page = get_deleted_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers) first_page.get_all_items end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12506 def get_deleted_certificates_as_lazy_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'deletedcertificates' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'includePending' => include_pending}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedCertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12481 def get_deleted_certificates_as_lazy_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) get_deleted_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value! end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2982 def get_deleted_certificates_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedcertificates' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'includePending' => include_pending,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedCertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedCertificateListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10991 def get_deleted_certificates_next(next_page_link, custom_headers:nil) response = get_deleted_certificates_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11034 def get_deleted_certificates_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedCertificateListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11013 def get_deleted_certificates_next_with_http_info(next_page_link, custom_headers:nil) get_deleted_certificates_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists the deleted certificates in the specified vault currently available for recovery.
The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param include_pending [Boolean] Specifies whether to include certificates which are not completely provisioned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2957 def get_deleted_certificates_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil) get_deleted_certificates_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value! end
Gets the public part of a deleted key.
The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedKeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5730 def get_deleted_key(vault_base_url, key_name, custom_headers:nil) response = get_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the public part of a deleted key.
The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5771 def get_deleted_key_async(vault_base_url, key_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedkeys/{key-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedKeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the public part of a deleted key.
The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5751 def get_deleted_key_with_http_info(vault_base_url, key_name, custom_headers:nil) get_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<DeletedKeyItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5612 def get_deleted_keys(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_deleted_keys_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedKeyListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12797 def get_deleted_keys_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_deleted_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12844 def get_deleted_keys_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'deletedkeys' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedKeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12821 def get_deleted_keys_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5659 def get_deleted_keys_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedkeys' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedKeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedKeyListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11309 def get_deleted_keys_next(next_page_link, custom_headers:nil) response = get_deleted_keys_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11352 def get_deleted_keys_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedKeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11331 def get_deleted_keys_next_with_http_info(next_page_link, custom_headers:nil) get_deleted_keys_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5636 def get_deleted_keys_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_keys_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSasDefinitionBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9049 def get_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) response = get_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9090 def get_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil? fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name,'sas-definition-name' => sas_definition_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSasDefinitionBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9070 def get_deleted_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) get_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<DeletedSasDefinitionItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8932 def get_deleted_sas_definitions(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) first_page = get_deleted_sas_definitions_as_lazy(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSasDefinitionListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13549 def get_deleted_sas_definitions_as_lazy(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) first_page = get_deleted_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13592 def get_deleted_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'deletedstorage/{storage-account-name}/sas' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSasDefinitionListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13571 def get_deleted_sas_definitions_as_lazy_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) get_deleted_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8975 def get_deleted_sas_definitions_async(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage/{storage-account-name}/sas' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSasDefinitionListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSasDefinitionListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12014 def get_deleted_sas_definitions_next(next_page_link, custom_headers:nil) response = get_deleted_sas_definitions_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12051 def get_deleted_sas_definitions_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSasDefinitionListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12033 def get_deleted_sas_definitions_next_with_http_info(next_page_link, custom_headers:nil) get_deleted_sas_definitions_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8954 def get_deleted_sas_definitions_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) get_deleted_sas_definitions_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the specified deleted secret.
The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6906 def get_deleted_secret(vault_base_url, secret_name, custom_headers:nil) response = get_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the specified deleted secret.
The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6943 def get_deleted_secret_async(vault_base_url, secret_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedsecrets/{secret-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the specified deleted secret.
The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6925 def get_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil) get_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<DeletedSecretItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6796 def get_deleted_secrets(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_deleted_secrets_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSecretListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13132 def get_deleted_secrets_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13173 def get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'deletedsecrets' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13153 def get_deleted_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6837 def get_deleted_secrets_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedsecrets' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedSecretListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11624 def get_deleted_secrets_next(next_page_link, custom_headers:nil) response = get_deleted_secrets_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11661 def get_deleted_secrets_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedSecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11643 def get_deleted_secrets_next_with_http_info(next_page_link, custom_headers:nil) get_deleted_secrets_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6817 def get_deleted_secrets_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_secrets_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the specified deleted storage account.
The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedStorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7663 def get_deleted_storage_account(vault_base_url, storage_account_name, custom_headers:nil) response = get_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the specified deleted storage account.
The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7702 def get_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage/{storage-account-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedStorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the specified deleted storage account.
The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7683 def get_deleted_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers:nil) get_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<DeletedStorageAccountItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7552 def get_deleted_storage_accounts(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_deleted_storage_accounts_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedStorageListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13337 def get_deleted_storage_accounts_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13378 def get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'deletedstorage' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedStorageListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13358 def get_deleted_storage_accounts_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7593 def get_deleted_storage_accounts_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedStorageListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DeletedStorageListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11819 def get_deleted_storage_accounts_next(next_page_link, custom_headers:nil) response = get_deleted_storage_accounts_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11856 def get_deleted_storage_accounts_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::DeletedStorageListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11838 def get_deleted_storage_accounts_next_with_http_info(next_page_link, custom_headers:nil) get_deleted_storage_accounts_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists deleted storage accounts for the specified vault.
The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7573 def get_deleted_storage_accounts_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_storage_accounts_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to get. @param key_version [String] Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3965 def get_key(vault_base_url, key_name, key_version, custom_headers:nil) response = get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to get. @param key_version [String] Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4010 def get_key_async(vault_base_url, key_name, key_version, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'keys/{key-name}/{key-version}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<KeyItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4082 def get_key_versions(vault_base_url, key_name, maxresults:nil, custom_headers:nil) first_page = get_key_versions_as_lazy(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12572 def get_key_versions_as_lazy(vault_base_url, key_name, maxresults:nil, custom_headers:nil) first_page = get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12613 def get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'keys/{key-name}/versions' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12593 def get_key_versions_as_lazy_with_http_info(vault_base_url, key_name, maxresults:nil, custom_headers:nil) get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4123 def get_key_versions_async(vault_base_url, key_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'keys/{key-name}/versions' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11098 def get_key_versions_next(next_page_link, custom_headers:nil) response = get_key_versions_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11133 def get_key_versions_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11116 def get_key_versions_next_with_http_info(next_page_link, custom_headers:nil) get_key_versions_next_async(next_page_link, custom_headers:custom_headers).value! end
Retrieves a list of individual key versions with the same key name.
The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4103 def get_key_versions_with_http_info(vault_base_url, key_name, maxresults:nil, custom_headers:nil) get_key_versions_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to get. @param key_version [String] Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3988 def get_key_with_http_info(vault_base_url, key_name, key_version, custom_headers:nil) get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value! end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<KeyItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4198 def get_keys(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_keys_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12683 def get_keys_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12728 def get_keys_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'keys' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12706 def get_keys_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4243 def get_keys_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'keys' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11200 def get_keys_next(next_page_link, custom_headers:nil) response = get_keys_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11241 def get_keys_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11221 def get_keys_next_with_http_info(next_page_link, custom_headers:nil) get_keys_next_async(next_page_link, custom_headers:custom_headers).value! end
List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4221 def get_keys_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_keys_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SasDefinitionBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9382 def get_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) response = get_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9417 def get_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil? fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name,'sas-definition-name' => sas_definition_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9400 def get_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) get_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<SasDefinitionItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8820 def get_sas_definitions(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) first_page = get_sas_definitions_as_lazy(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SasDefinitionListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13442 def get_sas_definitions_as_lazy(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) first_page = get_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13479 def get_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'storage/{storage-account-name}/sas' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13461 def get_sas_definitions_as_lazy_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) get_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value! end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8857 def get_sas_definitions_async(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage/{storage-account-name}/sas' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SasDefinitionListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11918 def get_sas_definitions_next(next_page_link, custom_headers:nil) response = get_sas_definitions_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11949 def get_sas_definitions_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11934 def get_sas_definitions_next_with_http_info(next_page_link, custom_headers:nil) get_sas_definitions_next_async(next_page_link, custom_headers:custom_headers).value! end
List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8839 def get_sas_definitions_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) get_sas_definitions_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure
Key Vault. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6451 def get_secret(vault_base_url, secret_name, secret_version, custom_headers:nil) response = get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:custom_headers).value! response.body unless response.nil? end
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure
Key Vault. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret is returned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6492 def get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'secret_version is nil' if secret_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'secrets/{secret-name}/{secret-version}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name,'secret-version' => secret_version}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<SecretItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6680 def get_secret_versions(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) first_page = get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13021 def get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) first_page = get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13064 def get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'secrets/{secret-name}/versions' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13043 def get_secret_versions_as_lazy_with_http_info(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers).value! end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6723 def get_secret_versions_async(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'secrets/{secret-name}/versions' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11522 def get_secret_versions_next(next_page_link, custom_headers:nil) response = get_secret_versions_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11559 def get_secret_versions_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11541 def get_secret_versions_next_with_http_info(next_page_link, custom_headers:nil) get_secret_versions_next_async(next_page_link, custom_headers:custom_headers).value! end
List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6702 def get_secret_versions_with_http_info(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) get_secret_versions_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure
Key Vault. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6472 def get_secret_with_http_info(vault_base_url, secret_name, secret_version, custom_headers:nil) get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:custom_headers).value! end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<SecretItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6565 def get_secrets(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_secrets_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12911 def get_secrets_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12954 def get_secrets_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'secrets' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 12933 def get_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6608 def get_secrets_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'secrets' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11418 def get_secrets_next(next_page_link, custom_headers:nil) response = get_secrets_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11457 def get_secrets_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11438 def get_secrets_next_with_http_info(next_page_link, custom_headers:nil) get_secrets_next_async(next_page_link, custom_headers:custom_headers).value! end
List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified, the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6587 def get_secrets_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_secrets_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets information about a specified storage account. This operation requires the storage/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8308 def get_storage_account(vault_base_url, storage_account_name, custom_headers:nil) response = get_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets information about a specified storage account. This operation requires the storage/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8341 def get_storage_account_async(vault_base_url, storage_account_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage/{storage-account-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets information about a specified storage account. This operation requires the storage/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8325 def get_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers:nil) get_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<StorageAccountItem>] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7446 def get_storage_accounts(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_storage_accounts_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13236 def get_storage_accounts_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil) first_page = get_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers) first_page.get_all_items end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13271 def get_storage_accounts_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'storage' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13254 def get_storage_accounts_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7481 def get_storage_accounts_async(vault_base_url, maxresults:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25 fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1 fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'storage' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'maxresults' => maxresults,'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageListResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11723 def get_storage_accounts_next(next_page_link, custom_headers:nil) response = get_storage_accounts_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11754 def get_storage_accounts_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = '{nextLink}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageListResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 11739 def get_storage_accounts_next_with_http_info(next_page_link, custom_headers:nil) get_storage_accounts_next_async(next_page_link, custom_headers:custom_headers).value! end
List storage accounts managed by the specified key vault. This operation requires the storage/list permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7464 def get_storage_accounts_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_storage_accounts_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure
Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param base64encoded_certificate [String] Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. @param password [String] If the private key in base64encoded_certificate is encrypted, the password used for encryption. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1447 def import_certificate(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) response = import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:password, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure
Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param base64encoded_certificate [String] Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. @param password [String] If the private key in base64encoded_certificate is encrypted, the password used for encryption. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1512 def import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'base64encoded_certificate is nil' if base64encoded_certificate.nil? parameters = Azure::KeyVault::V7_2_preview::Models::CertificateImportParameters.new unless base64encoded_certificate.nil? && password.nil? && certificate_policy.nil? && certificate_attributes.nil? && tags.nil? parameters.base64encoded_certificate = base64encoded_certificate parameters.password = password parameters.certificate_policy = certificate_policy parameters.certificate_attributes = certificate_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateImportParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/{certificate-name}/import' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure
Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param base64encoded_certificate [String] Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. @param password [String] If the private key in base64encoded_certificate is encrypted, the password used for encryption. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1480 def import_certificate_with_http_info(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:password, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! end
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to import any key type into an Azure
Key Vault. If the named key already exists, Azure
Key Vault creates a new version of the key. This operation requires the keys/import permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] Name for the imported key. @param key [JsonWebKey] The Json web key @param hsm [Boolean] Whether to import as a hardware key (HSM) or software key. @param key_attributes [KeyAttributes] The key management attributes. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3564 def import_key(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil) response = import_key_async(vault_base_url, key_name, key, hsm:hsm, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to import any key type into an Azure
Key Vault. If the named key already exists, Azure
Key Vault creates a new version of the key. This operation requires the keys/import permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] Name for the imported key. @param key [JsonWebKey] The Json web key @param hsm [Boolean] Whether to import as a hardware key (HSM) or software key. @param key_attributes [KeyAttributes] The key management attributes. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3617 def import_key_async(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !key_name.nil? && key_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'key is nil' if key.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyImportParameters.new unless hsm.nil? && key.nil? && key_attributes.nil? && tags.nil? parameters.hsm = hsm parameters.key = key parameters.key_attributes = key_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyImportParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to import any key type into an Azure
Key Vault. If the named key already exists, Azure
Key Vault creates a new version of the key. This operation requires the keys/import permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] Name for the imported key. @param key [JsonWebKey] The Json web key @param hsm [Boolean] Whether to import as a hardware key (HSM) or software key. @param key_attributes [KeyAttributes] The key management attributes. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3591 def import_key_with_http_info(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil) import_key_async(vault_base_url, key_name, key, hsm:hsm, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value! end
Makes a request and returns the body of the response. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [Hash{String=>String}] containing the body of the response. Example:
request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" path = "/path" options = { body: request_content, query_params: {'api-version' => '2016-02-01'} } result = @client.make_request(:put, path, options)
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 82 def make_request(method, path, options = {}) result = make_request_with_http_info(method, path, options) result.body unless result.nil? end
Makes a request asynchronously. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 107 def make_request_async(method, path, options = {}) fail ArgumentError, 'method is nil' if method.nil? fail ArgumentError, 'path is nil' if path.nil? request_url = options[:base_url] || @base_url if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) @request_headers['Content-Type'] = options[:headers]['Content-Type'] end request_headers = @request_headers request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? options.merge!({headers: request_headers.merge(options[:headers] || {})}) options.merge!({credentials: @credentials}) unless @credentials.nil? super(request_url, method, path, options) end
Makes a request and returns the operation response. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 94 def make_request_with_http_info(method, path, options = {}) result = make_request_async(method, path, options).value! result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) result end
Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param x509certificates [Array<Array<Integer>>] The certificate or the certificate chain to merge. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2560 def merge_certificate(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil) response = merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param x509certificates [Array<Array<Integer>>] The certificate or the certificate chain to merge. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2613 def merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'x509certificates is nil' if x509certificates.nil? parameters = Azure::KeyVault::V7_2_preview::Models::CertificateMergeParameters.new unless x509certificates.nil? && certificate_attributes.nil? && tags.nil? parameters.x509certificates = x509certificates parameters.certificate_attributes = certificate_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateMergeParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/{certificate-name}/pending/merge' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 201 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param x509certificates [Array<Array<Integer>>] The certificate or the certificate chain to merge. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2587 def merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil) merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! end
Permanently deletes the specified deleted certificate.
The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3164 def purge_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil) response = purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! nil end
Permanently deletes the specified deleted certificate.
The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3205 def purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedcertificates/{certificate-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Permanently deletes the specified deleted certificate.
The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3185 def purge_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil) purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Permanently deletes the specified key.
The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5841 def purge_deleted_key(vault_base_url, key_name, custom_headers:nil) response = purge_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! nil end
Permanently deletes the specified key.
The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5882 def purge_deleted_key_async(vault_base_url, key_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedkeys/{key-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Permanently deletes the specified key.
The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5862 def purge_deleted_key_with_http_info(vault_base_url, key_name, custom_headers:nil) purge_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! end
Permanently deletes the specified secret.
The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7013 def purge_deleted_secret(vault_base_url, secret_name, custom_headers:nil) response = purge_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! nil end
Permanently deletes the specified secret.
The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7054 def purge_deleted_secret_async(vault_base_url, secret_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedsecrets/{secret-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Permanently deletes the specified secret.
The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7034 def purge_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil) purge_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! end
Permanently deletes the specified storage account.
The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7773 def purge_deleted_storage_account(vault_base_url, storage_account_name, custom_headers:nil) response = purge_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! nil end
Permanently deletes the specified storage account.
The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7814 def purge_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage/{storage-account-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Permanently deletes the specified storage account.
The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7794 def purge_deleted_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers:nil) purge_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! end
Recovers the deleted certificate back to its current version under /certificates.
The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the deleted certificate @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3268 def recover_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil) response = recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Recovers the deleted certificate back to its current version under /certificates.
The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the deleted certificate @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3313 def recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedcertificates/{certificate-name}/recover' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Recovers the deleted certificate back to its current version under /certificates.
The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the deleted certificate @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3291 def recover_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil) recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value! end
Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the deleted key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5944 def recover_deleted_key(vault_base_url, key_name, custom_headers:nil) response = recover_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the deleted key. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5987 def recover_deleted_key_async(vault_base_url, key_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedkeys/{key-name}/recover' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the deleted key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5966 def recover_deleted_key_with_http_info(vault_base_url, key_name, custom_headers:nil) recover_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value! end
Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SasDefinitionBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9164 def recover_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) response = recover_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9205 def recover_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil? fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name,'sas-definition-name' => sas_definition_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9185 def recover_deleted_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil) recover_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value! end
Recovers the deleted secret to the latest version.
Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the deleted secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7114 def recover_deleted_secret(vault_base_url, secret_name, custom_headers:nil) response = recover_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Recovers the deleted secret to the latest version.
Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the deleted secret. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7153 def recover_deleted_secret_async(vault_base_url, secret_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedsecrets/{secret-name}/recover' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Recovers the deleted secret to the latest version.
Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the deleted secret. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7134 def recover_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil) recover_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value! end
Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7875 def recover_deleted_storage_account(vault_base_url, storage_account_name, custom_headers:nil) response = recover_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7914 def recover_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'deletedstorage/{storage-account-name}/recover' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7895 def recover_deleted_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers:nil) recover_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers:custom_headers).value! end
Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param key_name [String] The storage account key name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8703 def regenerate_storage_account_key(vault_base_url, storage_account_name, key_name, custom_headers:nil) response = regenerate_storage_account_key_async(vault_base_url, storage_account_name, key_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param key_name [String] The storage account key name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8738 def regenerate_storage_account_key_async(vault_base_url, storage_account_name, key_name, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? parameters = Azure::KeyVault::V7_2_preview::Models::StorageAccountRegenerteKeyParameters.new unless key_name.nil? parameters.key_name = key_name end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageAccountRegenerteKeyParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'storage/{storage-account-name}/regeneratekey' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param key_name [String] The storage account key name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8721 def regenerate_storage_account_key_with_http_info(vault_base_url, storage_account_name, key_name, custom_headers:nil) regenerate_storage_account_key_async(vault_base_url, storage_account_name, key_name, custom_headers:custom_headers).value! end
Restores a backed up certificate to a vault.
Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_bundle_backup The backup blob associated with a certificate bundle. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2806 def restore_certificate(vault_base_url, certificate_bundle_backup, custom_headers:nil) response = restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores a backed up certificate to a vault.
Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_bundle_backup The backup blob associated with a certificate bundle. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2845 def restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'certificate_bundle_backup is nil' if certificate_bundle_backup.nil? parameters = Azure::KeyVault::V7_2_preview::Models::CertificateRestoreParameters.new unless certificate_bundle_backup.nil? parameters.certificate_bundle_backup = certificate_bundle_backup end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateRestoreParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores a backed up certificate to a vault.
Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_bundle_backup The backup blob associated with a certificate bundle. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2826 def restore_certificate_with_http_info(vault_base_url, certificate_bundle_backup, custom_headers:nil) restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers:custom_headers).value! end
Restores a backed up key to a vault.
Imports a previously backed up key into Azure
Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure
Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_bundle_backup The backup blob associated with a key bundle. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4462 def restore_key(vault_base_url, key_bundle_backup, custom_headers:nil) response = restore_key_async(vault_base_url, key_bundle_backup, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores a backed up key to a vault.
Imports a previously backed up key into Azure
Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure
Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_bundle_backup The backup blob associated with a key bundle. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4521 def restore_key_async(vault_base_url, key_bundle_backup, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'key_bundle_backup is nil' if key_bundle_backup.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyRestoreParameters.new unless key_bundle_backup.nil? parameters.key_bundle_backup = key_bundle_backup end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyRestoreParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores a backed up key to a vault.
Imports a previously backed up key into Azure
Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure
Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_bundle_backup The backup blob associated with a key bundle. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4492 def restore_key_with_http_info(vault_base_url, key_bundle_backup, custom_headers:nil) restore_key_async(vault_base_url, key_bundle_backup, custom_headers:custom_headers).value! end
Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_bundle_backup The backup blob associated with a secret bundle. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7331 def restore_secret(vault_base_url, secret_bundle_backup, custom_headers:nil) response = restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_bundle_backup The backup blob associated with a secret bundle. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7368 def restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'secret_bundle_backup is nil' if secret_bundle_backup.nil? parameters = Azure::KeyVault::V7_2_preview::Models::SecretRestoreParameters.new unless secret_bundle_backup.nil? parameters.secret_bundle_backup = secret_bundle_backup end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SecretRestoreParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'secrets/restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_bundle_backup The backup blob associated with a secret bundle. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 7350 def restore_secret_with_http_info(vault_base_url, secret_bundle_backup, custom_headers:nil) restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:custom_headers).value! end
Returns the status of restore operation
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param job_id [String] The Job Id returned part of the restore operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [RestoreOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10119 def restore_status(vault_base_url, job_id, custom_headers:nil) response = restore_status_async(vault_base_url, job_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Returns the status of restore operation
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param job_id [String] The Job Id returned part of the restore operation @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10150 def restore_status_async(vault_base_url, job_id, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'job_id is nil' if job_id.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? path_template = 'restore/{jobId}/pending' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'jobId' => job_id}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Returns the status of restore operation
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param job_id [String] The Job Id returned part of the restore operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10135 def restore_status_with_http_info(vault_base_url, job_id, custom_headers:nil) restore_status_async(vault_base_url, job_id, custom_headers:custom_headers).value! end
Restores a backed up storage account to a vault.
Restores a backed up storage account to a vault. This operation requires the storage/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_bundle_backup The backup blob associated with a storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8091 def restore_storage_account(vault_base_url, storage_bundle_backup, custom_headers:nil) response = restore_storage_account_async(vault_base_url, storage_bundle_backup, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores a backed up storage account to a vault.
Restores a backed up storage account to a vault. This operation requires the storage/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_bundle_backup The backup blob associated with a storage account. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8130 def restore_storage_account_async(vault_base_url, storage_bundle_backup, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'storage_bundle_backup is nil' if storage_bundle_backup.nil? parameters = Azure::KeyVault::V7_2_preview::Models::StorageRestoreParameters.new unless storage_bundle_backup.nil? parameters.storage_bundle_backup = storage_bundle_backup end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageRestoreParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'storage/restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores a backed up storage account to a vault.
Restores a backed up storage account to a vault. This operation requires the storage/restore permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_bundle_backup The backup blob associated with a storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8111 def restore_storage_account_with_http_info(vault_base_url, storage_bundle_backup, custom_headers:nil) restore_storage_account_async(vault_base_url, storage_bundle_backup, custom_headers:custom_headers).value! end
Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to be restored from the user supplied backup @param restore_blob_details [SelectiveKeyRestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SelectiveKeyRestoreOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10221 def selective_key_restore_operation_method(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil) response = selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! response.body unless response.nil? end
Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to be restored from the user supplied backup @param restore_blob_details [SelectiveKeyRestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10262 def selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperationParameters.mapper() request_content = self.serialize(request_mapper, restore_blob_details) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{keyName}/restore' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'keyName' => key_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure
Blob storage backup folder
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to be restored from the user supplied backup @param restore_blob_details [SelectiveKeyRestoreOperationParameters] The Azure
blob SAS token pointing to a folder where the previous successful full backup was stored @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 10242 def selective_key_restore_operation_method_with_http_info(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil) selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value! end
Sets the certificate contacts for the specified key vault.
Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param contacts [Contacts] The contacts for the key vault certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Contacts] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 368 def set_certificate_contacts(vault_base_url, contacts, custom_headers:nil) response = set_certificate_contacts_async(vault_base_url, contacts, custom_headers:custom_headers).value! response.body unless response.nil? end
Sets the certificate contacts for the specified key vault.
Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param contacts [Contacts] The contacts for the key vault certificate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 405 def set_certificate_contacts_async(vault_base_url, contacts, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'contacts is nil' if contacts.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::Contacts.mapper() request_content = self.serialize(request_mapper, contacts) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/contacts' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::Contacts.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Sets the certificate contacts for the specified key vault.
Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param contacts [Contacts] The contacts for the key vault certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 387 def set_certificate_contacts_with_http_info(vault_base_url, contacts, custom_headers:nil) set_certificate_contacts_async(vault_base_url, contacts, custom_headers:custom_headers).value! end
Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param provider [String] The issuer provider. @param credentials [IssuerCredentials] The credentials to be used for the issuer. @param organization_details [OrganizationDetails] Details of the organization as provided to the issuer. @param attributes [IssuerAttributes] Attributes of the issuer object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [IssuerBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 803 def set_certificate_issuer(vault_base_url, issuer_name, provider, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil) response = set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value! response.body unless response.nil? end
Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param provider [String] The issuer provider. @param credentials [IssuerCredentials] The credentials to be used for the issuer. @param organization_details [OrganizationDetails] Details of the organization as provided to the issuer. @param attributes [IssuerAttributes] Attributes of the issuer object. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 852 def set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'issuer_name is nil' if issuer_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'provider is nil' if provider.nil? parameter = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerSetParameters.new unless provider.nil? && credentials.nil? && organization_details.nil? && attributes.nil? parameter.provider = provider parameter.credentials = credentials parameter.organization_details = organization_details parameter.attributes = attributes end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerSetParameters.mapper() request_content = self.serialize(request_mapper, parameter) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/issuers/{issuer-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'issuer-name' => issuer_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::IssuerBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param provider [String] The issuer provider. @param credentials [IssuerCredentials] The credentials to be used for the issuer. @param organization_details [OrganizationDetails] Details of the organization as provided to the issuer. @param attributes [IssuerAttributes] Attributes of the issuer object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 828 def set_certificate_issuer_with_http_info(vault_base_url, issuer_name, provider, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil) set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value! end
Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param template_uri [String] The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. @param sas_type [SasTokenType] The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' @param validity_period [String] The validity period of SAS tokens created according to the SAS definition. @param sas_definition_attributes [SasDefinitionAttributes] The attributes of the SAS definition. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SasDefinitionBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9499 def set_sas_definition(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:nil, tags:nil, custom_headers:nil) response = set_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param template_uri [String] The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. @param sas_type [SasTokenType] The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' @param validity_period [String] The validity period of SAS tokens created according to the SAS definition. @param sas_definition_attributes [SasDefinitionAttributes] The attributes of the SAS definition. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9556 def set_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil? fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'template_uri is nil' if template_uri.nil? fail ArgumentError, 'sas_type is nil' if sas_type.nil? fail ArgumentError, 'validity_period is nil' if validity_period.nil? parameters = Azure::KeyVault::V7_2_preview::Models::SasDefinitionCreateParameters.new unless template_uri.nil? && sas_type.nil? && validity_period.nil? && sas_definition_attributes.nil? && tags.nil? parameters.template_uri = template_uri parameters.sas_type = sas_type parameters.validity_period = validity_period parameters.sas_definition_attributes = sas_definition_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionCreateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name,'sas-definition-name' => sas_definition_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param template_uri [String] The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. @param sas_type [SasTokenType] The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' @param validity_period [String] The validity period of SAS tokens created according to the SAS definition. @param sas_definition_attributes [SasDefinitionAttributes] The attributes of the SAS definition. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9528 def set_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:nil, tags:nil, custom_headers:nil) set_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value! end
Sets a secret in a specified key vault.
The SET operation adds a secret to the Azure
Key Vault. If the named secret already exists, Azure
Key Vault creates a new version of that secret. This operation requires the secrets/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param value [String] The value of the secret. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param content_type [String] Type of the secret value such as a password. @param secret_attributes [SecretAttributes] The secret management attributes. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6062 def set_secret(vault_base_url, secret_name, value, tags:nil, content_type:nil, secret_attributes:nil, custom_headers:nil) response = set_secret_async(vault_base_url, secret_name, value, tags:tags, content_type:content_type, secret_attributes:secret_attributes, custom_headers:custom_headers).value! response.body unless response.nil? end
Sets a secret in a specified key vault.
The SET operation adds a secret to the Azure
Key Vault. If the named secret already exists, Azure
Key Vault creates a new version of that secret. This operation requires the secrets/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param value [String] The value of the secret. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param content_type [String] Type of the secret value such as a password. @param secret_attributes [SecretAttributes] The secret management attributes. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6111 def set_secret_async(vault_base_url, secret_name, value, tags:nil, content_type:nil, secret_attributes:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, "'secret_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !secret_name.nil? && secret_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'value is nil' if value.nil? parameters = Azure::KeyVault::V7_2_preview::Models::SecretSetParameters.new unless value.nil? && tags.nil? && content_type.nil? && secret_attributes.nil? parameters.value = value parameters.tags = tags parameters.content_type = content_type parameters.secret_attributes = secret_attributes end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SecretSetParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'secrets/{secret-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Sets a secret in a specified key vault.
The SET operation adds a secret to the Azure
Key Vault. If the named secret already exists, Azure
Key Vault creates a new version of that secret. This operation requires the secrets/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param value [String] The value of the secret. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param content_type [String] Type of the secret value such as a password. @param secret_attributes [SecretAttributes] The secret management attributes. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6087 def set_secret_with_http_info(vault_base_url, secret_name, value, tags:nil, content_type:nil, secret_attributes:nil, custom_headers:nil) set_secret_async(vault_base_url, secret_name, value, tags:tags, content_type:content_type, secret_attributes:secret_attributes, custom_headers:custom_headers).value! end
Creates or updates a new storage account. This operation requires the storage/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param resource_id [String] Storage account resource id. @param active_key_name [String] Current active storage account key name. @param auto_regenerate_key [Boolean] whether keyvault should manage the storage account for the user. @param regeneration_period [String] The key regeneration time duration specified in ISO-8601 format. @param storage_account_attributes [StorageAccountAttributes] The attributes of the storage account. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8419 def set_storage_account(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil) response = set_storage_account_async(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:storage_account_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates or updates a new storage account. This operation requires the storage/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param resource_id [String] Storage account resource id. @param active_key_name [String] Current active storage account key name. @param auto_regenerate_key [Boolean] whether keyvault should manage the storage account for the user. @param regeneration_period [String] The key regeneration time duration specified in ISO-8601 format. @param storage_account_attributes [StorageAccountAttributes] The attributes of the storage account. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8472 def set_storage_account_async(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'resource_id is nil' if resource_id.nil? fail ArgumentError, 'active_key_name is nil' if active_key_name.nil? fail ArgumentError, 'auto_regenerate_key is nil' if auto_regenerate_key.nil? parameters = Azure::KeyVault::V7_2_preview::Models::StorageAccountCreateParameters.new unless resource_id.nil? && active_key_name.nil? && auto_regenerate_key.nil? && regeneration_period.nil? && storage_account_attributes.nil? && tags.nil? parameters.resource_id = resource_id parameters.active_key_name = active_key_name parameters.auto_regenerate_key = auto_regenerate_key parameters.regeneration_period = regeneration_period parameters.storage_account_attributes = storage_account_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageAccountCreateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'storage/{storage-account-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates or updates a new storage account. This operation requires the storage/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param resource_id [String] Storage account resource id. @param active_key_name [String] Current active storage account key name. @param auto_regenerate_key [Boolean] whether keyvault should manage the storage account for the user. @param regeneration_period [String] The key regeneration time duration specified in ISO-8601 format. @param storage_account_attributes [StorageAccountAttributes] The attributes of the storage account. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8446 def set_storage_account_with_http_info(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil) set_storage_account_async(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:storage_account_attributes, tags:tags, custom_headers:custom_headers).value! end
Creates a signature from a digest using the specified key.
The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure
Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param value @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyOperationResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4966 def sign(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) response = sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a signature from a digest using the specified key.
The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure
Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param value @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5019 def sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'algorithm is nil' if algorithm.nil? fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1 fail ArgumentError, 'value is nil' if value.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeySignParameters.new unless algorithm.nil? && value.nil? parameters.algorithm = algorithm parameters.value = value end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeySignParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}/sign' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates a signature from a digest using the specified key.
The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure
Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param value @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 4993 def sign_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value! end
Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure
Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyOperationResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5452 def unwrap_key(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) response = unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! response.body unless response.nil? end
Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure
Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5519 def unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'algorithm is nil' if algorithm.nil? fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1 fail ArgumentError, 'value is nil' if value.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil? parameters.algorithm = algorithm parameters.value = value parameters.iv = iv parameters.aad = aad parameters.tag = tag end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}/unwrapkey' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure
Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5486 def unwrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! end
Updates the specified attributes associated with the given certificate.
The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given key vault. @param certificate_version [String] The version of the certificate. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1956 def update_certificate(vault_base_url, certificate_name, certificate_version, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) response = update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the specified attributes associated with the given certificate.
The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given key vault. @param certificate_version [String] The version of the certificate. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2011 def update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'certificate_version is nil' if certificate_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameters = Azure::KeyVault::V7_2_preview::Models::CertificateUpdateParameters.new unless certificate_policy.nil? && certificate_attributes.nil? && tags.nil? parameters.certificate_policy = certificate_policy parameters.certificate_attributes = certificate_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateUpdateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/{certificate-name}/{certificate-version}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name,'certificate-version' => certificate_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates the specified certificate issuer.
The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param provider [String] The issuer provider. @param credentials [IssuerCredentials] The credentials to be used for the issuer. @param organization_details [OrganizationDetails] Details of the organization as provided to the issuer. @param attributes [IssuerAttributes] Attributes of the issuer object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [IssuerBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 943 def update_certificate_issuer(vault_base_url, issuer_name, provider:nil, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil) response = update_certificate_issuer_async(vault_base_url, issuer_name, provider:provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the specified certificate issuer.
The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param provider [String] The issuer provider. @param credentials [IssuerCredentials] The credentials to be used for the issuer. @param organization_details [OrganizationDetails] Details of the organization as provided to the issuer. @param attributes [IssuerAttributes] Attributes of the issuer object. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 994 def update_certificate_issuer_async(vault_base_url, issuer_name, provider:nil, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'issuer_name is nil' if issuer_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameter = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerUpdateParameters.new unless provider.nil? && credentials.nil? && organization_details.nil? && attributes.nil? parameter.provider = provider parameter.credentials = credentials parameter.organization_details = organization_details parameter.attributes = attributes end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerUpdateParameters.mapper() request_content = self.serialize(request_mapper, parameter) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/issuers/{issuer-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'issuer-name' => issuer_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::IssuerBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates the specified certificate issuer.
The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param issuer_name [String] The name of the issuer. @param provider [String] The issuer provider. @param credentials [IssuerCredentials] The credentials to be used for the issuer. @param organization_details [OrganizationDetails] Details of the organization as provided to the issuer. @param attributes [IssuerAttributes] Attributes of the issuer object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 969 def update_certificate_issuer_with_http_info(vault_base_url, issuer_name, provider:nil, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil) update_certificate_issuer_async(vault_base_url, issuer_name, provider:provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value! end
Updates a certificate operation.
Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param cancellation_requested [Boolean] Indicates if cancellation was requested on the certificate operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateOperation] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2215 def update_certificate_operation(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil) response = update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates a certificate operation.
Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param cancellation_requested [Boolean] Indicates if cancellation was requested on the certificate operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2256 def update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'cancellation_requested is nil' if cancellation_requested.nil? certificate_operation = CertificateOperationUpdateParameter.new unless cancellation_requested.nil? certificate_operation.cancellation_requested = cancellation_requested end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperationUpdateParameter.mapper() request_content = self.serialize(request_mapper, certificate_operation) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/{certificate-name}/pending' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperation.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates a certificate operation.
Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param cancellation_requested [Boolean] Indicates if cancellation was requested on the certificate operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 2236 def update_certificate_operation_with_http_info(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil) update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value! end
Updates the policy for a certificate.
Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_policy [CertificatePolicy] The policy for the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificatePolicy] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1829 def update_certificate_policy(vault_base_url, certificate_name, certificate_policy, custom_headers:nil) response = update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the policy for a certificate.
Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_policy [CertificatePolicy] The policy for the certificate. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1870 def update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, 'certificate_policy is nil' if certificate_policy.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificatePolicy.mapper() request_content = self.serialize(request_mapper, certificate_policy) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'certificates/{certificate-name}/policy' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'certificate-name' => certificate_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificatePolicy.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates the policy for a certificate.
Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_policy [CertificatePolicy] The policy for the certificate. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1850 def update_certificate_policy_with_http_info(vault_base_url, certificate_name, certificate_policy, custom_headers:nil) update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers:custom_headers).value! end
Updates the specified attributes associated with the given certificate.
The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given key vault. @param certificate_version [String] The version of the certificate. @param certificate_policy [CertificatePolicy] The management policy for the certificate. @param certificate_attributes [CertificateAttributes] The attributes of the certificate (optional). @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 1984 def update_certificate_with_http_info(vault_base_url, certificate_name, certificate_version, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil) update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value! end
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure
Key Vault.
In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of key to update. @param key_version [String] The version of the key to update. @param key_ops [Array<JsonWebKeyOperation>] Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. @param key_attributes [KeyAttributes] @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3825 def update_key(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil) response = update_key_async(vault_base_url, key_name, key_version, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure
Key Vault.
In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of key to update. @param key_version [String] The version of the key to update. @param key_ops [Array<JsonWebKeyOperation>] Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. @param key_attributes [KeyAttributes] @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3878 def update_key_async(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyUpdateParameters.new unless key_ops.nil? && key_attributes.nil? && tags.nil? parameters.key_ops = key_ops parameters.key_attributes = key_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyUpdateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure
Key Vault.
In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of key to update. @param key_version [String] The version of the key to update. @param key_ops [Array<JsonWebKeyOperation>] Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. @param key_attributes [KeyAttributes] @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 3852 def update_key_with_http_info(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil) update_key_async(vault_base_url, key_name, key_version, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value! end
Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param template_uri [String] The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. @param sas_type [SasTokenType] The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' @param validity_period [String] The validity period of SAS tokens created according to the SAS definition. @param sas_definition_attributes [SasDefinitionAttributes] The attributes of the SAS definition. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SasDefinitionBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9656 def update_sas_definition(vault_base_url, storage_account_name, sas_definition_name, template_uri:nil, sas_type:nil, validity_period:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil) response = update_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri:template_uri, sas_type:sas_type, validity_period:validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param template_uri [String] The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. @param sas_type [SasTokenType] The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' @param validity_period [String] The validity period of SAS tokens created according to the SAS definition. @param sas_definition_attributes [SasDefinitionAttributes] The attributes of the SAS definition. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9713 def update_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri:nil, sas_type:nil, validity_period:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil? fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameters = Azure::KeyVault::V7_2_preview::Models::SasDefinitionUpdateParameters.new unless template_uri.nil? && sas_type.nil? && validity_period.nil? && sas_definition_attributes.nil? && tags.nil? parameters.template_uri = template_uri parameters.sas_type = sas_type parameters.validity_period = validity_period parameters.sas_definition_attributes = sas_definition_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionUpdateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name,'sas-definition-name' => sas_definition_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param sas_definition_name [String] The name of the SAS definition. @param template_uri [String] The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. @param sas_type [SasTokenType] The type of SAS token the SAS definition will create. Possible values include: 'account', 'service' @param validity_period [String] The validity period of SAS tokens created according to the SAS definition. @param sas_definition_attributes [SasDefinitionAttributes] The attributes of the SAS definition. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 9685 def update_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, template_uri:nil, sas_type:nil, validity_period:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil) update_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri:template_uri, sas_type:sas_type, validity_period:validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value! end
Updates the attributes associated with a specified secret in a given key vault.
The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. @param content_type [String] Type of the secret value such as a password. @param secret_attributes [SecretAttributes] The secret management attributes. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6313 def update_secret(vault_base_url, secret_name, secret_version, content_type:nil, secret_attributes:nil, tags:nil, custom_headers:nil) response = update_secret_async(vault_base_url, secret_name, secret_version, content_type:content_type, secret_attributes:secret_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the attributes associated with a specified secret in a given key vault.
The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. @param content_type [String] Type of the secret value such as a password. @param secret_attributes [SecretAttributes] The secret management attributes. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6366 def update_secret_async(vault_base_url, secret_name, secret_version, content_type:nil, secret_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'secret_name is nil' if secret_name.nil? fail ArgumentError, 'secret_version is nil' if secret_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameters = Azure::KeyVault::V7_2_preview::Models::SecretUpdateParameters.new unless content_type.nil? && secret_attributes.nil? && tags.nil? parameters.content_type = content_type parameters.secret_attributes = secret_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::SecretUpdateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'secrets/{secret-name}/{secret-version}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'secret-name' => secret_name,'secret-version' => secret_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::SecretBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates the attributes associated with a specified secret in a given key vault.
The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. @param content_type [String] Type of the secret value such as a password. @param secret_attributes [SecretAttributes] The secret management attributes. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 6340 def update_secret_with_http_info(vault_base_url, secret_name, secret_version, content_type:nil, secret_attributes:nil, tags:nil, custom_headers:nil) update_secret_async(vault_base_url, secret_name, secret_version, content_type:content_type, secret_attributes:secret_attributes, tags:tags, custom_headers:custom_headers).value! end
Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param active_key_name [String] The current active storage account key name. @param auto_regenerate_key [Boolean] whether keyvault should manage the storage account for the user. @param regeneration_period [String] The key regeneration time duration specified in ISO-8601 format. @param storage_account_attributes [StorageAccountAttributes] The attributes of the storage account. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [StorageBundle] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8568 def update_storage_account(vault_base_url, storage_account_name, active_key_name:nil, auto_regenerate_key:nil, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil) response = update_storage_account_async(vault_base_url, storage_account_name, active_key_name:active_key_name, auto_regenerate_key:auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:storage_account_attributes, tags:tags, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param active_key_name [String] The current active storage account key name. @param auto_regenerate_key [Boolean] whether keyvault should manage the storage account for the user. @param regeneration_period [String] The key regeneration time duration specified in ISO-8601 format. @param storage_account_attributes [StorageAccountAttributes] The attributes of the storage account. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8619 def update_storage_account_async(vault_base_url, storage_account_name, active_key_name:nil, auto_regenerate_key:nil, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil? fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !storage_account_name.nil? && storage_account_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil? fail ArgumentError, 'api_version is nil' if api_version.nil? parameters = Azure::KeyVault::V7_2_preview::Models::StorageAccountUpdateParameters.new unless active_key_name.nil? && auto_regenerate_key.nil? && regeneration_period.nil? && storage_account_attributes.nil? && tags.nil? parameters.active_key_name = active_key_name parameters.auto_regenerate_key = auto_regenerate_key parameters.regeneration_period = regeneration_period parameters.storage_account_attributes = storage_account_attributes parameters.tags = tags end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageAccountUpdateParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'storage/{storage-account-name}' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'storage-account-name' => storage_account_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:patch, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::StorageBundle.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param storage_account_name [String] The name of the storage account. @param active_key_name [String] The current active storage account key name. @param auto_regenerate_key [Boolean] whether keyvault should manage the storage account for the user. @param regeneration_period [String] The key regeneration time duration specified in ISO-8601 format. @param storage_account_attributes [StorageAccountAttributes] The attributes of the storage account. @param tags [Hash{String => String}] Application specific metadata in the form of key-value pairs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 8594 def update_storage_account_with_http_info(vault_base_url, storage_account_name, active_key_name:nil, auto_regenerate_key:nil, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil) update_storage_account_async(vault_base_url, storage_account_name, active_key_name:active_key_name, auto_regenerate_key:auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:storage_account_attributes, tags:tags, custom_headers:custom_headers).value! end
Verifies a signature using a specified key.
The VERIFY operation is applicable to symmetric keys stored in Azure
Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure
Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param digest The digest used for signing. @param signature The signature to be verified. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyVerifyResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5116 def verify(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil) response = verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:custom_headers).value! response.body unless response.nil? end
Verifies a signature using a specified key.
The VERIFY operation is applicable to symmetric keys stored in Azure
Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure
Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param digest The digest used for signing. @param signature The signature to be verified. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5177 def verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'algorithm is nil' if algorithm.nil? fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1 fail ArgumentError, 'digest is nil' if digest.nil? fail ArgumentError, 'signature is nil' if signature.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyVerifyParameters.new unless algorithm.nil? && digest.nil? && signature.nil? parameters.algorithm = algorithm parameters.digest = digest parameters.signature = signature end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyVerifyParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}/verify' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyVerifyResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Verifies a signature using a specified key.
The VERIFY operation is applicable to symmetric keys stored in Azure
Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure
Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param digest The digest used for signing. @param signature The signature to be verified. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5147 def verify_with_http_info(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil) verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:custom_headers).value! end
Wraps a symmetric key using a specified key.
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure
Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure
Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyOperationResult] operation results.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5280 def wrap_key(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) response = wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! response.body unless response.nil? end
Wraps a symmetric key using a specified key.
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure
Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure
Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5349 def wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil? fail ArgumentError, 'key_name is nil' if key_name.nil? fail ArgumentError, 'key_version is nil' if key_version.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? fail ArgumentError, 'algorithm is nil' if algorithm.nil? fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1 fail ArgumentError, 'value is nil' if value.nil? parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil? parameters.algorithm = algorithm parameters.value = value parameters.iv = iv parameters.aad = aad parameters.tag = tag end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = accept_language unless accept_language.nil? # Serialize Request request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper() request_content = self.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'keys/{key-name}/{key-version}/wrapkey' request_url = @base_url || self.base_url request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'key-name' => key_name,'key-version' => key_version}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationResult.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Wraps a symmetric key using a specified key.
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure
Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure
Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key. @param key_version [String] The version of the key. @param algorithm [JsonWebKeyEncryptionAlgorithm] algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' @param value @param iv Initialization vector for symmetric algorithms. @param aad Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms. @param tag The tag to authenticate when performing decryption with an authenticated algorithm. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 5315 def wrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil) wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value! end
Private Instance Methods
Adds telemetry information.
# File lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb, line 13650 def add_telemetry sdk_information = 'azure_key_vault' sdk_information = "#{sdk_information}/0.19.1" add_user_agent_information(sdk_information) end