class WavefrontDisplay::ServiceAccount

Format human-readable output for service account commands.

Public Instance Methods

do_activate() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 22
def do_activate
  puts format("Activated service account '#{options[:'<id>']}'.")
end
do_apitoken_delete() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 75
def do_apitoken_delete
  puts format("Deleted API token '#{options[:'<token_id>']}'.")
end
do_apitoken_list() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 67
def do_apitoken_list
  if data.empty?
    puts 'Account does not have any API tokens.'
  else
    multicolumn(:tokenID, :tokenName)
  end
end
do_deactivate() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 26
def do_deactivate
  puts format("Deactivated service account '#{options[:'<id>']}'.")
end
do_delete() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 79
def do_delete
  puts format("Deleted #{friendly_name} %<quoted_account>s.",
              quoted_account: quoted(options[:'<account>']))
end
do_describe() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 10
def do_describe
  long_output
end
do_grant() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 57
def do_grant
  puts format("Granted '%<perm>s' to '%<account>s'.",
              perm: options[:'<permission>'], account: options[:'<id>'])
end
do_groups() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 30
def do_groups
  if data[:userGroups].empty?
    puts 'Account does not belong to any groups.'
  else
    data[:userGroups].each { |u| puts format('%<id>s (%<name>s)', u) }
  end
end
Also aliased as: do_join, do_leave
do_ingestionpolicy() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 49
def do_ingestionpolicy
  if data[:ingestionPolicy].empty?
    puts 'Account does not have an ingestion policy attached.'
  else
    puts format('%<id>s (%<name>s)', data[:ingestionPolicy])
  end
end
do_join()
Alias for: do_groups
do_leave()
Alias for: do_groups
do_list_brief() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 14
def do_list_brief
  if data.empty?
    puts 'You have no service accounts.'
  else
    multicolumn(:identifier, :description)
  end
end
do_revoke() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 62
def do_revoke
  puts format("Revoked '%<perm>s' from '%<account>s'.",
              perm: options[:'<permission>'], account: options[:'<id>'])
end
do_roles() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 38
def do_roles
  if data[:roles].empty?
    puts 'Account does not have any roles attached.'
  else
    data[:roles].each { |r| puts format('%<id>s (%<name>s)', r) }
  end
end
priority_keys() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 88
def priority_keys
  %i[identifier]
end
search_identifier_key() click to toggle source
# File lib/wavefront-cli/display/serviceaccount.rb, line 84
def search_identifier_key
  :identifier
end