Class: Azure::Armrest::KeyVaultService
- Inherits:
-
ResourceGroupBasedService
- Object
- ArmrestService
- ResourceGroupBasedService
- Azure::Armrest::KeyVaultService
- Defined in:
- lib/azure/armrest/key_vault_service.rb
Overview
Base class for managing key vaults.
Constant Summary
Constants inherited from ResourceGroupBasedService
ResourceGroupBasedService::SERVICE_NAME_MAP
Instance Attribute Summary
Attributes inherited from ArmrestService
#api_version, #armrest_configuration, #base_url, #provider, #service_name
Instance Method Summary collapse
-
#get_deleted(vault_name, location) ⇒ Object
Gets the deleted Azure key vault.
-
#get_secret(secret_name, vault_name, resource_group = configuration.resource_group) ⇒ Object
Get information for the specified
secret_name
invault_name
within the givenresource_group
. -
#initialize(configuration, options = {}) ⇒ KeyVaultService
constructor
Create and return a new KeyVaultService instance.
-
#list_deleted ⇒ Object
Gets information about the deleted vaults in a subscription.
-
#list_secrets(vault_name, resource_group = configuration.resource_group, options = {}) ⇒ Object
Get a list secrets for the given
vault_name
withinresource_group
. -
#purge_deleted(vault_name, location) ⇒ Object
Permanently removes the deleted
vault_name
atlocation
.
Methods inherited from ResourceGroupBasedService
#create, #delete, #delete_by_id, #get, #get_by_id, #list, #list_all
Methods inherited from ArmrestService
configure, #get_provider, #get_subscription, #list_locations, #list_resource_groups, #list_resources, #list_subscriptions, #locations, #poll, #tags, #tenants, #wait
Constructor Details
#initialize(configuration, options = {}) ⇒ KeyVaultService
Create and return a new KeyVaultService instance.
9 10 11 |
# File 'lib/azure/armrest/key_vault_service.rb', line 9 def initialize(configuration, = {}) super(configuration, 'vaults', 'Microsoft.KeyVault', ) end |
Instance Method Details
#get_deleted(vault_name, location) ⇒ Object
Gets the deleted Azure key vault.
34 35 36 37 38 39 |
# File 'lib/azure/armrest/key_vault_service.rb', line 34 def get_deleted(vault_name, location) url = File.join(base_url, 'providers', provider, 'locations', location, 'deletedVaults', vault_name) url << "?api-version=#{api_version}" response = rest_get(url) get_all_results(response) end |
#get_secret(secret_name, vault_name, resource_group = configuration.resource_group) ⇒ Object
Get information for the specified secret_name
in vault_name
within the given resource_group
.
16 17 18 19 |
# File 'lib/azure/armrest/key_vault_service.rb', line 16 def get_secret(secret_name, vault_name, resource_group = configuration.resource_group) url = build_url(resource_group, vault_name, 'secrets', secret_name) model_class.new(rest_get(url)) end |
#list_deleted ⇒ Object
Gets information about the deleted vaults in a subscription.
43 44 45 46 47 |
# File 'lib/azure/armrest/key_vault_service.rb', line 43 def list_deleted url = File.join(base_url, 'providers', provider, 'deletedVaults') + "?api-version=#{api_version}" response = rest_get(url) get_all_results(response) end |
#list_secrets(vault_name, resource_group = configuration.resource_group, options = {}) ⇒ Object
Get a list secrets for the given vault_name
within resource_group
. You may optionally specify the maxresults
, which defaults to 25.
24 25 26 27 28 29 30 |
# File 'lib/azure/armrest/key_vault_service.rb', line 24 def list_secrets(vault_name, resource_group = configuration.resource_group, = {}) url = build_url(resource_group, vault_name, 'secrets') url << "&maxresults=#{[:maxresults]}" if [:maxresults] response = rest_get(url) get_all_results(response) end |
#purge_deleted(vault_name, location) ⇒ Object
Permanently removes the deleted vault_name
at location
.
51 52 53 54 55 56 |
# File 'lib/azure/armrest/key_vault_service.rb', line 51 def purge_deleted(vault_name, location) url = File.join(base_url, 'providers', provider, 'locations', location, 'deletedVaults', vault_name, 'purge') url << "?api-version=#{api_version}" response = rest_post(url) get_all_results(response) end |