class Azure::KeyVault::V7_0_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 [Integer] The retry timeout in seconds for Long Running Operations. Default value is 30.
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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 40 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 @api_version = '7.0-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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6638 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6677 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6658 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1060 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1119 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1090 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3861 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3900 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3881 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7860 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7897 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7879 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 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5248 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5297 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5273 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' @param key_size [Integer] The key size in bits. For example: 2048, 3072, or 4096 for RSA. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 141 def create_key(vault_base_url, key_name, kty, key_size: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, 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' @param key_size [Integer] The key size in bits. For example: 2048, 3072, or 4096 for RSA. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 208 def create_key_async(vault_base_url, key_name, kty, key_size: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_0_preview::Models::KeyCreateParameters.new unless kty.nil? && key_size.nil? && key_ops.nil? && key_attributes.nil? && tags.nil? && curve.nil? parameters.kty = kty parameters.key_size = key_size 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_0_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_0_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' @param key_size [Integer] The key size in bits. For example: 2048, 3072, or 4096 for RSA. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 175 def create_key_with_http_info(vault_base_url, key_name, kty, key_size: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, 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1507 def decrypt(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) response = decrypt_async(vault_base_url, key_name, key_version, algorithm, value, 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1562 def decrypt_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_0_preview::Models::KeyOperationsParameters.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_0_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_0_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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1535 def decrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) decrypt_async(vault_base_url, key_name, key_version, algorithm, value, 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4205 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4246 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4530 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4565 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4548 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5134 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5173 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5154 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6385 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6424 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6405 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4226 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 445 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 488 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 467 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9152 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9187 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9170 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2838 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2877 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2858 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8083 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8116 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8100 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1350 def encrypt(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) response = encrypt_async(vault_base_url, key_name, key_version, algorithm, value, 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1413 def encrypt_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_0_preview::Models::KeyOperationsParameters.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_0_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_0_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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1382 def encrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) encrypt_async(vault_base_url, key_name, key_version, algorithm, value, 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6043 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6084 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4427 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4464 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4446 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5025 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5064 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5045 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4634 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11892 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11933 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11913 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4675 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10405 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10442 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10424 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4655 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6278 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6315 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6297 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5664 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5705 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5685 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5548 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12000 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12043 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12022 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5591 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10507 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10544 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10526 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5570 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6064 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4089 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11781 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11826 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11804 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4134 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10303 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10340 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10322 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4112 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6994 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7035 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7015 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6872 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12116 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12167 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12142 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6923 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10612 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10655 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10634 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6898 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2371 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2412 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2392 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2253 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11337 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11384 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11361 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2300 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9886 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9929 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9908 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2277 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8925 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8966 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8946 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8808 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12543 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12586 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12565 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8851 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11008 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11045 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11027 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8830 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3544 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3581 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3563 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3434 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11672 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11713 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11693 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3475 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10201 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10238 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10220 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3455 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7539 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7578 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7559 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7428 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12331 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12372 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12352 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7469 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10813 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10850 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10832 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7449 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 704 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 747 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 819 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11112 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11153 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11133 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 860 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9675 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9710 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9693 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 840 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 726 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 935 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11223 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11268 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11246 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 980 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9777 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9818 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9798 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 958 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9258 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9293 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9276 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8696 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12436 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12473 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12455 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8733 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10912 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10943 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10928 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8715 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3091 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3130 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3318 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11561 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11604 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11583 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3361 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10099 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10136 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10118 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3340 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. @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3111 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3203 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11451 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11494 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 11473 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3246 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9995 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10034 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10015 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3225 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8184 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8217 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8201 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7322 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12230 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12265 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12248 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7357 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10717 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10748 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 10733 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7340 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5394 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5459 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5427 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 304 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 357 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 331 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 70 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 95 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 82 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6501 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6554 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6528 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7105 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7146 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7126 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2482 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2523 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2503 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3651 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3692 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3672 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7649 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7690 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7670 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7209 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7254 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7232 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2585 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2628 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2607 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9040 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9081 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9061 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3752 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3791 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3772 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7751 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7790 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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7771 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8579 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8614 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8597 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6747 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6786 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6767 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1199 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1258 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1229 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3969 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4006 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3988 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
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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7967 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8006 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 7987 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
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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4315 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4352 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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4334 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4750 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4799 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4775 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9375 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9432 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9404 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2703 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2752 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2728 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8295 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8348 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8322 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1655 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1708 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1682 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2110 def unwrap_key(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) response = unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2163 def unwrap_key_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_0_preview::Models::KeyOperationsParameters.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_0_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_0_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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2137 def unwrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5903 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5958 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4890 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4941 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 4916 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6156 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6197 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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 6177 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5776 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5817 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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5797 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 5931 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 565 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 618 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 592 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9532 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9589 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 9561 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2954 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 3007 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2981 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8444 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8495 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 8470 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1805 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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1866 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_0_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_0_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_0_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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1836 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1962 def wrap_key(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) response = wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, 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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 2017 def wrap_key_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_0_preview::Models::KeyOperationsParameters.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_0_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_0_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' @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.0-preview/generated/azure_key_vault/key_vault_client.rb, line 1990 def wrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil) wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value! end
Private Instance Methods
Adds telemetry information.
# File lib/7.0-preview/generated/azure_key_vault/key_vault_client.rb, line 12644 def add_telemetry sdk_information = 'azure_key_vault' sdk_information = "#{sdk_information}/0.19.1" add_user_agent_information(sdk_information) end