Class: OpsManager::Cli::Curl

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/ops_manager/cli.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/ops_manager/cli.rb', line 119

def execute
  puts case http_method.strip
  when 'GET'
    opsman.authenticated_get(@endpoint).body
  when 'DELETE'
    opsman.authenticated_delete(@endpoint).body
  when 'POST'
    opsman.authenticated_post(@endpoint).body
  when 'PUT'
    opsman.authenticated_put(@endpoint, body: strip(@data, "'")).body
  else
    "Unsupported method: #{http_method.strip}"
  end
end