class Dsv::Client

Constants

CLIENTS_RESOURCE

Public Class Methods

create(vault, role_name) click to toggle source

Create the client for the desired Vault

@param vault [Vault] The initialized Vault @param role_Name [String] Name of the role to create

# 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) click to toggle source

Mark the client as ready to be removed

@param vault [Vault] The initialized Vault @param id [String] The ID of the client

# File lib/dsv/client.rb, line 20
def self.delete(vault, id)
  vault.accessResource("DELETE", CLIENTS_RESOURCE, id, nil, nil)
end
fetch(vault, id) click to toggle source

Fetch desired client information from the specified Vault

@param vault [Vault] The initialized Vault @param id [String] The ID of the client

@return client [Hash]

# File lib/dsv/client.rb, line 11
def self.fetch(vault, id)
  @vault = vault
  client = @vault.accessResource("GET", CLIENTS_RESOURCE, id, nil)
end