class RightScaleCLI::SSHKeys

interface /api/clouds/ssh_keys

Public Class Methods

banner(task, namespace = true, subcommand = false) click to toggle source
new(*args) click to toggle source
Calls superclass method
# File lib/rightscale_cli/ssh_keys.rb, line 26
def initialize(*args)
  super
  @client = RightScaleCLI::Client.new(options)
  @logger = RightScaleCLI::Logger.new
end

Public Instance Methods

create(name) click to toggle source
# File lib/rightscale_cli/ssh_keys.rb, line 74
def create(name)
  # todo
end
destroy(server) click to toggle source
# File lib/rightscale_cli/ssh_keys.rb, line 79
def destroy(server)
  # todo
end
list() click to toggle source
# File lib/rightscale_cli/ssh_keys.rb, line 47
def list
  filter = [].push("resource_uid==#{options[:uid]}") if options[:uid]

  results = @client.client.clouds(
    id: options[:cloud]
  ).show.ssh_keys(filter: filter).index

  ssh_keys = []
  results.each do |result|
    ssh_key = result.raw
    ssh_key['href'] = result.href
    ssh_keys.push(ssh_key)
  end

  @client.render(ssh_keys, 'ssh_keys')
end
show(ssh_key_id) click to toggle source
# File lib/rightscale_cli/ssh_keys.rb, line 69
def show(ssh_key_id)
  @client.render(@client.client.clouds(id: options[:cloud]).show.ssh_keys(id: ssh_key_id).show.raw, 'ssh_key')
end