class Azure::KeyVault::V7_1::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.1/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.1' @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.1/generated/azure_key_vault/key_vault_client.rb, line 2682 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.1/generated/azure_key_vault/key_vault_client.rb, line 2721 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 2702 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.1/generated/azure_key_vault/key_vault_client.rb, line 4304 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.1/generated/azure_key_vault/key_vault_client.rb, line 4363 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 4334 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.1/generated/azure_key_vault/key_vault_client.rb, line 7108 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.1/generated/azure_key_vault/key_vault_client.rb, line 7147 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7128 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.1/generated/azure_key_vault/key_vault_client.rb, line 7869 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.1/generated/azure_key_vault/key_vault_client.rb, line 7906 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7888 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.1/generated/azure_key_vault/key_vault_client.rb, line 1289 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.1/generated/azure_key_vault/key_vault_client.rb, line 1338 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 1314 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.1/generated/azure_key_vault/key_vault_client.rb, line 3382 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.1/generated/azure_key_vault/key_vault_client.rb, line 3449 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 3416 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.1/generated/azure_key_vault/key_vault_client.rb, line 4751 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.1/generated/azure_key_vault/key_vault_client.rb, line 4806 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 4779 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.1/generated/azure_key_vault/key_vault_client.rb, line 246 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.1/generated/azure_key_vault/key_vault_client.rb, line 287 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 571 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.1/generated/azure_key_vault/key_vault_client.rb, line 606 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 589 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.1/generated/azure_key_vault/key_vault_client.rb, line 1175 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.1/generated/azure_key_vault/key_vault_client.rb, line 1214 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 1195 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.1/generated/azure_key_vault/key_vault_client.rb, line 2429 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.1/generated/azure_key_vault/key_vault_client.rb, line 2468 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 2449 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.1/generated/azure_key_vault/key_vault_client.rb, line 267 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.1/generated/azure_key_vault/key_vault_client.rb, line 3686 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.1/generated/azure_key_vault/key_vault_client.rb, line 3729 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 3708 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.1/generated/azure_key_vault/key_vault_client.rb, line 9161 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.1/generated/azure_key_vault/key_vault_client.rb, line 9196 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9179 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.1/generated/azure_key_vault/key_vault_client.rb, line 6082 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.1/generated/azure_key_vault/key_vault_client.rb, line 6121 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 6102 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.1/generated/azure_key_vault/key_vault_client.rb, line 8092 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.1/generated/azure_key_vault/key_vault_client.rb, line 8125 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 8109 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.1/generated/azure_key_vault/key_vault_client.rb, line 4594 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.1/generated/azure_key_vault/key_vault_client.rb, line 4657 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 4626 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. This URI fragment is optional. If not specified, the latest version of the certificate is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CertificateBundle] operation results.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 2083 def get_certificate(vault_base_url, certificate_name, certificate_version, custom_headers:nil) response = get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_version [String] The version of the certificate. This URI fragment is optional. If not specified, the latest version of the certificate is returned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 2128 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 468 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.1/generated/azure_key_vault/key_vault_client.rb, line 505 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 487 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.1/generated/azure_key_vault/key_vault_client.rb, line 1066 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.1/generated/azure_key_vault/key_vault_client.rb, line 1105 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 1086 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.1/generated/azure_key_vault/key_vault_client.rb, line 675 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.1/generated/azure_key_vault/key_vault_client.rb, line 11234 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.1/generated/azure_key_vault/key_vault_client.rb, line 11275 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11255 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.1/generated/azure_key_vault/key_vault_client.rb, line 716 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9787 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.1/generated/azure_key_vault/key_vault_client.rb, line 9824 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9806 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.1/generated/azure_key_vault/key_vault_client.rb, line 696 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.1/generated/azure_key_vault/key_vault_client.rb, line 2322 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.1/generated/azure_key_vault/key_vault_client.rb, line 2359 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 2341 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.1/generated/azure_key_vault/key_vault_client.rb, line 1702 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.1/generated/azure_key_vault/key_vault_client.rb, line 1743 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 1723 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.1/generated/azure_key_vault/key_vault_client.rb, line 1586 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.1/generated/azure_key_vault/key_vault_client.rb, line 11342 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.1/generated/azure_key_vault/key_vault_client.rb, line 11385 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11364 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.1/generated/azure_key_vault/key_vault_client.rb, line 1629 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9889 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.1/generated/azure_key_vault/key_vault_client.rb, line 9926 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9908 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.1/generated/azure_key_vault/key_vault_client.rb, line 1608 def get_certificate_versions_with_http_info(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil) get_certificate_versions_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param certificate_name [String] The name of the certificate in the given vault. @param certificate_version [String] The version of the certificate. This URI fragment is optional. If not specified, the latest version of the certificate is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 2106 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.1/generated/azure_key_vault/key_vault_client.rb, line 130 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.1/generated/azure_key_vault/key_vault_client.rb, line 11123 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.1/generated/azure_key_vault/key_vault_client.rb, line 11168 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11146 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.1/generated/azure_key_vault/key_vault_client.rb, line 175 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9685 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.1/generated/azure_key_vault/key_vault_client.rb, line 9722 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9704 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.1/generated/azure_key_vault/key_vault_client.rb, line 153 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.1/generated/azure_key_vault/key_vault_client.rb, line 3038 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.1/generated/azure_key_vault/key_vault_client.rb, line 3079 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 3059 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.1/generated/azure_key_vault/key_vault_client.rb, line 2916 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.1/generated/azure_key_vault/key_vault_client.rb, line 11458 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.1/generated/azure_key_vault/key_vault_client.rb, line 11509 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11484 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.1/generated/azure_key_vault/key_vault_client.rb, line 2967 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9994 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.1/generated/azure_key_vault/key_vault_client.rb, line 10037 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10016 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.1/generated/azure_key_vault/key_vault_client.rb, line 2942 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.1/generated/azure_key_vault/key_vault_client.rb, line 5615 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.1/generated/azure_key_vault/key_vault_client.rb, line 5656 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 5636 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.1/generated/azure_key_vault/key_vault_client.rb, line 5497 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.1/generated/azure_key_vault/key_vault_client.rb, line 11800 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.1/generated/azure_key_vault/key_vault_client.rb, line 11847 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11824 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.1/generated/azure_key_vault/key_vault_client.rb, line 5544 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10312 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.1/generated/azure_key_vault/key_vault_client.rb, line 10355 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10334 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.1/generated/azure_key_vault/key_vault_client.rb, line 5521 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.1/generated/azure_key_vault/key_vault_client.rb, line 8934 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.1/generated/azure_key_vault/key_vault_client.rb, line 8975 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 8955 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.1/generated/azure_key_vault/key_vault_client.rb, line 8817 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.1/generated/azure_key_vault/key_vault_client.rb, line 12552 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.1/generated/azure_key_vault/key_vault_client.rb, line 12595 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 12574 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.1/generated/azure_key_vault/key_vault_client.rb, line 8860 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11017 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.1/generated/azure_key_vault/key_vault_client.rb, line 11054 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11036 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.1/generated/azure_key_vault/key_vault_client.rb, line 8839 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.1/generated/azure_key_vault/key_vault_client.rb, line 6791 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.1/generated/azure_key_vault/key_vault_client.rb, line 6828 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 6810 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.1/generated/azure_key_vault/key_vault_client.rb, line 6681 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.1/generated/azure_key_vault/key_vault_client.rb, line 12135 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.1/generated/azure_key_vault/key_vault_client.rb, line 12176 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 12156 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.1/generated/azure_key_vault/key_vault_client.rb, line 6722 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10627 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.1/generated/azure_key_vault/key_vault_client.rb, line 10664 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10646 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.1/generated/azure_key_vault/key_vault_client.rb, line 6702 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.1/generated/azure_key_vault/key_vault_client.rb, line 7548 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.1/generated/azure_key_vault/key_vault_client.rb, line 7587 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7568 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.1/generated/azure_key_vault/key_vault_client.rb, line 7437 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.1/generated/azure_key_vault/key_vault_client.rb, line 12340 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.1/generated/azure_key_vault/key_vault_client.rb, line 12381 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 12361 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.1/generated/azure_key_vault/key_vault_client.rb, line 7478 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10822 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.1/generated/azure_key_vault/key_vault_client.rb, line 10859 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10841 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.1/generated/azure_key_vault/key_vault_client.rb, line 7458 def get_deleted_storage_accounts_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_storage_accounts_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to get. @param key_version [String] Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [KeyBundle] operation results.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 3946 def get_key(vault_base_url, key_name, key_version, custom_headers:nil) response = get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to get. @param key_version [String] Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 3991 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 4063 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.1/generated/azure_key_vault/key_vault_client.rb, line 11575 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.1/generated/azure_key_vault/key_vault_client.rb, line 11616 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11596 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.1/generated/azure_key_vault/key_vault_client.rb, line 4104 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10101 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.1/generated/azure_key_vault/key_vault_client.rb, line 10136 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10119 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.1/generated/azure_key_vault/key_vault_client.rb, line 4084 def get_key_versions_with_http_info(vault_base_url, key_name, maxresults:nil, custom_headers:nil) get_key_versions_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param key_name [String] The name of the key to get. @param key_version [String] Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 3969 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.1/generated/azure_key_vault/key_vault_client.rb, line 4179 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.1/generated/azure_key_vault/key_vault_client.rb, line 11686 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.1/generated/azure_key_vault/key_vault_client.rb, line 11731 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11709 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.1/generated/azure_key_vault/key_vault_client.rb, line 4224 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10203 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.1/generated/azure_key_vault/key_vault_client.rb, line 10244 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10224 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.1/generated/azure_key_vault/key_vault_client.rb, line 4202 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.1/generated/azure_key_vault/key_vault_client.rb, line 9267 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.1/generated/azure_key_vault/key_vault_client.rb, line 9302 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9285 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.1/generated/azure_key_vault/key_vault_client.rb, line 8705 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.1/generated/azure_key_vault/key_vault_client.rb, line 12445 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.1/generated/azure_key_vault/key_vault_client.rb, line 12482 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 12464 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.1/generated/azure_key_vault/key_vault_client.rb, line 8742 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10921 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.1/generated/azure_key_vault/key_vault_client.rb, line 10952 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10937 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.1/generated/azure_key_vault/key_vault_client.rb, line 8724 def get_sas_definitions_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil) get_sas_definitions_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure
Key Vault. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecretBundle] operation results.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 6336 def get_secret(vault_base_url, secret_name, secret_version, custom_headers:nil) response = get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:custom_headers).value! response.body unless response.nil? end
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure
Key Vault. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret is returned. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 6377 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 6565 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.1/generated/azure_key_vault/key_vault_client.rb, line 12024 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.1/generated/azure_key_vault/key_vault_client.rb, line 12067 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 12046 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.1/generated/azure_key_vault/key_vault_client.rb, line 6608 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10525 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.1/generated/azure_key_vault/key_vault_client.rb, line 10562 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10544 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.1/generated/azure_key_vault/key_vault_client.rb, line 6587 def get_secret_versions_with_http_info(vault_base_url, secret_name, maxresults:nil, custom_headers:nil) get_secret_versions_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers).value! end
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure
Key Vault. This operation requires the secrets/get permission.
@param vault_base_url [String] The vault name, for example myvault.vault.azure.net. @param secret_name [String] The name of the secret. @param secret_version [String] The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/7.1/generated/azure_key_vault/key_vault_client.rb, line 6357 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.1/generated/azure_key_vault/key_vault_client.rb, line 6450 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.1/generated/azure_key_vault/key_vault_client.rb, line 11914 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.1/generated/azure_key_vault/key_vault_client.rb, line 11957 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 11936 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.1/generated/azure_key_vault/key_vault_client.rb, line 6493 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10421 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.1/generated/azure_key_vault/key_vault_client.rb, line 10460 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10441 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.1/generated/azure_key_vault/key_vault_client.rb, line 6472 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.1/generated/azure_key_vault/key_vault_client.rb, line 8193 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.1/generated/azure_key_vault/key_vault_client.rb, line 8226 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 8210 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.1/generated/azure_key_vault/key_vault_client.rb, line 7331 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.1/generated/azure_key_vault/key_vault_client.rb, line 12239 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.1/generated/azure_key_vault/key_vault_client.rb, line 12274 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 12257 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.1/generated/azure_key_vault/key_vault_client.rb, line 7366 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10726 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.1/generated/azure_key_vault/key_vault_client.rb, line 10757 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 10742 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.1/generated/azure_key_vault/key_vault_client.rb, line 7349 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] A PEM file or a base64-encoded PFX file. PEM files need 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.1/generated/azure_key_vault/key_vault_client.rb, line 1434 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] A PEM file or a base64-encoded PFX file. PEM files need 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.1/generated/azure_key_vault/key_vault_client.rb, line 1497 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_1::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_1::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_1::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] A PEM file or a base64-encoded PFX file. PEM files need 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.1/generated/azure_key_vault/key_vault_client.rb, line 1466 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.1/generated/azure_key_vault/key_vault_client.rb, line 3545 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.1/generated/azure_key_vault/key_vault_client.rb, line 3598 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 3572 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.1/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.1/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.1/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.1/generated/azure_key_vault/key_vault_client.rb, line 2545 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.1/generated/azure_key_vault/key_vault_client.rb, line 2598 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 2572 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.1/generated/azure_key_vault/key_vault_client.rb, line 3149 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.1/generated/azure_key_vault/key_vault_client.rb, line 3190 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.1/generated/azure_key_vault/key_vault_client.rb, line 3170 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.1/generated/azure_key_vault/key_vault_client.rb, line 5726 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.1/generated/azure_key_vault/key_vault_client.rb, line 5767 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.1/generated/azure_key_vault/key_vault_client.rb, line 5747 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.1/generated/azure_key_vault/key_vault_client.rb, line 6898 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.1/generated/azure_key_vault/key_vault_client.rb, line 6939 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.1/generated/azure_key_vault/key_vault_client.rb, line 6919 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.1/generated/azure_key_vault/key_vault_client.rb, line 7658 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.1/generated/azure_key_vault/key_vault_client.rb, line 7699 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.1/generated/azure_key_vault/key_vault_client.rb, line 7679 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.1/generated/azure_key_vault/key_vault_client.rb, line 3253 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.1/generated/azure_key_vault/key_vault_client.rb, line 3298 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 3276 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.1/generated/azure_key_vault/key_vault_client.rb, line 5829 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.1/generated/azure_key_vault/key_vault_client.rb, line 5872 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 5851 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.1/generated/azure_key_vault/key_vault_client.rb, line 9049 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.1/generated/azure_key_vault/key_vault_client.rb, line 9090 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9070 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.1/generated/azure_key_vault/key_vault_client.rb, line 6999 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.1/generated/azure_key_vault/key_vault_client.rb, line 7038 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7019 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.1/generated/azure_key_vault/key_vault_client.rb, line 7760 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.1/generated/azure_key_vault/key_vault_client.rb, line 7799 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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7780 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.1/generated/azure_key_vault/key_vault_client.rb, line 8588 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.1/generated/azure_key_vault/key_vault_client.rb, line 8623 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 8606 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.1/generated/azure_key_vault/key_vault_client.rb, line 2791 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.1/generated/azure_key_vault/key_vault_client.rb, line 2830 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 2811 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.1/generated/azure_key_vault/key_vault_client.rb, line 4443 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.1/generated/azure_key_vault/key_vault_client.rb, line 4502 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 4473 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.1/generated/azure_key_vault/key_vault_client.rb, line 7216 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.1/generated/azure_key_vault/key_vault_client.rb, line 7253 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7235 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.1/generated/azure_key_vault/key_vault_client.rb, line 7976 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.1/generated/azure_key_vault/key_vault_client.rb, line 8015 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 7996 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.1/generated/azure_key_vault/key_vault_client.rb, line 356 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.1/generated/azure_key_vault/key_vault_client.rb, line 393 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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 375 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.1/generated/azure_key_vault/key_vault_client.rb, line 791 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.1/generated/azure_key_vault/key_vault_client.rb, line 840 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 816 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.1/generated/azure_key_vault/key_vault_client.rb, line 9384 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.1/generated/azure_key_vault/key_vault_client.rb, line 9441 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9413 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.1/generated/azure_key_vault/key_vault_client.rb, line 5947 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.1/generated/azure_key_vault/key_vault_client.rb, line 5996 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 5972 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.1/generated/azure_key_vault/key_vault_client.rb, line 8304 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.1/generated/azure_key_vault/key_vault_client.rb, line 8357 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 8331 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.1/generated/azure_key_vault/key_vault_client.rb, line 4899 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.1/generated/azure_key_vault/key_vault_client.rb, line 4952 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 4926 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.1/generated/azure_key_vault/key_vault_client.rb, line 5354 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.1/generated/azure_key_vault/key_vault_client.rb, line 5407 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 5381 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.1/generated/azure_key_vault/key_vault_client.rb, line 1941 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.1/generated/azure_key_vault/key_vault_client.rb, line 1996 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 931 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.1/generated/azure_key_vault/key_vault_client.rb, line 982 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 957 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.1/generated/azure_key_vault/key_vault_client.rb, line 2200 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.1/generated/azure_key_vault/key_vault_client.rb, line 2241 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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 2221 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.1/generated/azure_key_vault/key_vault_client.rb, line 1814 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.1/generated/azure_key_vault/key_vault_client.rb, line 1855 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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 1835 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.1/generated/azure_key_vault/key_vault_client.rb, line 1969 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.1/generated/azure_key_vault/key_vault_client.rb, line 3806 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.1/generated/azure_key_vault/key_vault_client.rb, line 3859 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 3833 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.1/generated/azure_key_vault/key_vault_client.rb, line 9541 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.1/generated/azure_key_vault/key_vault_client.rb, line 9598 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 9570 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.1/generated/azure_key_vault/key_vault_client.rb, line 6198 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.1/generated/azure_key_vault/key_vault_client.rb, line 6251 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 6225 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.1/generated/azure_key_vault/key_vault_client.rb, line 8453 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.1/generated/azure_key_vault/key_vault_client.rb, line 8504 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 8479 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.1/generated/azure_key_vault/key_vault_client.rb, line 5049 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.1/generated/azure_key_vault/key_vault_client.rb, line 5110 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 5080 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.1/generated/azure_key_vault/key_vault_client.rb, line 5206 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.1/generated/azure_key_vault/key_vault_client.rb, line 5261 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_1::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_1::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_1::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.1/generated/azure_key_vault/key_vault_client.rb, line 5234 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.1/generated/azure_key_vault/key_vault_client.rb, line 12653 def add_telemetry sdk_information = 'azure_key_vault' sdk_information = "#{sdk_information}/0.19.1" add_user_agent_information(sdk_information) end