Sha256: c665a2aa20accf3de6936921a42cfeee6caf2208fb8b3acb89d4b3a563aa4a5a
Contents?: true
Size: 688 Bytes
Versions: 22
Compression:
Stored size: 688 Bytes
Contents
module Kontena::Cli::Vault class WriteCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions parameter 'NAME', 'Secret name' parameter '[VALUE]', 'Secret value' def execute require_api_url require_current_grid token = require_token secret = value if secret.to_s == '' secret = STDIN.read end exit_with_error('No value provided') if secret.to_s == '' data = { name: name, value: secret } spinner "Writing #{name.colorize(:cyan)} to the vault " do client(token).post("grids/#{current_grid}/secrets", data) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems