fluke/devops-service/app/api3/routes/provider_notification.rb

28 lines
835 B
Ruby
Raw Normal View History

2016-04-04 13:17:07 +03:00
module Devops
2018-04-04 22:44:39 +03:00
module API3
2016-04-04 13:17:07 +03:00
module Routes
2018-04-04 22:44:39 +03:00
module ProjectRoutes
2016-04-04 13:17:07 +03:00
def self.registered(app)
# * *Request*
# - method : POST
# Checks if given autoscaling group is launched within stack that is handled by CID.
# If so, starts syncing that stack. Otherwise returns 404 error.
#
# * *Returns* :
2018-04-04 22:44:39 +03:00
# task_id
app.post_with_headers '/provider_notifications/aws/:provider_account/autoscaling_groups/:id/changes' do |provider_account, group_id|
2016-04-04 13:17:07 +03:00
check_privileges("stack", "r")
2018-04-04 22:44:39 +03:00
json Devops::API3::Handler::Provider::ProviderNotification.new(request).autoscaling_groups_change(group_id, provider_account)
2016-04-04 13:17:07 +03:00
end
puts "ProviderNotifications routes initialized"
2016-04-04 13:17:07 +03:00
end
2018-04-04 22:44:39 +03:00
2016-04-04 13:17:07 +03:00
end
end
end
2018-04-04 22:44:39 +03:00
end