Class: Dsv::Client
- Inherits:
-
Object
- Object
- Dsv::Client
- Defined in:
- lib/dsv/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
28 29 30 31 32 33 |
# File 'lib/dsv/client.rb', line 28 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
20 21 22 |
# File 'lib/dsv/client.rb', line 20 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
11 12 13 14 |
# File 'lib/dsv/client.rb', line 11 def self.fetch(vault, id) @vault = vault client = @vault.accessResource("GET", CLIENTS_RESOURCE, id, nil) end |