Class: Vault::Client
- Inherits:
-
Object
- Object
- Vault::Client
- Defined in:
- lib/vault/client.rb
Constant Summary collapse
- CLIENTS_RESOURCE =
"clients".freeze
Class Method Summary collapse
-
.create(vault, role_name) ⇒ Object
Create the client for the desired Vault.
-
.delete(vault, id) ⇒ Object
Mark the client as ready to be removed.
-
.fetch(vault, id) ⇒ Object
Fetch desired client information from the specified Vault.
Class Method Details
.create(vault, role_name) ⇒ Object
Create the client for the desired Vault
27 28 29 30 31 32 |
# File 'lib/vault/client.rb', line 27 def self.create(vault, role_name) client_data = { role: role_name } vault.accessResource("POST", CLIENTS_RESOURCE, "/", client_data) end |
.delete(vault, id) ⇒ Object
Mark the client as ready to be removed
19 20 21 |
# File 'lib/vault/client.rb', line 19 def self.delete(vault, id) vault.accessResource("DELETE", CLIENTS_RESOURCE, id, nil, nil) end |
.fetch(vault, id) ⇒ Object
Fetch desired client information from the specified Vault
10 11 12 13 |
# File 'lib/vault/client.rb', line 10 def self.fetch(vault, id) @vault = vault client = @vault.accessResource("GET", CLIENTS_RESOURCE, id, nil) end |