56 lines
1.4 KiB
Ruby
56 lines
1.4 KiB
Ruby
# encoding: UTF-8
|
|
module Devops
|
|
module Version2_0
|
|
module Routes
|
|
module GroupRoutes
|
|
|
|
def self.registered(app)
|
|
|
|
# Get security groups for :provider
|
|
#
|
|
# * *Request*
|
|
# - method : GET
|
|
# - headers :
|
|
# - Accept: application/json
|
|
#
|
|
# * *Returns* :
|
|
# - ec2:
|
|
# {
|
|
# "default": {
|
|
# "description": "default group",
|
|
# "id": "sg-565cf93f",
|
|
# "rules": [
|
|
# {
|
|
# "protocol": "tcp",
|
|
# "from": 22,
|
|
# "to": 22,
|
|
# "cidr": "0.0.0.0/0"
|
|
# }
|
|
# ]
|
|
# }
|
|
# }
|
|
# - openstack:
|
|
# {
|
|
# "default": {
|
|
# "description": "default",
|
|
# "rules": [
|
|
# {
|
|
# "protocol": null,
|
|
# "from": null,
|
|
# "to": null,
|
|
# "cidr": null
|
|
# }
|
|
# ]
|
|
# }
|
|
# }
|
|
# TODO: vpc support for ec2
|
|
app.get_with_headers "/groups/:provider", :headers => [:accept], &Devops::Version2_0::Handler::Group.get_groups
|
|
|
|
puts "Group routes initialized"
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|