├── log └── .gitkeep ├── html └── created.rid ├── lib ├── tasks │ ├── .gitkeep │ └── documentation.rake └── assets │ └── .gitkeep ├── test ├── unit │ ├── .gitkeep │ ├── helpers │ │ ├── home_helper_test.rb │ │ ├── rest_helper_test.rb │ │ ├── setups_helper_test.rb │ │ ├── test_helper_test.rb │ │ ├── types_helper_test.rb │ │ ├── template_helper_test.rb │ │ ├── quantum_subnet_helper_test.rb │ │ ├── visualisation_helper_test.rb │ │ └── quantum_subnets_helper_test.rb │ ├── node_test.rb │ ├── type_test.rb │ ├── vm_test.rb │ ├── flavor_test.rb │ ├── image_test.rb │ ├── router_test.rb │ ├── subnet_test.rb │ ├── service_test.rb │ ├── services_test.rb │ ├── storage_test.rb │ ├── template_test.rb │ ├── connection_test.rb │ ├── connections_test.rb │ ├── network_design_test.rb │ ├── connected_router_test.rb │ ├── connected_subnet_test.rb │ ├── router_connection_test.rb │ └── container_connection_test.rb ├── fixtures │ ├── .gitkeep │ ├── storages.yml │ ├── templates.yml │ ├── connections.yml │ ├── connected_subnets.yml │ ├── flavors.yml │ ├── images.yml │ ├── services.yml │ ├── router_connections.yml │ ├── connected_routers.yml │ ├── nodes.yml │ ├── container_connections.yml │ ├── network_designs.yml │ ├── subnets.yml │ ├── routers.yml │ ├── types.yml │ └── vms.yml ├── functional │ ├── .gitkeep │ ├── test_controller_test.rb │ ├── setups_controller_test.rb │ ├── types_controller_test.rb │ ├── template_controller_test.rb │ ├── quantum_subnet_controller_test.rb │ ├── quantum_subnets_controller_test.rb │ ├── home_controller_test.rb │ ├── rest_controller_test.rb │ └── visualisation_controller_test.rb ├── integration │ └── .gitkeep ├── performance │ └── browsing_test.rb └── test_helper.rb ├── app ├── mailers │ └── .gitkeep ├── models │ ├── .gitkeep │ └── storage.rb ├── helpers │ ├── setups_helper.rb │ └── application_helper.rb ├── views │ ├── logins │ │ ├── get_tenants.json.erb │ │ ├── create.html.erb │ │ └── show.html.erb │ ├── setups │ │ ├── curvature.yml.erb │ │ └── show.html.erb │ ├── visualisations │ │ ├── _containersindex.html.erb │ │ ├── _form.html.erb │ │ ├── _menubar.html.erb │ │ └── show.html.erb │ └── layouts │ │ ├── application.html.erb │ │ ├── setups.html.erb │ │ └── visualisations.html.erb ├── assets │ ├── images │ │ ├── cisco.jpeg │ │ ├── loading.gif │ │ ├── pbar-ani.gif │ │ ├── cisco_logo.png │ │ ├── cisco_logo.xcf │ │ ├── curvature_logo.png │ │ ├── openstacklogo.jpeg │ │ ├── Curvature Logo Upscale.png │ │ └── Controls Overlay - Curvature.png │ ├── javascripts │ │ ├── visualisation │ │ │ ├── D3 │ │ │ │ ├── .DS_Store │ │ │ │ └── quota.js.coffee │ │ │ ├── Nodes │ │ │ │ ├── port.js.coffee │ │ │ │ ├── volume.js.coffee │ │ │ │ ├── external_network.js.coffee │ │ │ │ ├── subnet.js.coffee │ │ │ │ ├── deployable.js.coffee │ │ │ │ ├── router.js.coffee │ │ │ │ ├── network.js.coffee │ │ │ │ ├── node.js.coffee │ │ │ │ ├── container.js.coffee │ │ │ │ └── server.js.coffee │ │ │ └── App │ │ │ │ ├── rest.js.coffee │ │ │ │ ├── input.js.coffee │ │ │ │ └── donabe.js.coffee │ │ ├── visualisation.js.coffee │ │ ├── application.js │ │ └── setups.js.coffee │ └── stylesheets │ │ ├── visualisation.css.scss │ │ ├── setups.css.scss │ │ ├── visualisation │ │ ├── popups.css │ │ ├── d3.css │ │ ├── tools_tabs.css │ │ ├── network_tabs.css │ │ ├── menubar.css │ │ ├── overview_bars.css │ │ ├── zoom_slider.css │ │ └── curvature.css │ │ ├── application.css │ │ └── form.css └── controllers │ ├── openstack │ ├── volumes_controller.rb │ ├── flavors_controller.rb │ ├── router_gateways_controller.rb │ ├── router_interfaces_controller.rb │ ├── rules_controller.rb │ ├── subnets_controller.rb │ ├── security_groups_controller.rb │ ├── routers_controller.rb │ ├── floating_ips_controller.rb │ ├── keypairs_controller.rb │ ├── networks_controller.rb │ ├── ports_controller.rb │ ├── images_controller.rb │ └── servers_controller.rb │ ├── visualisations_controller.rb │ ├── setups_controller.rb │ ├── donabe │ ├── deployed_containers_controller.rb │ └── containers_controller.rb │ └── logins_controller.rb ├── vendor ├── plugins │ └── .gitkeep └── assets │ ├── javascripts │ ├── .gitkeep │ └── fisheye.js │ ├── stylesheets │ └── .gitkeep │ ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff │ └── images │ └── jquery-ui │ ├── animated-overlay.gif │ ├── ui-icons_2694e8_256x240.png │ ├── ui-icons_2e83ff_256x240.png │ ├── ui-icons_3d80b3_256x240.png │ ├── ui-icons_72a7cf_256x240.png │ ├── ui-icons_ffffff_256x240.png │ ├── ui-bg_flat_15_cd0a0a_40x100.png │ ├── ui-bg_glass_50_3baae3_1x400.png │ ├── ui-bg_glass_80_d7ebf9_1x400.png │ ├── ui-bg_glass_100_e4f1fb_1x400.png │ ├── ui-bg_diagonals-thick_90_eeeeee_40x40.png │ ├── ui-bg_highlight-hard_100_f2f5f7_1x100.png │ ├── ui-bg_highlight-hard_70_000000_1x100.png │ ├── ui-bg_highlight-soft_100_deedf7_1x100.png │ └── ui-bg_highlight-soft_25_ffef8f_1x100.png ├── public ├── icon.png ├── favicon.ico ├── splash_screen.png ├── Current Cisco Logo.png ├── 500.html ├── 422.html ├── 404.html └── README.md ├── doc ├── app │ ├── images │ │ ├── add.png │ │ ├── bug.png │ │ ├── brick.png │ │ ├── date.png │ │ ├── delete.png │ │ ├── find.png │ │ ├── plugin.png │ │ ├── ruby.png │ │ ├── wrench.png │ │ ├── zoom.png │ │ ├── package.png │ │ ├── tag_blue.png │ │ ├── brick_link.png │ │ ├── macFFBgHack.png │ │ ├── page_green.png │ │ ├── tag_green.png │ │ ├── transparent.png │ │ ├── bullet_black.png │ │ ├── wrench_orange.png │ │ ├── loadingAnimation.gif │ │ ├── page_white_text.png │ │ ├── page_white_width.png │ │ ├── bullet_toggle_plus.png │ │ └── bullet_toggle_minus.png │ ├── created.rid │ ├── js │ │ ├── search.js │ │ ├── navigation.js │ │ └── darkfish.js │ ├── index.html │ ├── doc │ │ └── README_FOR_APP.html │ ├── Donabe.html │ ├── ApplicationHelper.html │ └── Openstack.html ├── README_FOR_APP └── coffee │ ├── index.html │ ├── mixin_list.html │ ├── extra_list.html │ ├── file_list.html │ ├── classes │ ├── App │ │ └── Port.html │ └── Nodes │ │ └── Port.html │ ├── files │ ├── App │ │ ├── startup.js.coffee.html │ │ └── popups.js.coffee.html │ └── popups.js.coffee.html │ └── class_list.html ├── restart.sh ├── config.ru ├── config ├── environment.rb ├── boot.rb ├── initializers │ ├── mime_types.rb │ ├── load_config.rb │ ├── backtrace_silencers.rb │ ├── session_store.rb │ ├── secret_token.rb │ ├── wrap_parameters.rb │ └── inflections.rb ├── locales │ └── en.yml ├── database.yml ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb ├── routes.rb └── application.rb ├── db ├── migrate │ └── 20121026202846_create_storages.rb ├── seeds.rb └── schema.rb ├── .gitignore ├── Rakefile ├── script └── rails ├── LICENSE.txt ├── Gemfile ├── Running Curvature in Production.md └── README.md /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /html/created.rid: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/functional/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/helpers/setups_helper.rb: -------------------------------------------------------------------------------- 1 | module SetupsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/views/logins/get_tenants.json.erb: -------------------------------------------------------------------------------- 1 | <%= @tenant_data.html_safe %> 2 | -------------------------------------------------------------------------------- /public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/public/icon.png -------------------------------------------------------------------------------- /app/models/storage.rb: -------------------------------------------------------------------------------- 1 | class Storage < ActiveRecord::Base 2 | attr_accessible :data 3 | end 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /doc/app/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/add.png -------------------------------------------------------------------------------- /doc/app/images/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/bug.png -------------------------------------------------------------------------------- /restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rake db:drop 3 | rake db:create 4 | rake db:migrate 5 | rails server 6 | -------------------------------------------------------------------------------- /doc/app/images/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/brick.png -------------------------------------------------------------------------------- /doc/app/images/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/date.png -------------------------------------------------------------------------------- /doc/app/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/delete.png -------------------------------------------------------------------------------- /doc/app/images/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/find.png -------------------------------------------------------------------------------- /doc/app/images/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/plugin.png -------------------------------------------------------------------------------- /doc/app/images/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/ruby.png -------------------------------------------------------------------------------- /doc/app/images/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/wrench.png -------------------------------------------------------------------------------- /doc/app/images/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/zoom.png -------------------------------------------------------------------------------- /public/splash_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/public/splash_screen.png -------------------------------------------------------------------------------- /doc/app/images/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/package.png -------------------------------------------------------------------------------- /doc/app/images/tag_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/tag_blue.png -------------------------------------------------------------------------------- /app/assets/images/cisco.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/cisco.jpeg -------------------------------------------------------------------------------- /app/assets/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/loading.gif -------------------------------------------------------------------------------- /app/assets/images/pbar-ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/pbar-ani.gif -------------------------------------------------------------------------------- /doc/app/images/brick_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/brick_link.png -------------------------------------------------------------------------------- /doc/app/images/macFFBgHack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/macFFBgHack.png -------------------------------------------------------------------------------- /doc/app/images/page_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/page_green.png -------------------------------------------------------------------------------- /doc/app/images/tag_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/tag_green.png -------------------------------------------------------------------------------- /doc/app/images/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/transparent.png -------------------------------------------------------------------------------- /public/Current Cisco Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/public/Current Cisco Logo.png -------------------------------------------------------------------------------- /app/assets/images/cisco_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/cisco_logo.png -------------------------------------------------------------------------------- /app/assets/images/cisco_logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/cisco_logo.xcf -------------------------------------------------------------------------------- /doc/app/images/bullet_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/bullet_black.png -------------------------------------------------------------------------------- /doc/app/images/wrench_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/wrench_orange.png -------------------------------------------------------------------------------- /doc/app/images/loadingAnimation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/loadingAnimation.gif -------------------------------------------------------------------------------- /doc/app/images/page_white_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/page_white_text.png -------------------------------------------------------------------------------- /doc/app/images/page_white_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/page_white_width.png -------------------------------------------------------------------------------- /test/unit/helpers/home_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class HomeHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/rest_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RestHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/setups_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SetupHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/test_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TestHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/types_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TypesHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /vendor/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /app/assets/images/curvature_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/curvature_logo.png -------------------------------------------------------------------------------- /app/assets/images/openstacklogo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/openstacklogo.jpeg -------------------------------------------------------------------------------- /doc/app/images/bullet_toggle_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/bullet_toggle_plus.png -------------------------------------------------------------------------------- /test/unit/helpers/template_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ContainerHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /doc/app/images/bullet_toggle_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/doc/app/images/bullet_toggle_minus.png -------------------------------------------------------------------------------- /test/unit/helpers/quantum_subnet_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class QuantumSubnetHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/unit/helpers/visualisation_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VisualisationHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/images/Curvature Logo Upscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/Curvature Logo Upscale.png -------------------------------------------------------------------------------- /app/views/logins/create.html.erb: -------------------------------------------------------------------------------- 1 | <% if @login_successful > 0 %> 2 | LOGGED IN CORRECTLY! 3 | <% else %> 4 | LOGIN FAILED! 5 | <% end %> 6 | -------------------------------------------------------------------------------- /test/unit/helpers/quantum_subnets_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class QuantumSubnetsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /vendor/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /vendor/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /vendor/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /app/assets/images/Controls Overlay - Curvature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/images/Controls Overlay - Curvature.png -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/D3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/app/assets/javascripts/visualisation/D3/.DS_Store -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation.css.scss: -------------------------------------------------------------------------------- 1 | /* 2 | *=require jquery-ui-1.10.1.custom 3 | *=require font-awesome 4 | *=require_tree ./visualisation 5 | */ 6 | -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/animated-overlay.gif -------------------------------------------------------------------------------- /test/unit/node_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NodeTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/type_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TypeTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/vm_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VmTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/flavor_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FlavorTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/image_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ImageTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/router_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RouterTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/subnet_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SubnetTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/service_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ServiceTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/services_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ServicesTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/storage_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class StorageTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/template_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ContainerTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-icons_2694e8_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-icons_2694e8_256x240.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-icons_3d80b3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-icons_3d80b3_256x240.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-icons_72a7cf_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-icons_72a7cf_256x240.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Server::Application 5 | -------------------------------------------------------------------------------- /test/fixtures/storages.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | data: MyText 5 | 6 | two: 7 | data: MyText 8 | -------------------------------------------------------------------------------- /test/unit/connection_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ConnectionTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/connections_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ConnectionsTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_flat_15_cd0a0a_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_flat_15_cd0a0a_40x100.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_glass_50_3baae3_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_glass_50_3baae3_1x400.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_glass_80_d7ebf9_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_glass_80_d7ebf9_1x400.png -------------------------------------------------------------------------------- /test/fixtures/templates.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | body: MyString 5 | 6 | two: 7 | body: MyString 8 | -------------------------------------------------------------------------------- /test/unit/network_design_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NetworkDesignTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_glass_100_e4f1fb_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_glass_100_e4f1fb_1x400.png -------------------------------------------------------------------------------- /app/controllers/openstack/volumes_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::VolumesController < ApplicationController 2 | def index 3 | json_respond blockstorage().volumes() 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the rails application 5 | Server::Application.initialize! 6 | -------------------------------------------------------------------------------- /test/unit/connected_router_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ConnectedRouterTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/connected_subnet_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ConnectedSubnetTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/router_connection_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RouterConnectionTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/test_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TestControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/setups_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SetupControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/types_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TypesControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/unit/container_connection_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ContainerConnectionTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_diagonals-thick_90_eeeeee_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_diagonals-thick_90_eeeeee_40x40.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_highlight-hard_100_f2f5f7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_highlight-hard_100_f2f5f7_1x100.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_highlight-hard_70_000000_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_highlight-hard_70_000000_1x100.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_deedf7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_deedf7_1x100.png -------------------------------------------------------------------------------- /vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_ffef8f_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoSystems/curvature/HEAD/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_ffef8f_1x100.png -------------------------------------------------------------------------------- /test/functional/template_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ContainerControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/quantum_subnet_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class QuantumSubnetControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/functional/quantum_subnets_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class QuantumSubnetsControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/stylesheets/setups.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the setup controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | # Set up gems listed in the Gemfile. 4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 5 | 6 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 7 | -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. -------------------------------------------------------------------------------- /test/fixtures/connections.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | subnet: MyString 5 | node: 6 | 7 | two: 8 | subnet: MyString 9 | node: 10 | -------------------------------------------------------------------------------- /test/fixtures/connected_subnets.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | subnet_id: MyString 5 | vm: 6 | 7 | two: 8 | subnet_id: MyString 9 | vm: 10 | -------------------------------------------------------------------------------- /test/fixtures/flavors.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | uuid: MyString 6 | 7 | two: 8 | name: MyString 9 | uuid: MyString 10 | -------------------------------------------------------------------------------- /test/fixtures/images.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | uuid: MyString 6 | 7 | two: 8 | name: MyString 9 | uuid: MyString 10 | -------------------------------------------------------------------------------- /test/fixtures/services.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | data: MyText 6 | 7 | two: 8 | name: MyString 9 | data: MyText 10 | -------------------------------------------------------------------------------- /db/migrate/20121026202846_create_storages.rb: -------------------------------------------------------------------------------- 1 | class CreateStorages < ActiveRecord::Migration 2 | def change 3 | create_table :storages do |t| 4 | t.text :data 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/fixtures/router_connections.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | router: MyString 5 | Subnets: 6 | 7 | two: 8 | router: MyString 9 | Subnets: 10 | -------------------------------------------------------------------------------- /test/fixtures/connected_routers.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | router_id: MyString 5 | subnet: 6 | 7 | two: 8 | router_id: MyString 9 | subnet: 10 | -------------------------------------------------------------------------------- /test/functional/home_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class HomeControllerTest < ActionController::TestCase 4 | test "should get index" do 5 | get :index 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /test/functional/rest_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RestControllerTest < ActionController::TestCase 4 | test "should get rest" do 5 | get :rest 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | -------------------------------------------------------------------------------- /app/views/setups/curvature.yml.erb: -------------------------------------------------------------------------------- 1 | defaults: &defaults 2 | identity: 3 | ip: http://<%= @ip %> 4 | port: <%= @port %> 5 | 6 | development: 7 | <<: *defaults 8 | 9 | test: 10 | <<: *defaults 11 | 12 | production: 13 | <<: *defaults 14 | -------------------------------------------------------------------------------- /test/functional/visualisation_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VisualisationControllerTest < ActionController::TestCase 4 | test "should get index" do 5 | get :index 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/openstack/flavors_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::FlavorsController < ApplicationController 2 | ## 3 | # GET /openstack/flavors 4 | # Returns all the flavors from openstack 5 | def index 6 | json_respond compute().flavors() 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | DS_Store 2 | 3 | log/development.log 4 | log/production.log 5 | 6 | public/assets 7 | 8 | *.lock 9 | 10 | *.swp 11 | 12 | tmp/**/* 13 | 14 | db/development.sqlite3 15 | 16 | *.sqlite3 17 | 18 | .orig 19 | 20 | *.log 21 | 22 | */curvature.yml 23 | -------------------------------------------------------------------------------- /test/fixtures/nodes.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | image: MyString 6 | container: 7 | 8 | two: 9 | name: MyString 10 | image: MyString 11 | container: 12 | -------------------------------------------------------------------------------- /config/initializers/load_config.rb: -------------------------------------------------------------------------------- 1 | require 'yaml' 2 | 3 | begin 4 | configfile = YAML.load_file("#{Rails.root}/config/curvature.yml") 5 | APP_CONFIG = configfile[Rails.env] 6 | rescue Exception => e 7 | puts e 8 | APP_CONFIG = { :no_config => true } 9 | end 10 | -------------------------------------------------------------------------------- /test/fixtures/container_connections.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | container: 1 5 | connected_to: 1 6 | Container: 7 | 8 | two: 9 | container: 1 10 | connected_to: 1 11 | Container: 12 | -------------------------------------------------------------------------------- /test/fixtures/network_designs.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | nname: MyString 5 | read: false 6 | body: MyString 7 | 8 | two: 9 | nname: MyString 10 | read: false 11 | body: MyString 12 | -------------------------------------------------------------------------------- /test/fixtures/subnets.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | temp_id: MyString 6 | network_design: 7 | 8 | two: 9 | name: MyString 10 | temp_id: MyString 11 | network_design: 12 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Server::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation.js.coffee: -------------------------------------------------------------------------------- 1 | #=require jquery-ui-1.10.0.custom.min 2 | #=require jquery.ui.menubar 3 | #=require d3.v3 4 | #=require ./visualisation/Nodes/node 5 | #=require ./visualisation/Nodes/deployable 6 | #=require_tree ./visualisation/Nodes 7 | #=require_tree ./visualisation 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/port.js.coffee: -------------------------------------------------------------------------------- 1 | # Port Class 2 | # 3 | class Nodes.Port 4 | # The constructor for a new port 5 | # 6 | # @param data [Object] The data for the new port 7 | # 8 | constructor: (data) -> 9 | for key in Object.keys(data) 10 | this[key] = data[key] 11 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/volume.js.coffee: -------------------------------------------------------------------------------- 1 | # Volume class (not deployable) 2 | # 3 | class Nodes.Volume extends Nodes.Node 4 | # Construct a new Volume Object 5 | # 6 | # @param data [Object] Data to assign to the new Node 7 | # 8 | constructor: (data) -> 9 | super(data, "volume") 10 | -------------------------------------------------------------------------------- /test/fixtures/routers.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | temp_id: MyString 6 | exnet: false 7 | network_design: 8 | 9 | two: 10 | name: MyString 11 | temp_id: MyString 12 | exnet: false 13 | network_design: 14 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/external_network.js.coffee: -------------------------------------------------------------------------------- 1 | # External network class 2 | # 3 | class Nodes.ExternalNetwork extends Nodes.Node 4 | # Construct a new External Network object 5 | # 6 | # @param data [Object] Data to assign to the new Node 7 | # 8 | constructor: (data) -> 9 | super(data, "external") -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby1.8 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /test/fixtures/types.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | name: MyString 5 | image: MyString 6 | flavor: MyString 7 | network_design: 8 | 9 | two: 10 | name: MyString 11 | image: MyString 12 | flavor: MyString 13 | network_design: 14 | -------------------------------------------------------------------------------- /app/controllers/openstack/router_gateways_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::RouterGatewaysController < ApplicationController 2 | def create 3 | json_respond networking().add_router_gateway(params[:router_id], params[:network_id]) 4 | end 5 | 6 | def destroy 7 | json_respond networking().delete_router_gateway(params[:router_id]) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/fixtures/vms.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | image_name: MyString 5 | image_id: MyString 6 | vm: 7 | temp_id: MyString 8 | network_design: 9 | 10 | two: 11 | image_name: MyString 12 | image_id: MyString 13 | vm: 14 | temp_id: MyString 15 | network_design: 16 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) 7 | # Mayor.create(:name => 'Emanuel', :city => cities.first) 8 | -------------------------------------------------------------------------------- /app/controllers/openstack/router_interfaces_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::RouterInterfacesController < ApplicationController 2 | def create 3 | json_respond networking().add_router_interface(params[:router_id], params[:subnet_id]) 4 | end 5 | 6 | def destroy 7 | json_respond networking().delete_router_interface(params[:router_id], params[:id], 'subnet') 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/openstack/rules_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::RulesController < ApplicationController 2 | def create 3 | json_respond compute().create_security_group_rule(params[:protocol], params[:from], params[:to], params[:cidr], params[:security_group_id]) 4 | end 5 | 6 | def destroy 7 | json_respond compute().destroy_security_group_rule(params[:id]) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/openstack/subnets_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::SubnetsController < ApplicationController 2 | def index 3 | json_respond networking().subnets() 4 | end 5 | 6 | def create 7 | json_respond networking().create_subnet(params[:network_id], params[:cidr]) 8 | end 9 | 10 | def destroy 11 | json_respond networking().delete_subnet(params[:id]) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/performance/browsing_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | require 'rails/performance_test_help' 3 | 4 | class BrowsingTest < ActionDispatch::PerformanceTest 5 | # Refer to the documentation for all available options 6 | # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] 7 | # :output => 'tmp/performance', :formats => [:flat] } 8 | 9 | def test_homepage 10 | get '/' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Server::Application.config.session_store :cookie_store, :key => '_Server_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rails generate session_migration") 8 | #Server::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /app/controllers/visualisations_controller.rb: -------------------------------------------------------------------------------- 1 | class VisualisationsController < ApplicationController 2 | before_filter :require_login 3 | 4 | def show 5 | @containers = !(sesh :donabe_ip).nil? 6 | respond_to do |format| 7 | format.html 8 | end 9 | end 10 | 11 | private 12 | 13 | def require_login 14 | unless logged_in? 15 | flash[:error] = "Please login to access dashboard!" 16 | redirect_to login_url 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /doc/coffee/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/controllers/openstack/security_groups_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::SecurityGroupsController < ApplicationController 2 | def index 3 | json_respond compute().security_groups() 4 | end 5 | 6 | def create 7 | json_respond compute().create_security_group(params[:name], params[:description]) 8 | end 9 | 10 | def show 11 | json_respond compute().security_groups(params[:id]) 12 | end 13 | 14 | def destroy 15 | json_respond compute().destroy_security_group(params[:id]) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. 7 | # 8 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 9 | # -- they do not yet inherit this setting 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/popups.css: -------------------------------------------------------------------------------- 1 | /* ================================================================= */ 2 | /* = Popup Css = */ 3 | /* ================================================================= */ 4 | 5 | /* Dialog Buttons */ 6 | .ui-dialog .ui-dialog-buttonpane button { 7 | font-size: 12px; 8 | } 9 | 10 | #containerEditor{ 11 | width: 500px; 12 | height: 500px; 13 | } 14 | 15 | #errorDetails { 16 | border: 1px solid GRAY; 17 | display: none; 18 | } 19 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | Server::Application.config.secret_token = 'f9f6ea220826c1924e672f5ce2daca746c2b3277717485c51ab1cb786bd65050856da1229d0c8619b4cd65dd58b6b83e888c230bf2c7325636eeaf9e5eee15d0' 8 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters :format => [:json] 9 | end 10 | 11 | # Disable root element in JSON by default. 12 | ActiveSupport.on_load(:active_record) do 13 | self.include_root_in_json = false 14 | end 15 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/d3.css: -------------------------------------------------------------------------------- 1 | /* ====================================================================== */ 2 | /* = D3 Related CSS = */ 3 | /* ====================================================================== */ 4 | 5 | .GraphContainers{ 6 | display:table-row; 7 | height: 100%; 8 | } 9 | 10 | .GraphContainers a{outline:none;} 11 | 12 | #graph{ 13 | width: 100%; 14 | height: 100%; 15 | 16 | padding: 0px; 17 | margin: 0px; 18 | } 19 | 20 | #deployButton { 21 | position: absolute; 22 | right: 10px; 23 | top : 90px; 24 | } -------------------------------------------------------------------------------- /app/views/visualisations/_containersindex.html.erb: -------------------------------------------------------------------------------- 1 | <% @containers = ::Container.all %> 2 | 3 | 4 | 5 | 6 | 7 | <% @containers.each do |container| %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | <% end %> 15 | 16 |
Name
<%= container.name %><%= link_to 'Export', export_container_path(container, :format => :json) %><%= link_to 'Edit', edit_container_path(container), :remote => true %><%= link_to 'Destroy', container, :method => :delete, :data => { :confirm => 'Are you sure?' } %>
17 | 18 | -------------------------------------------------------------------------------- /app/controllers/openstack/routers_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::RoutersController < ApplicationController 2 | def index 3 | json_respond networking().routers() 4 | end 5 | 6 | def create 7 | json_respond networking().create_router(params[:name]) 8 | end 9 | 10 | def show 11 | end 12 | 13 | def destroy 14 | quan = networking() 15 | quan.ports()["ports"].each do |port| 16 | if port["device_id"] == params[:id] 17 | quan.delete_router_interface(params[:id], port["id"], 'port') 18 | end 19 | end 20 | json_respond quan.delete_router(params[:id]) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | # 12 | # These inflection rules are supported but not enabled by default: 13 | # ActiveSupport::Inflector.inflections do |inflect| 14 | # inflect.acronym 'RESTful' 15 | # end 16 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require form 13 | */ 14 | -------------------------------------------------------------------------------- /app/controllers/openstack/floating_ips_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::FloatingIpsController < ApplicationController 2 | def index 3 | json_respond networking().floating_ips() 4 | end 5 | 6 | def create 7 | json_respond networking().create_floating_ip(params[:network]) 8 | end 9 | 10 | def show 11 | end 12 | 13 | def update 14 | port = params[:port_id] 15 | if port == "null" 16 | port = nil 17 | end 18 | json_respond networking().update_floating_ip(params[:id], port) 19 | end 20 | 21 | def destroy 22 | json_respond networking().delete_floating_ip(params[:id]) 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Cisco Systems Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/tools_tabs.css: -------------------------------------------------------------------------------- 1 | /* =============================================================== */ 2 | /* = Tool Tabs = */ 3 | /* =============================================================== */ 4 | .toolTabsCSS { 5 | position: absolute; 6 | width: 443px; 7 | height: 30px; 8 | margin-top: 33px; 9 | margin-left: 20px; 10 | text-align: center; 11 | cursor: default; 12 | background: transparent; 13 | border: none; 14 | } 15 | 16 | #t { 17 | display: none; 18 | width: 0px; 19 | height: 0px; 20 | } 21 | 22 | #t .ui-widget-content { 23 | display: none; 24 | } -------------------------------------------------------------------------------- /lib/tasks/documentation.rake: -------------------------------------------------------------------------------- 1 | Rake::Task["doc:app"].clear 2 | Rake::Task["doc/app"].clear 3 | Rake::Task["doc/app/index.html"].clear 4 | 5 | namespace :doc do 6 | RDocTaskWithoutDescriptions.new("app") { |rdoc| 7 | rdoc.rdoc_dir = 'doc/app' 8 | rdoc.template = ENV['template'] if ENV['template'] 9 | rdoc.title = ENV['title'] || "Rails Application Documentation" 10 | rdoc.options << '--line-numbers' 11 | rdoc.options << '--charset' << 'utf-8' 12 | rdoc.options << '--all' 13 | rdoc.rdoc_files.include('doc/README_FOR_APP') 14 | rdoc.rdoc_files.include('app/**/*.rb') 15 | rdoc.rdoc_files.include('lib/**/*.rb') 16 | } 17 | end 18 | -------------------------------------------------------------------------------- /app/controllers/openstack/keypairs_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::KeypairsController < ApplicationController 2 | def index 3 | json_respond compute().keypairs() 4 | end 5 | 6 | def create 7 | keypair = compute().create_keypair(params[:name]) 8 | sesh params[:name].to_sym, keypair['keypair']['private_key'] 9 | json_respond keypair 10 | end 11 | 12 | def show 13 | json_respond compute().keypairs(params[:id]) 14 | end 15 | 16 | def destroy 17 | json_respond compute().delete_keypair(params[:id]) 18 | end 19 | 20 | def download 21 | send_data (sesh params[:id].to_sym), :filename => "#{params[:id]}.pem" 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/controllers/openstack/networks_controller.rb: -------------------------------------------------------------------------------- 1 | # Networks Controller 2 | class Openstack::NetworksController < ApplicationController 3 | def index 4 | json_respond networking().networks() 5 | end 6 | 7 | def create 8 | json_respond networking().create_network(params[:name], (sesh :current_tenant)) 9 | end 10 | 11 | def show 12 | end 13 | 14 | def destroy 15 | quan = networking() 16 | ports = quan.ports() 17 | ports["ports"].each do |port| 18 | if port["status"] == "DOWN" and port['network_id'] == params[:id] 19 | quan.delete_port(port["id"]) 20 | end 21 | end 22 | json_respond quan.delete_network(params[:id]) 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/network_tabs.css: -------------------------------------------------------------------------------- 1 | /* ==================================================================== */ 2 | /* = Network Tabs = */ 3 | /* ==================================================================== */ 4 | #graphTabs li .tab-button { 5 | float: left; 6 | padding: 0.40em 0.1em; 7 | padding-bottom: 0.45em; 8 | color: #555555; 9 | cursor: pointer; 10 | border: solid 1px transparent; 11 | } 12 | 13 | #graphTabs li .tab-button-far-right { 14 | border-top-right-radius: 4px; 15 | } 16 | 17 | #graphTabs li .tab-button:hover { 18 | background-color: #E2F0F8; 19 | border: solid 1px transparent; 20 | } 21 | 22 | #graphTabs li .toggled { 23 | background-color: #C4D3DB; 24 | border: solid 1px #C4D3DB; 25 | } -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // the compiled file. 9 | // 10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 11 | // GO AFTER THE REQUIRES BELOW. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | 16 | 17 | // Scopes for coffee classes 18 | window.App = {} 19 | window.Nodes = {} 20 | window.D3 = {} -------------------------------------------------------------------------------- /app/views/visualisations/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for(@container, :remote => true) do |t| %> 2 | <% if @container.errors.any? %> 3 |
4 |

<%= pluralize(@container.errors.count, "error") %> prohibited this container from being saved:

5 | 6 | 11 |
12 | <% end %> 13 | 14 |
15 | <%= t.label "Provide a name for this container:" %>
16 | <%= t.text_field :name %> 17 |
18 |
19 | <%= t.label "Paste the container below:" %>
20 | <%= t.text_area :body %> 21 |
22 |
23 | <%= t.submit %> 24 |
25 | <% end %> 26 | -------------------------------------------------------------------------------- /app/controllers/setups_controller.rb: -------------------------------------------------------------------------------- 1 | class SetupsController < ApplicationController 2 | before_filter :verify_config 3 | 4 | def verify_config 5 | if(APP_CONFIG.has_key?("identity")) 6 | raise ActionController::RoutingError.new('Not Found') 7 | end 8 | end 9 | 10 | def show 11 | #Show form and stuff. 12 | end 13 | 14 | def create 15 | @ip = params[:ipaddr] 16 | @port = params[:port] 17 | config = render_to_string "curvature.yml", :layout => false 18 | File.open("config/curvature.yml", "w") { |file| 19 | file.write(config) 20 | } 21 | APP_CONFIG['identity'] = {} 22 | APP_CONFIG['identity']['ip'] = "http://" + @ip 23 | APP_CONFIG['identity']['port'] = @port 24 | redirect_to login_url, :notice => "Curvature Keystone Config Completed!" 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

Maybe you tried to change something you didn't have access to.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

You may have mistyped the address or the page may have moved.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Curvature Keystone Login 5 | 6 | 7 | 8 | 9 | 10 | <%= stylesheet_link_tag "application", :media => "all" %> 11 | <%= javascript_include_tag "application" %> 12 | <%= csrf_meta_tags %> 13 | 19 | 20 | 21 | <%= yield %> 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/controllers/openstack/ports_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::PortsController < ApplicationController 2 | def index 3 | json_respond networking().ports() 4 | end 5 | 6 | def create 7 | if params[:device_id].nil? 8 | json_respond networking().create_port(params[:network_id], params[:subnet_id]) 9 | else 10 | json_respond networking().create_port(params[:network_id], params[:subnet_id], params[:device_id], "compute:compute") 11 | end 12 | end 13 | 14 | def move_port 15 | json = params[:subnetList].split(",") 16 | idList = Array.new() 17 | json.each do |subnetID| 18 | idList << { "subnet_id" => subnetID} 19 | end 20 | json_respond networking().update_port(params[:id], idList) 21 | end 22 | 23 | def destroy 24 | json_respond networking().delete_port(params[:id]) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /doc/coffee/mixin_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 |

Mixin List

13 | 19 | 23 | 25 | 26 |
27 | 28 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'rails', '3.2.11' 3 | gem 'sqlite3' 4 | gem 'json' 5 | 6 | # This currently assumes that the intern_incubator repo has also been pulled into the parent directory 7 | # Will be updated when ropenstack is made publicly available 8 | gem 'ropenstack', '2.0.0' 9 | 10 | # Gems used only for assets and not required 11 | # in production environments by default. 12 | group :assets do 13 | gem 'sass-rails', '~> 3.2.3' 14 | gem 'coffee-rails', '~> 3.2.1' 15 | gem 'therubyracer', :platforms => :ruby 16 | gem 'uglifier', '>= 1.0.3' 17 | end 18 | 19 | # For browser detection 20 | gem 'useragent' 21 | 22 | gem 'jquery-rails' 23 | 24 | gem 'socky-authenticator' 25 | 26 | group :development do 27 | # gem 'better_errors' 28 | gem 'binding_of_caller' 29 | end 30 | 31 | # Use unicorn as the app server 32 | gem 'unicorn' 33 | 34 | gem 'thin' 35 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/menubar.css: -------------------------------------------------------------------------------- 1 | /* =============================================================== */ 2 | /* = MenuBar = */ 3 | /* =============================================================== */ 4 | 5 | .Menu{ 6 | display:table-row; 7 | height: 37px; 8 | width: 100%; 9 | } 10 | 11 | .ui-menubar { height: 35px; ;list-style: none; margin: 0; padding-left: 0; } 12 | 13 | .ui-menubar-item { float: left; } 14 | 15 | .ui-menubar .ui-button { float: left; font-weight: normal; border-top-width: 0 !important; border-bottom-width: 0 !important; margin: 0; outline: none; } 16 | .ui-menubar .ui-menubar-link { height: 30px; padding-top: 5px ;border-right: 1px dashed transparent; border-left: 1px dashed transparent; } 17 | 18 | .ui-menubar .ui-menu { width: 200px; position: absolute; z-index: 9999; font-weight: normal; } 19 | -------------------------------------------------------------------------------- /app/views/layouts/setups.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Curvature Keystone Login 5 | 6 | 7 | 8 | 9 | 10 | <%= stylesheet_link_tag "application", :media => "all" %> 11 | <%= javascript_include_tag "application" %> 12 | <%= javascript_include_tag "setups" %> 13 | <%= csrf_meta_tags %> 14 | 20 | 21 | 22 | <%= yield %> 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/subnet.js.coffee: -------------------------------------------------------------------------------- 1 | # Subnet class 2 | # 3 | class Nodes.Subnet extends Nodes.Deployable 4 | # Construct a new Subnet Object 5 | # 6 | # @param data [Object] Data to assign to the new Node 7 | # @param deployStatus [String] Is the node deployed, undeployed or marked for deletion 8 | # 9 | constructor: (data, deployStatus) -> 10 | super(data, "subnet", deployStatus) 11 | 12 | # Deploy a new subnet 13 | # 14 | deploy: -> 15 | rest.postRequest('/openstack/subnets', {network_id:@network_id, cidr:@cidr}, (resp) => 16 | super() 17 | this.setDataFromOpenstackData(resp['subnet']) 18 | ) 19 | 20 | # Terminate a subnet 21 | # 22 | terminate: -> 23 | if @deployStatus is "undeployed" 24 | super() 25 | else 26 | rest.deleteRequest("/openstack/subnets/#{@id}", (resp) => 27 | super() 28 | ) 29 | -------------------------------------------------------------------------------- /app/controllers/donabe/deployed_containers_controller.rb: -------------------------------------------------------------------------------- 1 | class Donabe::DeployedContainersController < ApplicationController 2 | # Get all deployed containers 3 | def index 4 | response = get_request(URI.parse("http://"+(sesh :donabe_ip)+"/"+(sesh :current_tenant)+"/deployed_containers.json"), (sesh :current_token)) 5 | json_respond response.body 6 | end 7 | 8 | # Launch a new container 9 | def create 10 | response = get_request(URI.parse("http://"+(sesh :donabe_ip)+"/"+(sesh :current_tenant)+"/containers/"+params[:containerID].to_s+"/deploy.json"), (sesh :current_token)) 11 | json_respond response.body 12 | end 13 | 14 | # Undeploy a running container 15 | def destroy 16 | response = get_request(URI.parse("http://"+(sesh :donabe_ip)+"/"+(sesh :current_tenant)+"/deployed_containers/"+params[:id].to_s+"/destroy_deployed.json"), (sesh :current_token)) 17 | json_respond response.body 18 | 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/overview_bars.css: -------------------------------------------------------------------------------- 1 | /* ===================================================================== */ 2 | /* = Overview Bars = */ 3 | /* ===================================================================== */ 4 | 5 | #overviewsContainer{ 6 | display:table-row; 7 | background-color: #E1F0F8; 8 | position: relative; 9 | margin: 0; 10 | padding: 0; 11 | text-align: center; 12 | } 13 | 14 | .overviewBarContainer { 15 | position: relative; 16 | height: 40px; 17 | width: 33.333333%; 18 | margin: 0 auto; 19 | border-width: 1px; 20 | /*border-top-style: solid;*/ 21 | border-bottom-style: solid; 22 | border-color: #ACCFEB; 23 | float: left; 24 | } 25 | 26 | .overviewBarLabel { 27 | position: absolute; 28 | top: 50%; 29 | height: 10px; 30 | margin-top: -7px; 31 | font-weight: bold; 32 | color: #2178AC; 33 | left: 35%; 34 | right: 0px; 35 | } 36 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/zoom_slider.css: -------------------------------------------------------------------------------- 1 | /* =================================================================== */ 2 | /* = Zoom Slider = */ 3 | /* =================================================================== */ 4 | #slider { 5 | position: absolute; 6 | right: 0px; 7 | width: 30px; 8 | height: 200px; 9 | margin-top: 60px; 10 | margin-right: 20px; 11 | margin-left: auto; 12 | background-color: #5DB5E8; 13 | cursor: default; 14 | /* Curved Box */ 15 | -webkit-border-radius: 4px; /* Safari prototype */ 16 | -moz-border-radius: 4px; /* Gecko browsers */ 17 | border-radius: 4px; /* Everything else - limited support at the moment */ 18 | -webkit-box-shadow: 0px 0px 2px #000000; 19 | -moz-box-shadow: 0px 0px 2px #000000; 20 | box-shadow: 0px 0px 2px #000000; 21 | } 22 | 23 | #zoomSlider { 24 | height: 180px; 25 | margin: auto; 26 | margin-top: 10px; 27 | } 28 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/deployable.js.coffee: -------------------------------------------------------------------------------- 1 | # Deployable nodes are nodes that can be deployed to openstack 2 | # 3 | class Nodes.Deployable extends Nodes.Node 4 | # deploy action 5 | @DEPLOYED = 1 6 | # terminate action 7 | @TERMINATED = 2 8 | 9 | # Construct a new Deployable node 10 | # 11 | # @param data [Object] Data to assign to the new Node 12 | # @param svg [String] The svg that should be used to represent the new node on the graph 13 | # @param deployStatus [String] Is the node deployed, undeployed or marked for deletion 14 | # 15 | constructor: (data, svg, deployStatus) -> 16 | super(data, svg) 17 | @deployStatus = deployStatus 18 | 19 | # Fire the deploy action 20 | # 21 | deploy: -> 22 | @deployStatus = "deployed" 23 | this.fireAction(Nodes.Deployable.DATA_CHANGED) 24 | 25 | # Fire the terminate action 26 | # 27 | terminate: -> 28 | this.fireAction(Nodes.Deployable.TERMINATED) 29 | -------------------------------------------------------------------------------- /app/controllers/donabe/containers_controller.rb: -------------------------------------------------------------------------------- 1 | class Donabe::ContainersController < ApplicationController 2 | # Get a all container types 3 | def index 4 | response = get_request(URI.parse("http://"+(sesh :donabe_ip)+"/"+(sesh :current_tenant)+"/containers.json"), (sesh :current_token)) 5 | json_respond response.body 6 | end 7 | 8 | # Create a new container 9 | def create 10 | response = post_request(URI.parse("http://"+(sesh :donabe_ip)+"/"+(sesh :current_tenant)+"/containers.json"), params[:container].to_json, (sesh :current_token)) 11 | json_respond response.body 12 | 13 | end 14 | 15 | # Update a container 16 | def update 17 | response = put_request(URI.parse("http://"+(sesh :donabe_ip)+"/"+(sesh :current_tenant)+"/containers/"+params[:id]+".json"), params[:container].to_json, (sesh :current_token)) 18 | json_respond response.body 19 | end 20 | 21 | # Delete a container 22 | def destroy 23 | 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /doc/coffee/extra_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 |

File List

13 | 19 | 23 | 28 |
29 | 30 | -------------------------------------------------------------------------------- /app/views/layouts/visualisations.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Curvature: The Advanced Dashboard 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | <%= stylesheet_link_tag "visualisation", :media => "all" %> 18 | <%= javascript_include_tag "application" %> 19 | <%= javascript_include_tag "visualisation" %> 20 | <%= csrf_meta_tags %> 21 | 22 | 23 | <%= yield %> 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/router.js.coffee: -------------------------------------------------------------------------------- 1 | # Router class 2 | # 3 | class Nodes.Router extends Nodes.Deployable 4 | # Construct a new router object 5 | # 6 | # @param data [Object] Data to assign to the new Node 7 | # @param deployStatus [String] Is the node deployed, undeployed or marked for deletion 8 | # 9 | constructor: (data, deployStatus) -> 10 | data.name = "Router" if not data.name? 11 | if !data.networks? 12 | data.networks = [] 13 | super(data, "router", deployStatus) 14 | 15 | # Deploy a new router to openstack 16 | # 17 | deploy: -> 18 | rest.postRequest('/openstack/routers', {name:@name, gateway:@gateway}, (resp) => 19 | super() 20 | this.setDataFromOpenstackData(resp['router']) 21 | ) 22 | 23 | # Terminate a router 24 | # 25 | terminate: -> 26 | if @deployStatus is "undeployed" 27 | super() 28 | else 29 | rest.deleteRequest("/openstack/routers/#{@id}", (resp) => 30 | super() 31 | ) 32 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended to check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(:version => 20121026202846) do 15 | 16 | create_table "storages", :force => true do |t| 17 | t.text "data" 18 | t.datetime "created_at", :null => false 19 | t.datetime "updated_at", :null => false 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /app/controllers/openstack/images_controller.rb: -------------------------------------------------------------------------------- 1 | ## 2 | # Controller to manage curvatures access to the images stored on openstack 3 | # 4 | class Openstack::ImagesController < ApplicationController 5 | ## 6 | # GET /openstack/images 7 | # Returns all the images accessible to the tenant making the request 8 | # 9 | def index 10 | json_respond compute().images() 11 | end 12 | 13 | ## 14 | # POST /openstack/images 15 | # Create a new image using a file provided by the user making the request 16 | # 17 | def create 18 | json = JSON.parse(params[:json]) 19 | isPublic = "True" 20 | if json["public"] != "true" 21 | isPublic = "False" 22 | end 23 | 24 | json_respond( 25 | image().upload_image_from_file( 26 | json["name"], json["disk_format"], 27 | json["container_format"], json["minDisk"], 28 | json["minRam"], isPublic, params[:image] 29 | ) 30 | ) 31 | end 32 | 33 | ## 34 | # DELETE /openstack/images/:id 35 | # Delete an image given an id 36 | # 37 | def destroy 38 | json_respond compute().delete_image(params[:imageID]) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/network.js.coffee: -------------------------------------------------------------------------------- 1 | # Network class 2 | # 3 | class Nodes.Network extends Nodes.Deployable 4 | # Construct a new Network object 5 | # 6 | # @param data [Object] Data to assign to the new Node 7 | # 8 | constructor: (data, deployStatus) -> 9 | data.name = "Network" if not data.name? 10 | data.collapsed = false 11 | super(data, "network", deployStatus) 12 | 13 | # Call the Network.terminate function on this object 14 | # 15 | terminate: -> 16 | Network.terminate(@id) 17 | 18 | # Create a new network 19 | # 20 | # @param name [String] The name of the new network 21 | # 22 | deploy: -> 23 | if @deployStatus is "undeployed" 24 | rest.postRequest('/openstack/networks', {name:@name}, (resp) => 25 | this.setDataFromOpenstackData(resp['network']) 26 | super() 27 | ) 28 | 29 | # Terminate a network 30 | # 31 | # @param id [String] The UUID of the network to be deleted 32 | # 33 | terminate: -> 34 | if @deployStatus is "undeployed" 35 | super() 36 | else 37 | rest.deleteRequest("/openstack/networks/#{@id}", (resp) => 38 | super() 39 | ) 40 | -------------------------------------------------------------------------------- /app/assets/javascripts/setups.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ 4 | 5 | window.onload = -> 6 | 7 | $("#port").keyup -> 8 | console.log "Port Changed" 9 | 10 | port = document.getElementById("port").value 11 | valid = true 12 | console.log(port) 13 | 14 | for s in port 15 | if !isFinite(s) 16 | valid = false 17 | 18 | if valid 19 | $("#submitBtn").toggle(true) 20 | else 21 | $("#submitBtn").toggle(false) 22 | 23 | return 24 | 25 | $("#ipaddr").keyup -> 26 | console.log "IP address changed" 27 | 28 | validate = document.getElementById("ipaddr").value 29 | 30 | if ValidateIPaddress validate 31 | $("#submitBtn").toggle(true) 32 | else 33 | $("#submitBtn").toggle(false) 34 | 35 | return 36 | 37 | ValidateIPaddress = (inputText) -> 38 | ipformat = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ 39 | if inputText.match(ipformat) 40 | true 41 | else 42 | false 43 | -------------------------------------------------------------------------------- /app/controllers/openstack/servers_controller.rb: -------------------------------------------------------------------------------- 1 | class Openstack::ServersController < ApplicationController 2 | def index 3 | json_respond compute().servers_detailed() 4 | end 5 | 6 | def create 7 | logger.info params[:nics] 8 | json_respond compute().create_server(params[:name], params[:image_ref], params[:flavor], params[:nics], params[:key_name], params[:security_group]) 9 | end 10 | 11 | def show 12 | json_respond compute().servers(params[:id]) 13 | end 14 | 15 | def action 16 | action = params[:server][:action] 17 | case action 18 | when "vnc","pause","unpause","reboot","suspend","resume","start","stop" 19 | json_respond compute().action(params[:id], action) 20 | when "snapshot" 21 | data = {'name' => params[:imageName], 'metadata' => params[:metadata]} 22 | json_respond compute().action(params[:id], 'create_image', data) 23 | else 24 | raise "Invalid server action!" 25 | end 26 | end 27 | 28 | def quotas 29 | json_respond compute().limits() 30 | end 31 | 32 | def attach_volume 33 | json_respond compute().attach_volume(params[:id], params[:volume_id]) 34 | end 35 | 36 | def detach_volume 37 | json_respond compute().detach_volume(params[:id], params[:attachment_id]) 38 | end 39 | 40 | def destroy 41 | json_respond compute().delete_server(params[:id]) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /app/assets/stylesheets/visualisation/curvature.css: -------------------------------------------------------------------------------- 1 | /* ===================================================================================== */ 2 | /* = General Structure of Page CSS = */ 3 | /* ===================================================================================== */ 4 | html, body { 5 | min-width: 350px; 6 | margin: 0; 7 | padding: 0; 8 | height:100%; 9 | overflow: hidden; 10 | visibility: hidden; 11 | font-size: 9pt; 12 | font-family:Arial, Helvetica, sans-serif; 13 | color: #888888; 14 | text-align: left; 15 | } 16 | 17 | .wrap { /* Wrap for menu and graph containers */ 18 | height:100%; 19 | width: 100%; 20 | display: table; 21 | } 22 | 23 | /* Footer Used to determine d3 height*/ 24 | .Footer{ 25 | height: 39px; 26 | display:table-row; 27 | background-color: #AFEEEE; 28 | } 29 | 30 | .rightTab { /* Keep a tab to the right */ 31 | float:right!important; 32 | } 33 | .rightTab label { 34 | float: left; 35 | padding-right: 10px; 36 | padding-top: 8px; 37 | font-size: 12pt; 38 | font-weight: normal; 39 | font-family:Arial, Helvetica, sans-serif; 40 | } 41 | 42 | /* Help image */ 43 | #controlsOverlay { 44 | position: absolute; 45 | margin-top: 50px; 46 | left:50%; 47 | margin-left:-280px; 48 | visibility: hidden; 49 | } 50 | 51 | #ciscologo { 52 | position: absolute; 53 | right: 10px; 54 | bottom: 10px; 55 | width: 110px; 56 | height: 60px; 57 | } 58 | -------------------------------------------------------------------------------- /app/views/visualisations/_menubar.html.erb: -------------------------------------------------------------------------------- 1 | 42 | -------------------------------------------------------------------------------- /app/views/logins/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

Log In

6 | 7 | <% if flash[:error] %> 8 |

<%= flash[:error] %>

9 | <% end %> 10 | 11 | <% if flash[:notice] %> 12 |

<%= flash[:notice] %>

13 | <% end %> 14 | 15 | <% if flash[:unsupported] %> 16 |

<%= flash[:unsupported] %>

17 | <% if @unsupported %> 18 |

Please upgrade to a modern browser for the best experience.

19 | <% end %> 20 | <% end %> 21 | 22 | <%= form_tag(:controller => "logins", :action => "create") do %> 23 |
24 | <%= label_tag(:username) %> 25 | <%= text_field_tag(:username) %> 26 |
27 |
28 | <%= label_tag(:password) %>
29 | <%= password_field_tag(:password) %> 30 |
31 |
32 | <%= submit_tag "Login" , :class => "button blue" %> 33 |
34 | <% end %> 35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Server::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger 20 | config.active_support.deprecation = :log 21 | 22 | # Only use best-standards-support built into browsers 23 | config.action_dispatch.best_standards_support = :builtin 24 | 25 | # Raise exception on mass assignment protection for Active Record models 26 | config.active_record.mass_assignment_sanitizer = :strict 27 | 28 | # Log the query plan for queries taking more than this (works 29 | # with SQLite, MySQL, and PostgreSQL) 30 | config.active_record.auto_explain_threshold_in_seconds = 0.5 31 | 32 | # Do not compress assets 33 | config.assets.compress = false 34 | 35 | # Always compiled assets live. 36 | config.assets.compile = true 37 | 38 | # Expands the lines which load the assets 39 | config.assets.debug = true 40 | end 41 | -------------------------------------------------------------------------------- /app/views/setups/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

Setup

6 | 7 | <% if flash[:error] %> 8 |

<%= flash[:error] %>

9 | <% end %> 10 | 11 | <% if flash[:notice] %> 12 |

<%= flash[:notice] %>

13 | <% end %> 14 | 15 | <% if flash[:unsupported] %> 16 |

<%= flash[:unsupported] %>

17 | <% if @unsupported %> 18 |

Please upgrade to a modern browser for the best experience.

19 | <% end %> 20 | <% end %> 21 | 22 | <%= form_tag(:controller => "setups", :action => "create") do %> 23 |
24 | <%= label_tag("IP Address of Keystone") %>
25 | <%= text_field_tag(:ipaddr, "127.0.0.1") %> 26 |

27 |
28 | <%= label_tag("Port Keystone is running on") %>
29 | <%= text_field_tag(:port, "5000") %> 30 |
31 |
32 | <%= submit_tag "Finish Setup" , :class => "button blue" , :id => "submitBtn" %> 33 |
34 | <% end %> 35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /doc/coffee/file_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 |

File List

13 | 19 | 23 | 51 | 52 |
53 | 54 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Server::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Configure static asset server for tests with Cache-Control for performance 11 | config.serve_static_assets = true 12 | config.static_cache_control = "public, max-age=3600" 13 | 14 | # Log error messages when you accidentally call methods on nil 15 | config.whiny_nils = true 16 | 17 | # Show full error reports and disable caching 18 | config.consider_all_requests_local = true 19 | config.action_controller.perform_caching = false 20 | 21 | # Raise exceptions instead of rendering exception containers 22 | config.action_dispatch.show_exceptions = false 23 | 24 | # Disable request forgery protection in test environment 25 | config.action_controller.allow_forgery_protection = false 26 | 27 | # Tell Action Mailer not to deliver emails to the real world. 28 | # The :test delivery method accumulates sent emails in the 29 | # ActionMailer::Base.deliveries array. 30 | config.action_mailer.delivery_method = :test 31 | 32 | # Raise exception on mass assignment protection for Active Record models 33 | config.active_record.mass_assignment_sanitizer = :strict 34 | 35 | # Print deprecation notices to the stderr 36 | config.active_support.deprecation = :stderr 37 | end 38 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/node.js.coffee: -------------------------------------------------------------------------------- 1 | # Base class for all openstack data objects 2 | # 3 | # @example How to subclass a node 4 | # class Network extends App.Node 5 | # 6 | class Nodes.Node 7 | # Data changed action 8 | @DATA_CHANGED = 0 9 | 10 | # Construct a new Node Object 11 | # 12 | # @param data [Object] Data to assign to the new Node 13 | # @param svg [String] The svg that should be used to represent the new node on the graph 14 | # 15 | constructor: (data, svg) -> 16 | @svg = svg 17 | this.setDataFromOpenstackData(data, false) 18 | @actionListeners = [] 19 | 20 | # Add an action listener to the Node 21 | # 22 | # @param aL [Object] the action listener 23 | # 24 | addActionListener: (aL) -> 25 | unless @actionListeners.indexOf(aL) >= 0 26 | @actionListeners.push(aL) 27 | 28 | # Remove an action listener from Node 29 | # 30 | # @param aL [Object] the action listener 31 | # 32 | removeActionListener: (aL) -> 33 | @actionListeners.splice(@actionListners.indexOf(aL), 1) 34 | 35 | # Fire an action 36 | # 37 | # @param action [Int] The action to be fired 38 | # 39 | fireAction: (action) -> 40 | for aL in @actionListeners 41 | aL.nodeActionFired(this, action) 42 | 43 | # Extract the data from the json passed, 44 | # fire nodeDataChange event 45 | # 46 | # @param data [Object] Data to assign to the new Node 47 | # @param throwEvent [Boolean] Whether or not to throw a nodeDataChange Event, defaults => true 48 | # 49 | setDataFromOpenstackData: (data, throwEvent = true) -> 50 | for key in Object.keys(data) 51 | this[key] = data[key] 52 | if throwEvent 53 | this.fireAction(Nodes.Node.DATA_CHANGED) -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/D3/quota.js.coffee: -------------------------------------------------------------------------------- 1 | class D3.Quota 2 | w: 50 3 | h: 40 4 | r:17 5 | bkgrnd: "#F2F2F2" 6 | frgrnd: "#4790B2" 7 | 8 | constructor: (divid) -> 9 | self = @ 10 | used = $("#"+divid).data().used 11 | data = [{percentage:used},{percentage:100 - used}] 12 | 13 | self.vis = d3.select("#"+divid).append("svg") 14 | .attr("class","piechart") 15 | .attr("width", @w) 16 | .attr("height", @h) 17 | .style("background-color", " #E1F0F8") 18 | .append("g") 19 | .attr("transform", "translate(#{@r + 2},#{@r + 2})") 20 | 21 | self.arc = d3.svg.arc() 22 | .outerRadius(@r) 23 | .innerRadius(0) 24 | 25 | self.pie = d3.layout.pie() 26 | .sort(null) 27 | .value((d) -> d.percentage ) 28 | 29 | piechart = self.vis.selectAll(".arc") 30 | .data(self.pie([{percentage:100}])) 31 | .enter() 32 | .append("path") 33 | .attr("class", "arc") 34 | .attr("d", self.arc) 35 | .style("fill", self.frgrnd) 36 | .style("stroke", "#CCCCCC") 37 | .style("stroke-width", 1) 38 | .each( (d) -> self.current = d ) 39 | 40 | piechart = self.vis.selectAll(".arc") 41 | .data(self.pie(data)) 42 | .enter() 43 | .append("path") 44 | .attr("class", "arc") 45 | .attr("d", self.arc) 46 | .style("fill", self.bkgrnd) 47 | .style("stroke", "#CCCCCC") 48 | .style("stroke-width", 1) 49 | .each( (d) -> self.current = d ) 50 | .transition() 51 | .duration(500) 52 | .attrTween("d", (a) -> 53 | tween = d3.interpolate(self.current, a) 54 | self.current = tween(0) 55 | (t) -> 56 | self.arc tween(t) 57 | ) 58 | 59 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Server::Application.routes.draw do 2 | resource :visualisation, :only => :show 3 | 4 | resource :setup, :only => [:show, :create] 5 | 6 | namespace :network_designs do 7 | end 8 | 9 | namespace :donabe do 10 | resources :containers 11 | resources :deployed_containers 12 | end 13 | #resources :network_designs do 14 | #resources :types 15 | #resources :vms do 16 | # resources :connected_subnets 17 | #end 18 | #resources :routers 19 | #resources :subnets do 20 | # resources :connected_routers 21 | #end 22 | #end 23 | 24 | resource :login, :only => [:show, :create] do 25 | collection do 26 | post 'switch' 27 | get 'tenants', 'current', 'services' 28 | end 29 | end 30 | match '/logout' => 'logins#destroy', :via => :get 31 | 32 | namespace :openstack do 33 | resources :servers, :except => [:new, :edit, :update] do 34 | get 'quotas', :on => :collection 35 | post 'action', 'attach_volume', 'detach_volume', :on => :member 36 | end 37 | 38 | resources :security_groups do 39 | resources :rules, :only => [:create, :destroy] 40 | end 41 | 42 | resources :routers, :only => [:index, :create, :destroy] do 43 | resources :router_interfaces, :only => [:create, :destroy] 44 | resource :router_gateway, :only => [:create, :destroy] 45 | end 46 | 47 | resources :ports, :only => [:index, :create, :destroy] do 48 | post 'move_port', :on => :member 49 | end 50 | 51 | resources :keypairs do 52 | get 'download', :on => :member 53 | end 54 | resources :floating_ips 55 | resources :networks, :subnets, :images, :only => [:index, :create, :destroy] 56 | resources :flavors, :volumes, :only => :index 57 | end 58 | 59 | root :to => 'logins#show' 60 | end 61 | -------------------------------------------------------------------------------- /public/README.md: -------------------------------------------------------------------------------- 1 | # Directory Structure For Javascript side 2 | 3 | ## /Visualisation 4 | - *keyboard.js*, keyboard events handlers for shortcuts 5 | - *page.js*, executed on page load, used to setup networks, tenants and initiate JQueryUI Objects 6 | - *Rest.js*, startup rest calls. Stores global lists with current OpenStack state for later access. 7 | 8 | ## /Visualisation/Graph 9 | - *d3-graph.js*, all of the D3 initialisation and code to actually draw changes to the graph 10 | - *deploy.js*, file executed when the Deploy button is hit. Daisy chained asynchronous calls. 11 | - *graphinteractions.js*, all code that involves interacting or editing the state of the D3 graphs (adding nodes/links, removing nodes, color changes etc.) 12 | - *popups.js*, code for various popups used to set node details 13 | - *svg.js*, some paths we use for drawing certain elements within D3 14 | - *containers.js*, all logic for saving and retrieving containers 15 | - *views.js*, code which will change what data D3 is displaying (changing networks) 16 | 17 | ## /Visualisation/Libraries 18 | - *d3.v2.min.js*, D3 Library used for the graph 19 | - *fisheye.js*, Extension to D3 to allow a fisheye zoom over the graph 20 | - *jquery-1.8.0.min.js* 21 | - *jquery-ui-1.9.1.custom.min.js*, UI elements from JQueryUI depends on theme files in /Visualisation/css/smoothness 22 | 23 | 24 | ## /Visualisation/Rest 25 | - *basicRest.js*, container request functions and error handlers 26 | - *createRest.js*, rest calls related to the creation of new objects 27 | - *getRest.js*, calls for getting the current state of OpenStack 28 | - *manipulation.js*, anything that changes the state of OpenStack but doesn't create anything, moving ports etc. 29 | - *polling.js*, anything that polls OpenStack waiting for a specific action to happen 30 | - *containersRest.js*, all the calls to the rails server so store and retrieve containers. 31 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/App/rest.js.coffee: -------------------------------------------------------------------------------- 1 | # The Rest helper 2 | # 3 | @rest = 4 | postRequest: (url, data, callback) -> 5 | jQuery.ajax( 6 | url: url, 7 | type: 'post', 8 | contentType: 'application/json; charset=utf-8', 9 | data: JSON.stringify(data), 10 | success: (resp) => 11 | callback(resp) 12 | error: (resp) => 13 | @errorHandler(resp) 14 | ) 15 | 16 | putRequest: (url, data, callback) -> 17 | jQuery.ajax( 18 | url: url, 19 | type: 'put', 20 | contentType: 'application/json; charset=utf-8', 21 | data: JSON.stringify(data), 22 | success: (resp) => 23 | callback(resp) 24 | error: (resp) => 25 | @errorHandler(resp) 26 | ) 27 | 28 | putRequest: (url, data, callback) -> 29 | jQuery.ajax( 30 | url: url, 31 | type: 'put', 32 | contentType: 'application/json; charset=utf-8', 33 | data: JSON.stringify(data), 34 | success: (resp) => 35 | callback(resp) 36 | error: (resp) => 37 | @errorHandler(resp) 38 | ) 39 | 40 | getRequest: (url, callback) -> 41 | jQuery.ajax( 42 | url: url, 43 | type: 'get' 44 | contentType: 'application/json; charset=utf-8', 45 | success: (resp) => 46 | callback(resp) 47 | error: (resp) => 48 | @errorHandler(resp) 49 | ) 50 | 51 | deleteRequest: (url, callback) -> 52 | jQuery.ajax( 53 | url: url, 54 | type: 'delete' 55 | contentType: 'application/json; charset=utf-8', 56 | success: (resp) => 57 | callback(resp) 58 | error: (resp) => 59 | @errorHandler(resp) 60 | ) 61 | 62 | errorHandler: (response) -> 63 | switch response.status 64 | when 401 65 | window.location = '/logout' 66 | when 0 then #DO NOTHING! 67 | else 68 | alert(response.responseText) 69 | -------------------------------------------------------------------------------- /app/views/visualisations/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'menubar' %> 3 |
4 |
5 |
Instances Used
6 |
7 |
8 |
CPUs Used
9 |
10 |
11 |
RAM Used
12 |
13 |
14 | 15 |
16 |
17 | 18 |
19 | 29 | 30 |
31 | 32 | 33 | 34 |
35 | 36 |
37 | 38 |
39 |
40 | 41 |
42 | 43 | <%= render 'popups' %> 44 | -------------------------------------------------------------------------------- /doc/app/created.rid: -------------------------------------------------------------------------------- 1 | Tue, 05 Mar 2013 13:16:03 -0800 2 | doc/README_FOR_APP Fri, 01 Mar 2013 12:56:09 -0800 3 | app/controllers/application_controller.rb Mon, 04 Mar 2013 22:46:34 -0800 4 | app/controllers/donabe/containers_controller.rb Mon, 04 Mar 2013 22:13:21 -0800 5 | app/controllers/donabe/deployed_containers_controller.rb Mon, 04 Mar 2013 22:12:44 -0800 6 | app/controllers/logins_controller.rb Mon, 25 Feb 2013 15:49:29 -0800 7 | app/controllers/network_designs_controller.rb Mon, 25 Feb 2013 15:49:29 -0800 8 | app/controllers/openstack.rb Mon, 04 Mar 2013 23:02:20 -0800 9 | app/controllers/openstack/flavors_controller.rb Mon, 04 Mar 2013 22:48:27 -0800 10 | app/controllers/openstack/images_controller.rb Mon, 04 Mar 2013 22:55:55 -0800 11 | app/controllers/openstack/networks_controller.rb Mon, 04 Mar 2013 13:12:27 -0800 12 | app/controllers/openstack/ports_controller.rb Mon, 04 Mar 2013 13:12:40 -0800 13 | app/controllers/openstack/router_gateways_controller.rb Mon, 04 Mar 2013 13:12:54 -0800 14 | app/controllers/openstack/router_interfaces_controller.rb Mon, 04 Mar 2013 13:13:07 -0800 15 | app/controllers/openstack/routers_controller.rb Mon, 04 Mar 2013 13:13:21 -0800 16 | app/controllers/openstack/servers_controller.rb Mon, 04 Mar 2013 13:50:35 -0800 17 | app/controllers/openstack/subnets_controller.rb Mon, 04 Mar 2013 13:13:43 -0800 18 | app/controllers/openstack/volumes_controller.rb Mon, 04 Mar 2013 13:13:54 -0800 19 | app/controllers/visualisations_controller.rb Mon, 04 Mar 2013 18:04:17 -0800 20 | app/helpers/application_helper.rb Mon, 25 Feb 2013 15:49:29 -0800 21 | app/models/connected_router.rb Mon, 25 Feb 2013 15:49:29 -0800 22 | app/models/connected_subnet.rb Mon, 25 Feb 2013 15:49:29 -0800 23 | app/models/flavor.rb Mon, 25 Feb 2013 15:49:29 -0800 24 | app/models/image.rb Mon, 25 Feb 2013 15:49:29 -0800 25 | app/models/network_design.rb Mon, 25 Feb 2013 15:49:29 -0800 26 | app/models/router.rb Mon, 25 Feb 2013 15:49:29 -0800 27 | app/models/storage.rb Mon, 25 Feb 2013 15:49:29 -0800 28 | app/models/subnet.rb Mon, 25 Feb 2013 15:49:29 -0800 29 | app/models/type.rb Mon, 25 Feb 2013 15:49:29 -0800 30 | app/models/vm.rb Mon, 25 Feb 2013 15:49:29 -0800 31 | -------------------------------------------------------------------------------- /Running Curvature in Production.md: -------------------------------------------------------------------------------- 1 | Installing Curvature in Production 2 | ================================== 3 | 4 | 5 | Precompile the Assets 6 | --------------------- 7 | Precompile all the static assets to prevent rails compiling them on every request. 8 | 9 | rake assets:precompile:all 10 | 11 | 12 | Setup Apache 13 | ------------ 14 | Install apache modules: 15 | 16 | sudo a2enmod proxy 17 | sudo a2enmod proxy_balancer 18 | sudo a2enmod proxy_http 19 | sudo a2enmod rewrite 20 | 21 | Create an Apache Virtual Host, this configuration will use Apache to serve all the static files, and unicorn for all the non-static application work. 22 | 23 | 24 | ServerName domain.com 25 | ServerAlias www.domain.com 26 | 27 | # Point at curvatures public folder 28 | DocumentRoot /opt/curvature/public 29 | 30 | RewriteEngine On 31 | 32 | 33 | BalancerMember http://127.0.0.1:3000 34 | 35 | 36 | # Redirect all non-static requests to unicorn. 37 | RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 38 | RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L] 39 | 40 | ProxyPassReverse / balancer://unicornservers/ 41 | ProxyPreserveHost on 42 | 43 | 44 | Order deny,allow 45 | Allow from all 46 | 47 | 48 | # Custom log file locations 49 | ErrorLog /opt/curvature/log/error.log 50 | CustomLog /opt/curvature/log/access.log combined 51 | 52 | 53 | 54 | After setting up virtual hosts remember to restart apache. 55 | 56 | Starting Unicorn 57 | ---------------- 58 | Start the unicorn application server. 59 | 60 | bundle exec unicorn -p 3000 -E production 61 | 62 | 63 | Test Application Server 64 | ----------------------- 65 | You can test if unicorn is working correctly by accessing http://localhost:3000 on the machine that Curvature is running on. 66 | 67 | 68 | Test Apache Proxying 69 | -------------------- 70 | Accessing this machine in a browser should now proxy the application, and you should see curvature without having a port number. 71 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/fisheye.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | d3.fisheye = { 3 | scale: function(scaleType) { 4 | return d3_fisheye_scale(scaleType(), 3, 0); 5 | }, 6 | circular: function() { 7 | var radius = 200, 8 | distortion = 2, 9 | k0, 10 | k1, 11 | focus = [0, 0]; 12 | 13 | function fisheye(d) { 14 | var dx = d.x - focus[0], 15 | dy = d.y - focus[1], 16 | dd = Math.sqrt(dx * dx + dy * dy); 17 | if (!dd || dd >= radius) return {x: d.x, y: d.y, z: 1}; 18 | var k = k0 * (1 - Math.exp(-dd * k1)) / dd * .75 + .25; 19 | return {x: focus[0] + dx * k, y: focus[1] + dy * k, z: Math.min(k, 10)}; 20 | } 21 | 22 | function rescale() { 23 | k0 = Math.exp(distortion); 24 | k0 = k0 / (k0 - 1) * radius; 25 | k1 = distortion / radius; 26 | return fisheye; 27 | } 28 | 29 | fisheye.radius = function(_) { 30 | if (!arguments.length) return radius; 31 | radius = +_; 32 | return rescale(); 33 | }; 34 | 35 | fisheye.distortion = function(_) { 36 | if (!arguments.length) return distortion; 37 | distortion = +_; 38 | return rescale(); 39 | }; 40 | 41 | fisheye.focus = function(_) { 42 | if (!arguments.length) return focus; 43 | focus = _; 44 | return fisheye; 45 | }; 46 | 47 | return rescale(); 48 | } 49 | }; 50 | 51 | function d3_fisheye_scale(scale, d, a) { 52 | 53 | function fisheye(_) { 54 | var x = scale(_), 55 | left = x < a, 56 | range = d3.extent(scale.range()), 57 | min = range[0], 58 | max = range[1], 59 | m = left ? a - min : max - a; 60 | if (m == 0) m = max - min; 61 | return (left ? -1 : 1) * m * (d + 1) / (d + (m / Math.abs(x - a))) + a; 62 | } 63 | 64 | fisheye.distortion = function(_) { 65 | if (!arguments.length) return d; 66 | d = +_; 67 | return fisheye; 68 | }; 69 | 70 | fisheye.focus = function(_) { 71 | if (!arguments.length) return a; 72 | a = +_; 73 | return fisheye; 74 | }; 75 | 76 | fisheye.copy = function() { 77 | return d3_fisheye_scale(scale.copy(), d, a); 78 | }; 79 | 80 | fisheye.nice = scale.nice; 81 | fisheye.ticks = scale.ticks; 82 | fisheye.tickFormat = scale.tickFormat; 83 | return d3.rebind(fisheye, scale, "domain", "range"); 84 | } 85 | })(); -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/App/input.js.coffee: -------------------------------------------------------------------------------- 1 | # 2 | # input.js.coffee 3 | # Input from mouse and keyboard handlers 4 | # 5 | 6 | # =================================================================== 7 | # = Mouse Input = 8 | # =================================================================== 9 | # Detect collisions between the mouse(XY) and D3 objects 10 | @mouseX = 0 11 | @mouseY = 0 12 | 13 | # The distance in pixels around a click that nodes will be picked up 14 | CLICK_OFFSET = 20 15 | 16 | # Detect a collision between the mouse and a link between nodes 17 | @linkCollision = -> 18 | # Calculate midpoints for all links 19 | mid = [] 20 | for l of links 21 | mid.push midpoint(l.source.x, l.source.y, l.target.x, l.target.y) 22 | 23 | # Compare midpoints to the mouse position + CLICK_OFFSET 24 | i = 0 25 | while i < mid.length 26 | return d3.selectAll(".link")[0][i] if isCoordInCircle(mid[i].x, mid[i].y, CLICK_OFFSET) 27 | i++ 28 | false 29 | 30 | # Calculate the midpoint of a line given 31 | @midpoint = (x1, y1, x2, y2) -> 32 | x = (x1 + x2) / 2 33 | y = (y1 + y2) / 2 34 | x: x 35 | y: y 36 | 37 | # Check to see if a point is inside a circle (inside the mouse click area) 38 | @isCoordInCircle = (x, y, radius) -> 39 | sqr = (n) -> 40 | n * n 41 | distance = Math.sqrt(sqr(x - mouseX) + sqr(y - mouseY)) 42 | return true if distance <= radius 43 | false 44 | 45 | 46 | # ======================================================================== 47 | # = Keyboard Events = 48 | # ======================================================================== 49 | document.onkeydown = (e) -> 50 | keyPress = event.keyCode 51 | 52 | switch keyPress 53 | # ESC 54 | when 27 55 | # On escape [ESC] press if the links tool is selected clear the current proposed links 56 | #clearTemporary true if document.body.style.cursor is "link" #graphInteractions.js 57 | break 58 | #R 59 | when 82 60 | # On R set the current tool to Remove Tool 61 | break 62 | #M9.99 63 | when 77 64 | # On M set the current tool to the move tool 65 | break 66 | #L 67 | when 76 68 | # On L set the current tool to the link tool 69 | break 70 | #Alt 71 | when 18 72 | $("#controlsOverlay")[0].style.visibility = "visible" 73 | 74 | #return false; // Prevents the default action 75 | document.onkeyup = (e) -> 76 | keyPress = event.keyCode 77 | switch keyPress 78 | #Alt 79 | when 18 80 | $("#controlsOverlay")[0].style.visibility = "hidden" 81 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Server::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # Code is not reloaded between requests 5 | config.cache_classes = true 6 | 7 | # Full error reports are disabled and caching is turned on 8 | config.consider_all_requests_local = false 9 | config.action_controller.perform_caching = true 10 | 11 | # Disable Rails's static asset server (Apache or nginx will already do this) 12 | config.serve_static_assets = false 13 | 14 | # Compress JavaScripts and CSS 15 | config.assets.compress = true 16 | 17 | # Don't fallback to assets pipeline if a precompiled asset is missed 18 | config.assets.compile = false 19 | 20 | # Generate digests for assets URLs 21 | config.assets.digest = true 22 | 23 | # Defaults to nil and saved in location specified by config.assets.prefix 24 | # config.assets.manifest = YOUR_PATH 25 | 26 | # Specifies the header that your server uses for sending files 27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 29 | 30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 31 | # config.force_ssl = true 32 | 33 | # See everything in the log (default is :info) 34 | # config.log_level = :debug 35 | 36 | # Prepend all log lines with the following tags 37 | # config.log_tags = [ :subdomain, :uuid ] 38 | 39 | # Use a different logger for distributed setups 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 41 | 42 | # Use a different cache store in production 43 | # config.cache_store = :mem_cache_store 44 | 45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server 46 | # config.action_controller.asset_host = "http://assets.example.com" 47 | 48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) 49 | # config.assets.precompile += %w( search.js ) 50 | 51 | # Disable delivery errors, bad email addresses will be ignored 52 | # config.action_mailer.raise_delivery_errors = false 53 | 54 | # Enable threaded mode 55 | # config.threadsafe! 56 | 57 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 58 | # the I18n.default_locale when a translation can not be found) 59 | config.i18n.fallbacks = true 60 | 61 | # Send deprecation notices to registered listeners 62 | config.active_support.deprecation = :notify 63 | 64 | # Log the query plan for queries taking more than this (works 65 | # with SQLite, MySQL, and PostgreSQL) 66 | # config.active_record.auto_explain_threshold_in_seconds = 0.5 67 | end 68 | -------------------------------------------------------------------------------- /doc/app/js/search.js: -------------------------------------------------------------------------------- 1 | Search = function(data, input, result) { 2 | this.data = data; 3 | this.$input = $(input); 4 | this.$result = $(result); 5 | 6 | this.$current = null; 7 | this.$view = this.$result.parent(); 8 | this.searcher = new Searcher(data.index); 9 | this.init(); 10 | } 11 | 12 | Search.prototype = $.extend({}, Navigation, new function() { 13 | var suid = 1; 14 | 15 | this.init = function() { 16 | var _this = this; 17 | var observer = function() { 18 | _this.search(_this.$input[0].value); 19 | }; 20 | this.$input.keyup(observer); 21 | this.$input.click(observer); // mac's clear field 22 | 23 | this.searcher.ready(function(results, isLast) { 24 | _this.addResults(results, isLast); 25 | }) 26 | 27 | this.initNavigation(); 28 | this.setNavigationActive(false); 29 | } 30 | 31 | this.search = function(value, selectFirstMatch) { 32 | value = jQuery.trim(value).toLowerCase(); 33 | if (value) { 34 | this.setNavigationActive(true); 35 | } else { 36 | this.setNavigationActive(false); 37 | } 38 | 39 | if (value == '') { 40 | this.lastQuery = value; 41 | this.$result.empty(); 42 | this.setNavigationActive(false); 43 | } else if (value != this.lastQuery) { 44 | this.lastQuery = value; 45 | this.firstRun = true; 46 | this.searcher.find(value); 47 | } 48 | } 49 | 50 | this.addResults = function(results, isLast) { 51 | var target = this.$result.get(0); 52 | if (this.firstRun && (results.length > 0 || isLast)) { 53 | this.$current = null; 54 | this.$result.empty(); 55 | } 56 | 57 | for (var i=0, l = results.length; i < l; i++) { 58 | target.appendChild(this.renderItem.call(this, results[i])); 59 | }; 60 | 61 | if (this.firstRun && results.length > 0) { 62 | this.firstRun = false; 63 | this.$current = $(target.firstChild); 64 | this.$current.addClass('current'); 65 | } 66 | if (jQuery.browser.msie) this.$element[0].className += ''; 67 | } 68 | 69 | this.move = function(isDown) { 70 | if (!this.$current) return; 71 | var $next = this.$current[isDown ? 'next' : 'prev'](); 72 | if ($next.length) { 73 | this.$current.removeClass('current'); 74 | $next.addClass('current'); 75 | this.scrollIntoView($next[0], this.$view[0]); 76 | this.$current = $next; 77 | } 78 | return true; 79 | } 80 | 81 | this.hlt = function(html) { 82 | return this.escapeHTML(html). 83 | replace(/\u0001/g, ''). 84 | replace(/\u0002/g, ''); 85 | } 86 | 87 | this.escapeHTML = function(html) { 88 | return html.replace(/[&<>]/g, function(c) { 89 | return '&#' + c.charCodeAt(0) + ';'; 90 | }); 91 | } 92 | 93 | }); 94 | 95 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | if defined?(Bundler) 6 | # If you precompile assets before deploying to production, use this line 7 | Bundler.require(*Rails.groups(:assets => %w(development test))) 8 | # If you want your assets lazily compiled in production, use this line 9 | # Bundler.require(:default, :assets, Rails.env) 10 | end 11 | 12 | module Server 13 | class Application < Rails::Application 14 | # Settings in config/environments/* take precedence over those specified here. 15 | # Application configuration should go into files in config/initializers 16 | # -- all .rb files in that directory are automatically loaded. 17 | 18 | # Custom directories with classes and modules you want to be autoloadable. 19 | # config.autoload_paths += %W(#{config.root}/extras) 20 | 21 | # Only load the plugins named here, in the order given (default is alphabetical). 22 | # :all can be used as a placeholder for all plugins not explicitly named. 23 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 24 | 25 | # Activate observers that should always be running. 26 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 27 | 28 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 29 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 30 | # config.time_zone = 'Central Time (US & Canada)' 31 | 32 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 33 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 34 | # config.i18n.default_locale = :de 35 | 36 | # Configure the default encoding used in containers for Ruby 1.9. 37 | config.encoding = "utf-8" 38 | 39 | # Configure sensitive parameters which will be filtered from the log file. 40 | config.filter_parameters += [:password] 41 | 42 | # Enable escaping HTML in JSON. 43 | config.active_support.escape_html_entities_in_json = true 44 | 45 | # Use SQL instead of Active Record's schema dumper when creating the database. 46 | # This is necessary if your schema can't be completely dumped by the schema dumper, 47 | # like if you have constraints or database-specific column types 48 | # config.active_record.schema_format = :sql 49 | 50 | # Enforce whitelist mode for mass assignment. 51 | # This will create an empty whitelist of attributes available for mass-assignment for all models 52 | # in your app. As such, your models will need to explicitly whitelist or blacklist accessible 53 | # parameters by using an attr_accessible or attr_protected declaration. 54 | config.active_record.whitelist_attributes = true 55 | 56 | # Enable the asset pipeline 57 | config.assets.enabled = true 58 | 59 | # Version of your assets, change this if you want to expire all your assets 60 | config.assets.version = '1.0' 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /app/assets/stylesheets/form.css: -------------------------------------------------------------------------------- 1 | /* LOGIN */ 2 | .notice { color: green; } 3 | 4 | .error { color: red; } 5 | 6 | #login { 7 | width: 390px; 8 | margin-top:100px; 9 | padding-top:20px; 10 | border: 1px solid; 11 | margin-left: auto; 12 | margin-right: auto; 13 | -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); 14 | -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); 15 | box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); 16 | -webkit-border-radius: 6px; 17 | -moz-border-radius: 6px; 18 | border-radius: 6px; 19 | border: 1px solid #e1e1e1; 20 | } 21 | 22 | #ciscologo { 23 | position: absolute; 24 | right: 10px; 25 | bottom: 10px; 26 | width: 110px; 27 | height: 60px; 28 | } 29 | 30 | h1 { 31 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 32 | text-align: center; 33 | margin: 20px auto; 34 | } 35 | 36 | input { 37 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 38 | border:1px solid #ccc; 39 | font-size:20px; 40 | /*width:300px;*/ 41 | min-height:25px; 42 | display:block; 43 | margin-bottom:10px; 44 | margin-top:5px; 45 | margin: 1px auto; 46 | text-align: center; 47 | 48 | -webkit-border-radius:5px; 49 | -moz-border-radius:5px; 50 | -o-border-radius:5px; 51 | -ms-border-radius:5px; 52 | border-radius:5px; 53 | } 54 | 55 | body { 56 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 57 | text-align: center; 58 | margin: 10px auto; 59 | } 60 | html, body 61 | { 62 | height: 100%; 63 | } 64 | 65 | .actions { 66 | clear: left; 67 | } 68 | 69 | input[type=submit] { 70 | margin-top: 20px; 71 | } 72 | 73 | form { 74 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 75 | margin: 20px auto; 76 | } 77 | 78 | textarea { 79 | resize : vertical; 80 | overflow: auto; 81 | height: 40px; 82 | } 83 | 84 | .button { 85 | display: inline-block; 86 | outline: none; 87 | cursor: pointer; 88 | text-align: center; 89 | text-decoration: none; 90 | /*font: 14px/100% Arial, Helvetica, sans-serif;*/ 91 | padding: .25em 1em .30em; 92 | text-shadow: 0 1px 1px rgba(0,0,0,.3); 93 | -webkit-border-radius: .5em; 94 | -moz-border-radius: .5em; 95 | border-radius: .5em; 96 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2); 97 | -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2); 98 | box-shadow: 0 1px 2px rgba(0,0,0,.2); 99 | } 100 | .button:hover { 101 | text-decoration: none; 102 | } 103 | .button:active { 104 | position: relative; 105 | top: 1px; 106 | } 107 | 108 | /* blue */ 109 | .blue { 110 | color: #d9eef7; 111 | border: solid 1px #0076a3; 112 | background: #0095cd; 113 | background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5)); 114 | background: -moz-linear-gradient(top, #00adee, #0078a5); 115 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5'); 116 | } 117 | .blue:hover { 118 | background: #007ead; 119 | background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e)); 120 | background: -moz-linear-gradient(top, #0095cc, #00678e); 121 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e'); 122 | } 123 | .blue:active { 124 | color: #80bed6; 125 | background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee)); 126 | background: -moz-linear-gradient(top, #0078a5, #00adee); 127 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee'); 128 | } 129 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/App/donabe.js.coffee: -------------------------------------------------------------------------------- 1 | # 2 | # donabe.js.coffee 3 | # 4 | # Donabe Object containing data returned about the current status of Donabe 5 | # 6 | 7 | # Test 8 | App.donabe = 9 | containers: 10 | _data: [] 11 | get: -> @_data 12 | populate: -> 13 | rest.getRequest('/donabe/containers', (resp) => 14 | @_data = [] 15 | for container in resp['containers'] 16 | @_data.push(container) 17 | ) 18 | add: (data) -> 19 | rest.postRequest('/donabe/containers', data, (resp) => 20 | App.donabe.containers.populate() 21 | ) 22 | save: (data, containerid) -> 23 | rest.putRequest('/donabe/containers/'+containerid+'', data, (resp) => 24 | App.donabe.containers.populate() 25 | ) 26 | # rewrite, should create new container specification 27 | deployed_containers: 28 | _data: [] 29 | get: -> @_data 30 | inContainer: (id, containerID) -> 31 | present = false 32 | 33 | if containerID? 34 | # Go through all containers and container elements and see if this id is present 35 | for container in @_data when container.id == containerID 36 | for subContainer in container['containers'] 37 | if subContainer['embedded_container_id'] or subContainer['id']is id 38 | present = true 39 | break 40 | for router in container['routers'] 41 | if router['openstack_id'] is id 42 | present = true 43 | break 44 | for network in container['networks'] 45 | if network['openstack_id'] is id 46 | present = true 47 | break 48 | for server in container['vms'] 49 | if server['openstack_id'] is id 50 | present = true 51 | break 52 | # Go through all containers and container elements and see if this id is present 53 | else 54 | for container in @_data 55 | for subContainer in container['containers'] 56 | if subContainer['embedded_container_id'] or subContainer['id']is id 57 | present = true 58 | break 59 | for router in container['routers'] 60 | if router['openstack_id'] is id 61 | present = true 62 | break 63 | for network in container['networks'] 64 | if network['openstack_id'] is id 65 | present = true 66 | break 67 | for server in container['vms'] 68 | if server['openstack_id'] is id 69 | present = true 70 | break 71 | 72 | present # return present 73 | isEndpoint: (id) -> 74 | isEndpoint = false 75 | 76 | # Go through all containers and container elements and see if this id is present 77 | for container in @_data 78 | for router in container['routers'] 79 | if router['openstack_id'] is id 80 | isEndpoint = router.endpoint 81 | break 82 | for network in container['networks'] 83 | if network['openstack_id'] is id 84 | isEndpoint = network.endpoint 85 | break 86 | for server in container['vms'] 87 | if server['openstack_id'] is id 88 | isEndpoint = server.endpoint 89 | break 90 | 91 | return isEndpoint # return present 92 | 93 | populate: -> 94 | rest.getRequest('/donabe/deployed_containers', (resp) => 95 | @_data = [] 96 | for container in resp['deployed_containers'] 97 | this.add(container) 98 | ) 99 | add: (data) -> 100 | n = new Nodes.Container(data, 'undeployed') 101 | @_data.push(n) 102 | n 103 | endpointsOnGraph: 104 | _data: [] 105 | get: -> @_data 106 | add: (node) -> @_data.push(node) 107 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/container.js.coffee: -------------------------------------------------------------------------------- 1 | # Container Class 2 | # 3 | class Nodes.Container extends Nodes.Deployable 4 | 5 | constructor: (data, deployStatus) -> 6 | 7 | super(data, "container", deployStatus) 8 | 9 | deploy: (deployableLinks)-> 10 | ##CAll super somehwre 11 | promise = new $.Deferred() 12 | 13 | if this.temp_id? 14 | oldTempID = this.temp_id 15 | else 16 | oldTempID = this.id 17 | 18 | if @deployStatus == "undeployed" 19 | rest.postRequest('/donabe/deployed_containers', {containerID: @id}, (resp) => 20 | this.setDataFromOpenstackData(resp['container']) 21 | 22 | $.when( 23 | ##App.donabe.deployed_containers.populate() 24 | App.openstack.networks.populate() 25 | App.openstack.subnets.populate() 26 | App.openstack.ports.populate() 27 | App.openstack.servers.populate() 28 | App.openstack.routers.populate() 29 | ).then(=> 30 | endpoints = App.donabe.endpointsOnGraph.get() 31 | for endpoint in endpoints 32 | if endpoint.inContainerAsEndpoint == oldTempID 33 | for network in resp.container.networks 34 | if endpoint.innerContainerID == network.temp_id 35 | openstackObj = new Nodes.Network(@getOpenStackObject(network.openstack_id, App.openstack.networks.internal.get())) 36 | @addLinks(endpoint, openstackObj, window.curvy.networkVisualisation.links.links,deployableLinks) 37 | for router in resp.container.routers 38 | if endpoint.innerContainerID == router.temp_id 39 | openstackObj = new Nodes.Router(@getOpenStackObject(router.openstack_id, App.openstack.routers.get())) 40 | @addLinks(endpoint, openstackObj, window.curvy.networkVisualisation.links.links,deployableLinks) 41 | for server in resp.container.vms 42 | if endpoint.innerContainerID == server.temp_id 43 | openstackObj = new Nodes.Server(@getOpenStackObject(server.openstack_id, App.openstack.servers.get())) 44 | @addLinks(endpoint, openstackObj, window.curvy.networkVisualisation.links.links,deployableLinks) 45 | super() 46 | promise.resolve() 47 | ) 48 | ) 49 | return promise.promise() 50 | 51 | getOpenStackObject: (id, objectList) -> 52 | for component in objectList 53 | if component.id == id 54 | return component 55 | 56 | addLinks:(endpoint, openstackObj, list, deployableLinks) -> 57 | key = -1 58 | 59 | for link in list 60 | if link.source.data.temp_id == endpoint.temp_id 61 | link.source.data = openstackObj ##TODO this maybe isnt WORKING CHECK IT OUT! 62 | else if link.target.data.temp_id == endpoint.temp_id 63 | link.target.data = openstackObj 64 | 65 | if link.target.data instanceof Nodes.Server 66 | if link.source.data instanceof Nodes.Volume 67 | key = 6 68 | else 69 | key = 2 70 | else if link.target.data instanceof Nodes.Network 71 | if link.source.data instanceof Nodes.Router 72 | key = 0 73 | else 74 | key = 2 75 | else if link.target.data instanceof Nodes.Router 76 | if link.source.data instanceof Nodes.ExternalNetwork 77 | key = 4 78 | else 79 | key = 0 80 | else if link.target.data instanceof Nodes.Volume 81 | key = 6 82 | else if link.target.data instanceof Nodes.ExternalNetwork 83 | if link.source.data instanceof Nodes.Server 84 | key = 2 85 | else 86 | key = 4 87 | 88 | if link.deployStatus == "marked" 89 | deployableLinks[key].push(link) 90 | else if link.deployStatus == "undeployed" 91 | deployableLinks[key+1].push(link) 92 | 93 | terminate: -> 94 | ## find endpoint 95 | ## detach endpoints 96 | ## remove container 97 | if @deployStatus == "marked" 98 | rest.deleteRequest("/donabe/deployed_containers/#{@id}", (resp) => 99 | super() 100 | ) 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /doc/app/js/navigation.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Navigation allows movement using the arrow keys through the search results. 3 | * 4 | * When using this library you will need to set scrollIntoView to the 5 | * appropriate function for your layout. Use scrollInWindow if the container 6 | * is not scrollable and scrollInElement if the container is a separate 7 | * scrolling region. 8 | */ 9 | Navigation = new function() { 10 | this.initNavigation = function() { 11 | var _this = this; 12 | 13 | $(document).keydown(function(e) { 14 | _this.onkeydown(e); 15 | }).keyup(function(e) { 16 | _this.onkeyup(e); 17 | }); 18 | 19 | this.navigationActive = true; 20 | } 21 | 22 | this.setNavigationActive = function(state) { 23 | this.navigationActive = state; 24 | this.clearMoveTimeout(); 25 | } 26 | 27 | this.onkeyup = function(e) { 28 | if (!this.navigationActive) return; 29 | 30 | switch(e.keyCode) { 31 | case 37: //Event.KEY_LEFT: 32 | case 38: //Event.KEY_UP: 33 | case 39: //Event.KEY_RIGHT: 34 | case 40: //Event.KEY_DOWN: 35 | this.clearMoveTimeout(); 36 | break; 37 | } 38 | } 39 | 40 | this.onkeydown = function(e) { 41 | if (!this.navigationActive) return; 42 | switch(e.keyCode) { 43 | case 37: //Event.KEY_LEFT: 44 | if (this.moveLeft()) e.preventDefault(); 45 | break; 46 | case 38: //Event.KEY_UP: 47 | if (e.keyCode == 38 || e.ctrlKey) { 48 | if (this.moveUp()) e.preventDefault(); 49 | this.startMoveTimeout(false); 50 | } 51 | break; 52 | case 39: //Event.KEY_RIGHT: 53 | if (this.moveRight()) e.preventDefault(); 54 | break; 55 | case 40: //Event.KEY_DOWN: 56 | if (e.keyCode == 40 || e.ctrlKey) { 57 | if (this.moveDown()) e.preventDefault(); 58 | this.startMoveTimeout(true); 59 | } 60 | break; 61 | case 13: //Event.KEY_RETURN: 62 | if (this.$current) 63 | e.preventDefault(); 64 | this.select(this.$current); 65 | break; 66 | } 67 | if (e.ctrlKey && e.shiftKey) this.select(this.$current); 68 | } 69 | 70 | this.clearMoveTimeout = function() { 71 | clearTimeout(this.moveTimeout); 72 | this.moveTimeout = null; 73 | } 74 | 75 | this.startMoveTimeout = function(isDown) { 76 | if (!$.browser.mozilla && !$.browser.opera) return; 77 | if (this.moveTimeout) this.clearMoveTimeout(); 78 | var _this = this; 79 | 80 | var go = function() { 81 | if (!_this.moveTimeout) return; 82 | _this[isDown ? 'moveDown' : 'moveUp'](); 83 | _this.moveTimout = setTimeout(go, 100); 84 | } 85 | this.moveTimeout = setTimeout(go, 200); 86 | } 87 | 88 | this.moveRight = function() { 89 | } 90 | 91 | this.moveLeft = function() { 92 | } 93 | 94 | this.move = function(isDown) { 95 | } 96 | 97 | this.moveUp = function() { 98 | return this.move(false); 99 | } 100 | 101 | this.moveDown = function() { 102 | return this.move(true); 103 | } 104 | 105 | /* 106 | * Scrolls to the given element in the scrollable element view. 107 | */ 108 | this.scrollInElement = function(element, view) { 109 | var offset, viewHeight, viewScroll, height; 110 | offset = element.offsetTop; 111 | height = element.offsetHeight; 112 | viewHeight = view.offsetHeight; 113 | viewScroll = view.scrollTop; 114 | 115 | if (offset - viewScroll + height > viewHeight) { 116 | view.scrollTop = offset - viewHeight + height; 117 | } 118 | if (offset < viewScroll) { 119 | view.scrollTop = offset; 120 | } 121 | } 122 | 123 | /* 124 | * Scrolls to the given element in the window. The second argument is 125 | * ignored 126 | */ 127 | this.scrollInWindow = function(element, ignored) { 128 | var offset, viewHeight, viewScroll, height; 129 | offset = element.offsetTop; 130 | height = element.offsetHeight; 131 | viewHeight = window.innerHeight; 132 | viewScroll = window.scrollY; 133 | 134 | if (offset - viewScroll + height > viewHeight) { 135 | window.scrollTo(window.scrollX, offset - viewHeight + height); 136 | } 137 | if (offset < viewScroll) { 138 | window.scrollTo(window.scrollX, offset); 139 | } 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Curvature - JavaScript based Visualization Tool and Dashboard For OpenStack 2 | ========================================================================== 3 | 4 | END OF LIFE 5 | ----------- 6 | 7 | **The logic from the Curvature Visualizations has now been merged into Horizon, 8 | the official OpenStack Dashboard project (https://github.com/openstack/horizon). 9 | Therefore, this repository is no longer maintained and all future development will 10 | happen in the Horizon repository.** 11 | 12 | 13 | 14 | 15 | What is Curvature 16 | ----------------- 17 | 18 | Curvature is an interactive visualization tool and dashboard for 19 | Openstack clouds. It uses javascript and is written using the Rails 20 | framework. It leverages Javascript libraries like D3. 21 | 22 | Installing The Environment 23 | -------------------------- 24 | 25 | In order to install the correct version of ruby (1.9.3) we recommend using RVM simply type into a terminal: 26 | 27 | ``` 28 | curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3 --gems=rails 29 | ``` 30 | 31 | If curl is not installed run: 32 | 33 | ``` 34 | sudo apt-get install curl 35 | ``` 36 | 37 | In order to now use rvm restart your terminal and change your terminal preferences to run command as login shell. If using gnome-terminal in Ubuntu instructions on how to do this can be found here https://rvm.io/integration/gnome-terminal 38 | 39 | If you run into any problems, it is most likely that you need to install the SQLite3 development packages. 40 | 41 | ``` 42 | sudo apt-get install libsqlite3-dev 43 | ``` 44 | 45 | In the curvature directory run: 46 | 47 | ``` 48 | bundle install 49 | ``` 50 | 51 | After buundle has run successfully initialize the databse with: 52 | 53 | ``` 54 | rake db:create 55 | rake db:migrate 56 | ``` 57 | 58 | Running Curvature 59 | ----------------- 60 | 61 | Using a text editor of your choice open /config/curvature.yml 62 | 63 | Replace the OpenStack Keystone IP Address and Port with the location of the Keystone Server in your cluster and save the file. 64 | 65 | To start the server in development mode make sure you are in the curvature root directory and run: 66 | 67 | ``` 68 | rails server 69 | ``` 70 | 71 | By default the service will start on port 3000 but you can customize this with: 72 | 73 | ``` 74 | rail server -p myport 75 | ``` 76 | 77 | Replacing myport th the desired port number. 78 | 79 | You can also run in daemon mode with: 80 | 81 | ``` 82 | rails server -d 83 | ``` 84 | 85 | Logs will be saved to /log/development.log 86 | 87 | 88 | Developer Information 89 | --------------------- 90 | 91 | ### Overview 92 | 93 | The project is built roughly as two distinct components, the Rails server, and our HTML5 frontend. 94 | 95 | The Rails server is responsible for handling all API calls to OpenStack itself, a required step for same-site-security issues. It also stores cookie information for user login, but apart from that the server stores no infomation on the state of OpenStack itself and acts simply as a pass through. 96 | 97 | The HTML5 interface is what you see when loading the system in the browser, it is built with no refreshes in mind preferring instead to Ajax data in on the fly. All deployment logic is built here (waiting for dependencies to go up and keeping track of state), and is built 100% asynchronously. 98 | 99 | ### Directory Structure 100 | 101 | The directory is built like any other Rails project (which you probably know before jumping into this). Areas of particular interest. 102 | 103 | /config 104 | - Contains all configuration files, most importantly curvature.yml and routes.rb 105 | 106 | /app/controllers 107 | - Contains the controllers for handling the REST requests. 108 | - Subdirectory OpenStack encapsulates 109 | 110 | /app/models 111 | - Contains rails model for the cookies named Storages, the file here defines the data structure for the model. 112 | 113 | /app/views 114 | - Contains our HTML page templates for logins and our main page is in the /visualisation directory along with partials for better DRY programming. 115 | 116 | /app/assets 117 | - Contains subdirectories for stylesheets and JavaScript which are acted on my sockets (the asset pipeline) to compile CoffeeScript and SCSS into their true forms. 118 | 119 | /public 120 | - Contains all static elements. In the current state only the error pages exist in here, for example 404.html 121 | 122 | Dependencies 123 | ------------ 124 | 125 | * ropenstack - A ruby Gem which abstracts the OpenStack APIs into an OO form. 126 | * git 127 | * ruby 1.9.3 128 | * rails 129 | * curl 130 | -------------------------------------------------------------------------------- /doc/app/js/darkfish.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Darkfish Page Functions 4 | * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ 5 | * 6 | * Author: Michael Granger 7 | * 8 | */ 9 | 10 | /* Provide console simulation for firebug-less environments */ 11 | if (!("console" in window) || !("firebug" in console)) { 12 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", 13 | "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; 14 | 15 | window.console = {}; 16 | for (var i = 0; i < names.length; ++i) 17 | window.console[names[i]] = function() {}; 18 | }; 19 | 20 | 21 | /** 22 | * Unwrap the first element that matches the given @expr@ from the targets and return them. 23 | */ 24 | $.fn.unwrap = function( expr ) { 25 | return this.each( function() { 26 | $(this).parents( expr ).eq( 0 ).after( this ).remove(); 27 | }); 28 | }; 29 | 30 | 31 | function showSource( e ) { 32 | var target = e.target; 33 | var codeSections = $(target). 34 | parents('.method-detail'). 35 | find('.method-source-code'); 36 | 37 | $(target). 38 | parents('.method-detail'). 39 | find('.method-source-code'). 40 | slideToggle(); 41 | }; 42 | 43 | function hookSourceViews() { 44 | $('.method-heading').click( showSource ); 45 | }; 46 | 47 | function toggleDebuggingSection() { 48 | $('.debugging-section').slideToggle(); 49 | }; 50 | 51 | function hookDebuggingToggle() { 52 | $('#debugging-toggle img').click( toggleDebuggingSection ); 53 | }; 54 | 55 | function hookTableOfContentsToggle() { 56 | $('.indexpage li .toc-toggle').each( function() { 57 | $(this).click( function() { 58 | $(this).toggleClass('open'); 59 | }); 60 | 61 | var section = $(this).next(); 62 | 63 | $(this).click( function() { 64 | section.slideToggle(); 65 | }); 66 | }); 67 | } 68 | 69 | function hookSearch() { 70 | var input = $('#search-field').eq(0); 71 | var result = $('#search-results').eq(0); 72 | $(result).show(); 73 | 74 | var search_section = $('#search-section').get(0); 75 | $(search_section).show(); 76 | 77 | var search = new Search(search_data, input, result); 78 | 79 | search.renderItem = function(result) { 80 | var li = document.createElement('li'); 81 | var html = ''; 82 | 83 | // TODO add relative path to 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 125 | 126 |

This is the API documentation for Rails Application Documentation. 127 | 128 | 129 |

134 | 135 | -------------------------------------------------------------------------------- /doc/coffee/classes/App/Port.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 | 108 |
109 |

110 | Class: 111 | App.Port 112 |

113 | 114 | 115 | 116 | 117 | 118 |
Defined in:app/assets/javascripts/visualisation/Nodes/port.js.coffee
119 |

Overview

120 |
121 |

Port Class

122 |
123 |
124 |
125 |

Instance Method Summary

126 | 139 |

Constructor Details

140 |
141 |
142 |

143 | - (void) constructor(data) 144 |

145 |
146 |

The constructor for a new port

147 |
148 |
149 |

Parameters:

150 |
    151 |
  • 152 | data 153 | 154 | (Object) 155 | 156 | — 157 | The data for the new port 158 |
  • 159 |
160 |
161 |
162 |
163 |
164 | 178 | 179 | -------------------------------------------------------------------------------- /doc/coffee/classes/Nodes/Port.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 | 108 |
109 |

110 | Class: 111 | Nodes.Port 112 |

113 | 114 | 115 | 116 | 117 | 118 |
Defined in:app/assets/javascripts/visualisation/Nodes/port.js.coffee
119 |

Overview

120 |
121 |

Port Class

122 |
123 |
124 |
125 |

Instance Method Summary

126 | 139 |

Constructor Details

140 |
141 |
142 |

143 | - (void) constructor(data) 144 |

145 |
146 |

The constructor for a new port

147 |
148 |
149 |

Parameters:

150 |
    151 |
  • 152 | data 153 | 154 | (Object) 155 | 156 | — 157 | The data for the new port 158 |
  • 159 |
160 |
161 |
162 |
163 |
164 | 178 | 179 | -------------------------------------------------------------------------------- /doc/coffee/files/App/startup.js.coffee.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 | 108 |
109 |

110 | File: 111 | startup.js.coffee 112 |

113 | 114 | 115 | 116 | 117 | 118 |
Defined in:App
119 |

Method Summary

120 | 142 |

Method Details

143 |
144 |
145 |

146 | ? (void) window.onload() 147 |

148 |
149 |

Create a new instance of Curvature and begin to draw the page

150 |
151 |
152 |
153 |
154 |
155 |

156 | + (void) genericDialog(divId) 157 |

158 |
159 |

Set generic Dialog Box

160 |
161 |
162 |
163 |
164 |
165 |
166 | 180 | 181 | -------------------------------------------------------------------------------- /doc/coffee/class_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 |

Class List

13 | 19 | 23 | 169 | 170 |
171 | 172 | -------------------------------------------------------------------------------- /doc/app/doc/README_FOR_APP.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | README_FOR_APP - Rails Application Documentation 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 125 | 126 |
127 | 128 |

Use this README file to introduce your application and point to useful 129 | places in the API for learning more. Run “rake doc:app” to generate API 130 | documentation for your models, controllers, helpers, and libraries.

131 | 132 |
133 | 134 | 135 | 136 | 141 | 142 | -------------------------------------------------------------------------------- /doc/coffee/files/popups.js.coffee.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 | 106 |
107 |

108 | File: 109 | popups.js.coffee 110 |

111 | 112 | 113 | 114 | 115 | 116 |
Defined in:
117 |

Method Summary

118 | 140 |

Method Details

141 |
142 |
143 |

144 | ? (void) newContainer() 145 |

146 |
147 |

==================================================================

= Containers =

148 | 149 |
150 |
151 |
152 |
153 |
154 |

155 | + (void) newImageButtonFunction() 156 |

157 |
158 |

==============================================================

= Images =

159 |

Reset image uploader and refresh image list

160 | 161 |
162 |
163 |
164 |
165 |
166 |
167 | 181 | 182 | -------------------------------------------------------------------------------- /doc/coffee/files/App/popups.js.coffee.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Curvature Coffee Docs 6 | 7 | 8 | 9 | 10 | 11 |
12 | 108 |
109 |

110 | File: 111 | popups.js.coffee 112 |

113 | 114 | 115 | 116 | 117 | 118 |
Defined in:App
119 |

Method Summary

120 | 142 |

Method Details

143 |
144 |
145 |

146 | ? (void) newContainer() 147 |

148 |
149 |

==================================================================

= Containers =

150 | 151 |
152 |
153 |
154 |
155 |
156 |

157 | + (void) newImageButtonFunction() 158 |

159 |
160 |

==============================================================

= Images =

161 |

Reset image uploader and refresh image list

162 | 163 |
164 |
165 |
166 |
167 |
168 |
169 | 183 | 184 | -------------------------------------------------------------------------------- /doc/app/Donabe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | module Donabe - Rails Application Documentation 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 142 | 143 |
144 |

module Donabe

145 | 146 |
147 | 148 |
149 | 150 | 151 | 152 | 153 |
154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 |
165 | 166 |
167 | 168 | 169 | 174 | 175 | -------------------------------------------------------------------------------- /doc/app/ApplicationHelper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | module ApplicationHelper - Rails Application Documentation 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 143 | 144 |
145 |

module ApplicationHelper

146 | 147 |
148 | 149 |
150 | 151 | 152 | 153 | 154 |
155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 |
166 | 167 |
168 | 169 | 170 | 175 | 176 | -------------------------------------------------------------------------------- /doc/app/Openstack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | module Openstack - Rails Application Documentation 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 143 | 144 |
145 |

module Openstack

146 | 147 |
148 | 149 |

Modules to contain all the openstack related controllers

150 | 151 |
152 | 153 | 154 | 155 | 156 |
157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 |
168 | 169 |
170 | 171 | 172 | 177 | 178 | -------------------------------------------------------------------------------- /app/assets/javascripts/visualisation/Nodes/server.js.coffee: -------------------------------------------------------------------------------- 1 | # Server (VM) class 2 | # 3 | class Nodes.Server extends Nodes.Deployable 4 | # Action ports changed 5 | @PORTS_CHANGED = 3 6 | # @property [Boolean] Are there any ports defined 7 | noPortsDefined = true 8 | 9 | # Construct a new Server object 10 | # 11 | # @param data [Object] Data to assign to the new Node 12 | # @param deployStatus [String] Is the node deployed, undeployed or marked for deletion 13 | # 14 | constructor: (data, deployStatus) -> 15 | if data.image != undefined 16 | imgSvg = Nodes.Server.calculateImageSVG(App.openstack.images.get(data.image.id)) 17 | else if data.image_name != undefined 18 | imgSvg = Nodes.Server.calculateImageSVG(data.image_name) 19 | else 20 | imgSvg = "undefined" 21 | 22 | if !data.networks? 23 | data.networks = [] 24 | super(data, imgSvg, deployStatus) 25 | @newNICs = [] 26 | @noPortsDefined = true 27 | 28 | 29 | # Work out the type of svg to assign to an image for more images to have different 30 | # icons add a return statement with a pattern match 31 | # 32 | # @param image [Object] The image object to calculate an svg for 33 | # 34 | @calculateImageSVG: (image) -> 35 | if image? 36 | if image.name != undefined 37 | name = image.name.toLowerCase() 38 | else 39 | name = image.toLowerCase() 40 | 41 | return "linux" if name.search(/cirros/) is 0 or name.search(/linux/) is 0 42 | return "ubuntu" if name.search(/ubuntu/) is 0 43 | return "windows" if name.search(/windows/) is 0 44 | return "tinycore" if name.search(/tinycore/) or name.search(/tiny core/) is 0 45 | 46 | "undefined" 47 | 48 | # Build the JSON to send to openstack to deploy a server 49 | # 50 | # @return [String] The JSON 51 | # 52 | createData: -> 53 | data = {name:@name, image_ref:@image.id, flavor:@flavor.id} 54 | if @newNICs.length > 0 55 | @noPortsDefined = false 56 | data.nics = [] 57 | for nic, i in @newNICs 58 | data.nics.push({uuid:nic}) 59 | data.key_name = @key_name if @key_name && @key_name isnt "none" 60 | data.security_group = @security_group if @security_group && @security_group isnt "none" 61 | return data 62 | 63 | # Deploy a Server 64 | # 65 | deploy: -> 66 | unless @deployStatus == "deployed" 67 | rest.postRequest('/openstack/servers', @createData(), (resp) => 68 | this.setDataFromOpenstackData(resp['server']) 69 | super() 70 | this.poll("ACTIVE") 71 | ) 72 | 73 | # Terminate a Server 74 | # 75 | terminate: -> 76 | if @deployStatus is "undeployed" 77 | super() 78 | else 79 | rest.deleteRequest("/openstack/servers/#{@id}", (resp) => 80 | super() 81 | ) 82 | 83 | # Pause this Server 84 | # 85 | pause: -> 86 | this.action('pause', 'PAUSED') 87 | 88 | # Unpause this Server 89 | # 90 | unpause: -> 91 | this.action('unpause', 'ACTIVE') 92 | 93 | # Reboot this Server 94 | # 95 | reboot: -> 96 | this.action('reboot', 'ACTIVE') 97 | 98 | # Suspend this Server 99 | # 100 | suspend: -> 101 | this.action('suspend', 'SUSPENDED') 102 | 103 | # Resume this Server 104 | # 105 | resume: -> 106 | this.action('resume', 'ACTIVE') 107 | 108 | # Start this Server 109 | # 110 | start: -> 111 | this.action('start', 'ACTIVE') 112 | 113 | # Stop this Server 114 | # 115 | stop: -> 116 | this.action('stop', 'SHUTOFF') 117 | # Build a post request to perform an action on a server 118 | # 119 | # @param action [String] The action to perform e.g. 'suspend' 120 | # @param expected_result [String] The expected result of performing this action e.g. 'SUSPENDED' 121 | # 122 | action: (action, expected_result) -> 123 | rest.postRequest("/openstack/servers/#{@id}/action", {action:action}, this.actionDataHandler(expected_result)) if @deployStatus == "deployed" 124 | 125 | # Get VNC Console 126 | # 127 | vnc: -> 128 | rest.postRequest("/openstack/servers/#{@id}/action", {action:'vnc'}, (resp) ->) 129 | 130 | # Create a snapshot of this server 131 | # 132 | # @param callback [] 133 | # 134 | snapshot: (callback) -> 135 | d = new Date() 136 | rest.postRequest("/openstack/servers/#{@id}", {action:snapshot, imageName:@name, metadata:{}}, callback) 137 | 138 | # Attach a volume to this server 139 | # 140 | # @param volume [Object] The volume object to connect to 141 | # @param link [Object] The Link object connecting the server and volume 142 | # 143 | attachVolume: (volume, link) -> 144 | rest.postRequest("/openstack/servers/#{@id}/attach_volume", {volume_id:@volume.id}, (resp) => link.setCommitted()) 145 | 146 | # Begin a poll until the status is the expected result 147 | # 148 | # @param status [String] The expected result and point at which to stop the poll 149 | # 150 | poll: (status) -> 151 | server = this 152 | $.when( 153 | rest.getRequest("/openstack/servers/#{@id}", (resp) => 154 | @setDataFromOpenstackData(resp['server']) 155 | ) 156 | ).then(=> 157 | switch server.status 158 | when status 159 | if status is "ACTIVE" 160 | this.fireAction(Nodes.Server.PORTS_CHANGED) 161 | else 162 | @noPortsDefined = true 163 | when "ERROR" then console.log "Server #{@id} has errored!" 164 | else 165 | setTimeout((=> @poll(status)), 1500) 166 | ) 167 | 168 | # The action data handler 169 | # 170 | # @param status [String] The expected result and point at which to stop the poll 171 | # @return [Object] The response 172 | # 173 | actionDataHandler: (status) -> 174 | return (resp) => poll(status) 175 | -------------------------------------------------------------------------------- /app/controllers/logins_controller.rb: -------------------------------------------------------------------------------- 1 | require 'net/http' 2 | require 'json' 3 | require 'uri' 4 | 5 | ##Handles login and cookie data. Identity initially returns only an unscoped token (a token with no tenant) that can 6 | ##only be used to retrive a list of tenants. Reauthenticating as one of those tenants will give you access to the 7 | ##components of openstack that tenant has access too. 8 | 9 | ##A recent bug with OpenStack providing tokens bigger than allowed cookie size means that we are storing the token 10 | ##rails side, and accessing this using the session. 11 | 12 | ##http://docs.openstack.org/api/openstack-identity-service/2.0/content/ 13 | 14 | class LoginsController < ApplicationController 15 | before_filter :check_login, :only => :show 16 | 17 | ##Supported Browsers 18 | Browser = Struct.new(:browser, :version) 19 | SupportedBrowsers = [ 20 | Browser.new('Safari', '6.0.2'), 21 | Browser.new('Firefox', '19.0.2'), 22 | Browser.new('Chrome', '25.0.1364.160') 23 | ] 24 | 25 | def show 26 | @unsupported = false 27 | user_agent = UserAgent.parse(request.user_agent) 28 | unless SupportedBrowsers.detect { |browser| user_agent >= browser } 29 | browser_name = user_agent.browser 30 | if (browser_name.casecmp("safari") == 0 || browser_name.casecmp("firefox") == 0 || browser_name.casecmp("chrome") == 0) 31 | flash_string = "You appear to be using an unsupported version of " + browser_name + ". Please upgrade for the best experience." 32 | else 33 | flash_string = "You appear to be using an unsupported browser." 34 | @unsupported = true 35 | end 36 | flash[:unsupported] = flash_string 37 | end 38 | 39 | logger.info(APP_CONFIG) 40 | 41 | if(!APP_CONFIG.has_key?("identity")) 42 | redirect_to setup_url 43 | else 44 | respond_to do |format| 45 | format.html 46 | end 47 | end 48 | end 49 | 50 | ##Attempt login, store cookie, 51 | def create 52 | begin 53 | identity = Ropenstack::Identity.new(APP_CONFIG["identity"]["ip"], APP_CONFIG["identity"]["port"], nil,"identityv2") 54 | 55 | identity.authenticate(params[:username], params[:password]) 56 | 57 | #Set user id--------------------------------------------------------------- 58 | sesh :current_user_id, identity.user()["id"] 59 | sesh :current_token, identity.token() 60 | 61 | #Get Default Tenant-------------------------------------------------------- 62 | tenant_data = identity.tenant_list() 63 | sesh :current_tenant, tenant_data["tenants"][0]["id"] 64 | sesh :current_tenant_name, tenant_data["tenants"][0]["name"] 65 | 66 | #Use this to get a scoped token-------------------------------------------- 67 | identity.scope_token(tenant_data["tenants"][0]["name"]) 68 | sesh :current_token, identity.token() 69 | 70 | #Parse Service Catalog----------------------------------------------------- 71 | logger.info(identity.services()) 72 | store_services(identity.services(), identity.admin()) 73 | 74 | #Redirect to the curvature dashboard after successfully logging in 75 | redirect_to visualisation_url 76 | rescue Ropenstack::UnauthorisedError 77 | login_failed() 78 | rescue Ropenstack::TimeoutError 79 | timeout() 80 | end 81 | end 82 | 83 | ##Reauthenticate and set new scoped token 84 | def switch 85 | identity = Ropenstack::Identity.new(APP_CONFIG["identity"]["ip"], APP_CONFIG["identity"]["port"], (sesh :current_token), "identityv2") 86 | identity.scope_token(params[:tenant_name]) 87 | store_services(identity.services(), identity.admin()) 88 | sesh :current_tenant, identity.token_metadata()["tenant"]["id"] 89 | sesh :current_tenant_name, identity.token_metadata()["tenant"]["name"] 90 | sesh :current_token, identity.token() 91 | redirect_to visualisation_url 92 | end 93 | 94 | ##Used to fill out tenant switching bar in interface. 95 | def tenants 96 | identity = Ropenstack::Identity.new(APP_CONFIG["identity"]["ip"], APP_CONFIG["identity"]["port"], (sesh :current_token), "identityv2") 97 | respond_to do |format| 98 | format.json { render :json => identity.tenant_list() } 99 | end 100 | end 101 | 102 | def current 103 | current_name = sesh :current_tenant_name 104 | respond_to do |format| 105 | format.json { render :json => {"tenant" => current_name} } 106 | end 107 | end 108 | 109 | def services 110 | servs = sesh :services 111 | respond_to do |format| 112 | format.json { render :json => { "services" => servs } } 113 | end 114 | end 115 | 116 | ##Logout/destroy tokens 117 | def destroy 118 | cookies.delete :sesh_id 119 | flash.keep 120 | redirect_to root_url, :notice => "You have logged out successfully!" 121 | end 122 | 123 | private 124 | 125 | def store_services(services, admin) 126 | servs = "" 127 | first = true 128 | services.each do |service| 129 | if first 130 | servs = "#{service["type"]}" 131 | first = false 132 | else 133 | servs = "#{servs},#{service["type"]}" 134 | end 135 | name = service["type"] + "_ip" 136 | sesh name.to_sym, service["endpoints"][0]["publicURL"] 137 | logger.info service["endpoints"][0]["publicURL"] 138 | end 139 | if admin 140 | servs = "#{servs},admin" 141 | end 142 | sesh :services, servs 143 | end 144 | 145 | def check_login 146 | if logged_in? 147 | redirect_to visualisation_url 148 | end 149 | end 150 | 151 | def login_failed 152 | flash[:error] = "Login Unsuccessful!" 153 | redirect_to root_url 154 | end 155 | 156 | def timeout 157 | flash[:error] = "Timeout connecting to Openstack" 158 | redirect_to root_url 159 | end 160 | end 161 | --------------------------------------------------------------------------------