Skip to content

Instantly share code, notes, and snippets.

@aia
Last active December 27, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aia/7341588 to your computer and use it in GitHub Desktop.
Save aia/7341588 to your computer and use it in GitHub Desktop.
class EMR::Monitor::APIv1 < Grape::API
version 'v1', :using => :path, :vendor => 'Wealthfront'
format :json
resource 'steps' do
desc "List time length of the last step with name and state."
params do
requires :name, type: String, desc: "Step name substring."
requires :state, type: String, desc: "Step state."
end
get "/name/:name/state/:state/last/clock_time" do
last_step = list_last_step_by_name_state(params[:name], params[:state])
clock_time = last_step[:end_date_time] - last_step[:start_date_time]
end
end
end
class EMR::Monitor::API < Grape::API
mount EMR::Monitor::APIv1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment