fluke/devops-service/routes/v2.0/flavor.rb

43 lines
1.0 KiB
Ruby
Raw Normal View History

2014-12-15 14:26:54 +03:00
module Devops
module Version2_0
2014-12-22 14:22:04 +03:00
module Routes
2014-12-15 14:26:54 +03:00
module FlavorRoutes
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
def self.registered(app)
# Get list of flavors for :provider
#
# * *Request*
# - method : GET
# - headers :
# - Accept: application/json
#
# * *Returns* : array of objects
# - ec2:
# [
# {
# "id": "t1.micro",
# "cores": 2,
# "disk": 0,
# "name": "Micro Instance",
# "ram": 613
# }
# ]
# - openstack:
# [
# {
# "id": "m1.small",
# "v_cpus": 1,
# "ram": 2048,
# "disk": 20
# }
# ]
2015-02-18 13:15:25 +03:00
app.get_with_headers "/flavors/:provider", :headers => [:accept], &Devops::Version2_0::Handler::Flavor.get_flavors
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
puts "Flavor routes initialized"
end
end
end
2014-05-08 15:34:26 +04:00
end
end