Class: Threadfix::Cli::Applications
- Inherits:
-
Thor
- Object
- Thor
- Threadfix::Cli::Applications
- Defined in:
- lib/threadfix/cli/applications.rb
Instance Method Summary collapse
Instance Method Details
#get_id ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/threadfix/cli/applications.rb', line 9 def get_id Client.configure do |config| config.host = [:host] if [:host] config.key = [:key] if [:key] end begin response = Client::Applications.get_id(app_name: [:app_name] ) if !response.nil? puts response end rescue SocketError => e puts "Error: Unable open connection to '#{Client.config.host}'" exit 1 end end |
#lookup ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/threadfix/cli/applications.rb', line 31 def lookup Client.configure do |config| config.host = [:host] if [:host] config.key = [:key] if [:key] end begin response = Client::Applications.lookup(team_name: [:team_name], app_name: [:app_name] ) if response['message'] == '' puts "ID: #{response['object']['id']}" else puts response['message'] end rescue SocketError => e puts "Error: Unable open connection to '#{Client.config.host}'" exit 1 end end |