fluke/devops-service/app/api2/routes/network.rb

44 lines
1.1 KiB
Ruby
Raw Normal View History

2014-05-08 15:34:26 +04:00
# encoding: UTF-8
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 NetworkRoutes
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
def self.registered(app)
2014-12-22 14:22:04 +03:00
2014-12-15 14:26:54 +03:00
# Get list of networks for :provider
#
# * *Request*
# - method : GET
# - headers :
# - Accept: application/json
#
# * *Returns* : array of strings
# - ec2:
# [
# {
# "cidr": "0.0.0.0/16",
# "vpcId": "vpc-1",
# "subnetId": "subnet-1",
# "name": "subnet-1",
# "zone": "us-east-1a"
# }
# ]
# - openstack:
# [
# {
# "cidr": "0.0.0.0/16",
# "name": "private",
# "id": "b14f8df9-ac27-48e2-8d65-f7ef78dc2654"
# }
# ]
2015-02-19 12:01:39 +03:00
app.get_with_headers "/networks/:provider", :headers => [:accept], &Devops::Version2_0::Handler::Network.get_networks
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
puts "Network routes initialized"
end
2014-05-08 15:34:26 +04:00
2014-12-15 14:26:54 +03:00
end
end
2014-05-08 15:34:26 +04:00
end
end