Class: Hsp::Cli::Main

Inherits:
Thor
  • Object
show all
Defined in:
lib/hsp/cli.rb

Instance Method Summary collapse

Instance Method Details

#agentObject



41
42
43
44
45
46
47
48
49
50
# File 'lib/hsp/cli.rb', line 41

def agent
    m = Marketplace.new
    m.websocket_url = options[:websocket_url] if options[:websocket_url]
    m.rest_url = options[:rest_url] if options[:rest_url]
    response = HTTParty.get(m.services_url(options[:service_id]), headers: Hsp::Client.headers)
    json = JSON.parse(response.body)
    # TODO Don't hardcode the Docker API implementation! For now, though, it's fine.
    agent = Hsp::Agent.new(m, Hsp::Orchestrator::Docker.new, options[:platform_id], options[:platform_secret]) # TODO: Make agnostic to orchestration platform
    agent.run(options[:platform_id], !!options[:show_pings])
end

#versionObject



53
54
55
# File 'lib/hsp/cli.rb', line 53

def version
    puts Hsp::VERSION
end