Merge remote branch 'origin/master' into hector

This commit is contained in:
Javi Fontan committed 2012-09-25 16:03:23 +02:00
commit 69e4af20d9
72 files changed
+1130 -478

No files matched your search

+15
View File
@@ -1,4 +1,19 @@
#!/usr/bin/env rake
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
+11 -12
View File
@@ -1,31 +1,30 @@
#! /bin/sh
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
if [ -z "$ONE_LOCATION" ]; then
FLOW_PID=/var/run/one/appflow-server.pid
FLOW_SERVER=/usr/lib/one/ruby/apptools/flow/controllers/appflow-server.rb
FLOW_SERVER=/usr/lib/one/ruby/oneapps/flow/controllers/appflow-server.rb
FLOW_LOCK_FILE=/var/lock/one/.appflow.lock
FLOW_LOG=/var/log/one/appflow-server.log
FLOW_LOG_ERROR=/var/log/one/appflow-server.error
FLOW_ETC=/etc/one/appflow-server.conf
else
FLOW_PID=$ONE_LOCATION/var/appflow-server.pid
FLOW_SERVER=$ONE_LOCATION/lib/ruby/apptools/flow/controllers/appflow-server.rb
FLOW_SERVER=$ONE_LOCATION/lib/ruby/oneapps/flow/controllers/appflow-server.rb
FLOW_LOCK_FILE=$ONE_LOCATION/var/.appflow.lock
FLOW_LOG=$ONE_LOCATION/var/appflow-server.log
FLOW_LOG_ERROR=$ONE_LOCATION/var/appflow-server.error
+16 -1
View File
@@ -1,5 +1,20 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
@@ -11,7 +26,7 @@ end
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+'/cli'
require 'apptools/flow/appflow_client'
require 'oneapps/flow/appflow_client'
require 'command_parser'
require 'cli_helper'
+16 -1
View File
@@ -1,5 +1,20 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
@@ -11,7 +26,7 @@ end
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+'/cli'
require 'apptools/flow/appflow_client'
require 'oneapps/flow/appflow_client'
require 'command_parser'
require 'cli_helper'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'uri'
require 'cloud/CloudClient'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
$: << '.'
require 'controllers/appflow-server'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
################################################################################
# Server Configuration
################################################################################
+16 -1
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'rubygems'
require 'sinatra'
require 'yaml'
@@ -23,7 +38,7 @@ CONFIGURATION_FILE = ETC_LOCATION + "/appflow-server.conf"
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+'/cloud'
$: << RUBY_LIB_LOCATION+'/apptools/flow'
$: << RUBY_LIB_LOCATION+'/oneapps/flow'
require 'CloudAuth'
require 'CloudServer'
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
module Straight
# Using this strategy the service is deployed based on a directed
# acyclic graph where each node defines its parents.
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'uri'
class Hash
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'OpenNebula'
include OpenNebula
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+10 -11
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
@@ -67,7 +66,7 @@ module OpenNebula
if entry.nil?
entry = [Mutex.new, 0]
@@mutex_hash[service_id] = entry
end
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+9 -10
View File
@@ -1,16 +1,15 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
################################################################################
# Appflow
################################################################################
+16 -1
View File
@@ -1,6 +1,21 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
APPFLOW_CONF_FILE = ETC_LOCATION + "/sunstone-appflow.conf"
$: << RUBY_LIB_LOCATION+"/apptools/flow"
$: << RUBY_LIB_LOCATION+"/oneapps/flow"
require 'appflow_client'
+8 -4
View File
@@ -19,10 +19,10 @@
VERSION=${VERSION:-3.6.0}
MAINTAINER=${MAINTAINER:-C12G Labs <support@c12g.com>}
LICENSE=${LICENSE:-Apache}
PACKAGE_NAME=${PACKAGE_NAME:-apptools}
PACKAGE_NAME=${PACKAGE_NAME:-oneapps}
VENDOR=${VENDOR:-C12G Labs}
DESC="
AppTools description
OpenNebula Apps description
"
DESCRIPTION=${DESCRIPTION:-$DESC}
PACKAGE_TYPE=${PACKAGE_TYPE:-deb}
@@ -32,16 +32,20 @@ SCRIPTS_DIR=$PWD
NAME="${PACKAGE_NAME}_${VERSION}.${PACKAGE_TYPE}"
rm $NAME
DIRS="apptools env flow market"
DIRS="oneapps stage flow market"
export DESTDIR=$PWD/tmp
if [ "$(id -u)" = "0" ]; then
OWNER_FLAGS='-u oneadmin -g oneadmin'
fi
rm -rf $DESTDIR
mkdir $DESTDIR
for TOOL in $DIRS; do
(
cd $TOOL
./install.sh
./install.sh $OWNER_FLAGS
)
done
+6 -6
View File
@@ -51,17 +51,17 @@ while true ; do
done
if [ -z "$ROOT" ]; then
LIB_LOCATION="/usr/lib/one/ruby/apptools"
LIB_LOCATION="/usr/lib/one/ruby/oneapps"
BIN_LOCATION="/usr/bin"
PACKAGES_LOCATION="/usr/share/one/apptools"
SHARE_LOCATION="/usr/share/one/apptools"
PACKAGES_LOCATION="/usr/share/one/oneapps"
SHARE_LOCATION="/usr/share/one/oneapps"
ETC_LOCATION="/etc/one"
SUNSTONE_LOCATION="/usr/lib/one/sunstone"
else
LIB_LOCATION="$ROOT/lib/ruby/apptools"
LIB_LOCATION="$ROOT/lib/ruby/oneapps"
BIN_LOCATION="$ROOT/bin"
PACKAGES_LOCATION="$ROOT/share/apptools"
SHARE_LOCATION="$ROOT/share/apptools"
PACKAGES_LOCATION="$ROOT/share/oneapps"
SHARE_LOCATION="$ROOT/share/oneapps"
ETC_LOCATION="$ROOT/etc"
SUNSTONE_LOCATION="$ROOT/lib/sunstone"
fi
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
source "http://rubygems.org"
gem 'json'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
$: << './'
require 'models'
+2 -2
View File
@@ -18,14 +18,14 @@
if [ -z "$ONE_LOCATION" ]; then
MARKET_PID=/var/run/one/appmarket-server.pid
MARKET_SERVER=/usr/lib/one/ruby/apptools/market/controllers/appmarket-server.rb
MARKET_SERVER=/usr/lib/one/ruby/oneapps/market/controllers/appmarket-server.rb
MARKET_LOCK_FILE=/var/lock/one/.appmarket.lock
MARKET_LOG=/var/log/one/appmarket-server.log
MARKET_LOG_ERROR=/var/log/one/appmarket-server.error
MARKET_ETC=/etc/one/appmarket-server.conf
else
MARKET_PID=$ONE_LOCATION/var/appmarket-server.pid
MARKET_SERVER=$ONE_LOCATION/lib/ruby/apptools/market/controllers/appmarket-server.rb
MARKET_SERVER=$ONE_LOCATION/lib/ruby/oneapps/market/controllers/appmarket-server.rb
MARKET_LOCK_FILE=$ONE_LOCATION/var/.appmarket.lock
MARKET_LOG=$ONE_LOCATION/var/appmarket-server.log
MARKET_LOG_ERROR=$ONE_LOCATION/var/appmarket-server.error
+16 -1
View File
@@ -1,5 +1,20 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
@@ -8,7 +23,7 @@ else
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
end
$: << RUBY_LIB_LOCATION+"/apptools/market"
$: << RUBY_LIB_LOCATION+"/oneapps/market"
$: << RUBY_LIB_LOCATION+"/cloud"
$: << RUBY_LIB_LOCATION+"/cli"
+16 -1
View File
@@ -1,5 +1,20 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
@@ -8,7 +23,7 @@ else
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
end
$: << RUBY_LIB_LOCATION+"/apptools/market"
$: << RUBY_LIB_LOCATION+"/oneapps/market"
$: << RUBY_LIB_LOCATION+"/cloud"
$: << RUBY_LIB_LOCATION+"/cli"
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'uri'
require 'CloudClient'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
$: << '.'
require 'controllers/appmarket-server'
+23 -8
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
# Host and port where AppMarket server will run
:host: 127.0.0.1
:port: 6242
@@ -19,11 +34,11 @@ user:
# Parameters that will be used to configure the delivery method of the
# mail service. More information: http://rubygems.org/gems/mail
mail:
:address: mail.default.com
:port: 587
:domain: default.com
:user_name: default@default.com
:password: password
:authentication: plain
:enable_starttls_auto: false
#mail:
# :address: mail.default.com
# :port: 587
# :domain: default.com
# :user_name: default@default.com
# :password: password
# :authentication: plain
# :enable_starttls_auto: false
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'rubygems'
require 'mongo'
require 'yaml'
+16 -1
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'rubygems'
require 'sinatra'
require 'haml'
@@ -22,7 +37,7 @@ CONFIGURATION_FILE = ETC_LOCATION + "/appmarket-server.conf"
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+'/cloud'
$: << RUBY_LIB_LOCATION+'/apptools/market'
$: << RUBY_LIB_LOCATION+'/oneapps/market'
require 'models'
require 'session'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'mail'
require 'erb'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'json'
module Parser
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'digest/sha1'
class Session
+19 -6
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'uri'
class Hash
@@ -243,12 +258,10 @@ class Validator
#
#
def validate_integer(body, schema_array, schema_key)
if body.is_a?(Integer)
body
else
raise ParseException, "KEY: '#{schema_key}' must be an Integer;"\
" SCHEMA: #{schema_array}"
end
Integer(body)
rescue ArgumentError
raise ParseException, "KEY: '#{schema_key}' must be an Integer;"\
" SCHEMA: #{schema_array}"
end
# Validate an null type
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'init'
require 'validator'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'uri'
require 'net/http'
+15
View File
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'bcrypt'
class User
@@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
################################################################################
# AppMarket
################################################################################
+16 -1
View File
@@ -1,6 +1,21 @@
# -------------------------------------------------------------------------- #
# Copyright 2010-2012, C12G Labs S.L. #
# #
# Licensed under the C12G Commercial Open-source License (the #
# "License"); you may not use this file except in compliance #
# with the License. You may obtain a copy of the License as part #
# of the software distribution. #
# #
# Unless agreed to in writing, software distributed under the #
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES #
# OR CONDITIONS OF ANY KIND, either express or implied. See the #
# License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
APPMARKET_CONF_FILE = ETC_LOCATION + "/sunstone-appmarket.conf"
$: << RUBY_LIB_LOCATION+"/apptools/market"
$: << RUBY_LIB_LOCATION+"/oneapps/market"
require 'appmarket_client'
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
%fieldset
.control-group
%label.control-label{'for' => 'name_form'} Name
+18 -3
View File
@@ -1,10 +1,25 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
.navbar.navbar-static
.navbar-inner
.container
%ul.nav.nav-pills
%li
%form{class: "navbar-search pull-left", action: ""}
%input{id: "search", type: "text" , placeholder: "Search", onKeyPress: "return disableEnterKey(event)"}
%form{'class' => "navbar-search pull-left", 'action' => ""}
%input{'id' => "search", 'type' => "text" , 'placeholder' => "Search", 'onKeyPress' => "return disableEnterKey(event)"}
%li
%a{'href' => "#asearch_form", 'data-toggle' => "collapse"}
@@ -54,7 +69,7 @@
%select#format.span2
%table{class: "table table-striped table-no-head", id: "apps"}
%table{'class' => "table table-striped table-no-head", 'id' => "apps"}
%thead
%tr
%th Appliances
+16 -1
View File
@@ -1,7 +1,22 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
.navbar.navbar-static
.navbar-inner
.container
%a.brand{href:"/"} Appliances
%a.brand{'href' => "/"} Appliances
= haml :nav_login
.container-fluid
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
.row-fluid
.span4
:plain
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
%p
© 2012 C12G Labs S.L. All Rights Reserved.
%a{'href' => "http://www.c12g.com/legal-notice"} Legal Notice.
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
%a.span4{'href' => "http://www.opennebula.org/"}
%img{'src' => "/img/opennebula_gray.png"}
%a.pull-right{'href' => "http://www.c12g.com/"}
+15
View File
@@ -1,2 +1,17 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
Accept
%a{'href' => 'http://www.c12g.com//marketplace-terms-of-use', 'target' => 'blank'} Terms of Use
+15
View File
@@ -1,2 +1,17 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
%i.icon-shopping-cart.icon-white
OpenNebula AppMarket
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
!!!
%html{:lang => "en"}
%head
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
%ul.nav.pull-right.nav-pills
%li.divider-vertical
- if @session.anonymous?
+15
View File
@@ -1,3 +1,18 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
%fieldset
.control-group
%label.control-label{'for' => 'organization_form'} Organization
+17 -2
View File
@@ -1,10 +1,25 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
.navbar.navbar-static
.navbar-inner
.container
%a.brand{href:"/"} Appliances
%a.brand{href => "/"} Appliances
= haml :nav_login
%table{class: "table table-striped", id: "users"}
%table{'class' => "table table-striped", 'id' => "users"}
%thead
%tr
%th username
+16 -1
View File
@@ -1,7 +1,22 @@
//--------------------------------------------------------------------------//
// Copyright 2010-2012, C12G Labs S.L. //
// //
// Licensed under the C12G Commercial Open-source License (the //
// "License"); you may not use this file except in compliance //
// with the License. You may obtain a copy of the License as part //
// of the software distribution. //
// //
// Unless agreed to in writing, software distributed under the //
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES //
// OR CONDITIONS OF ANY KIND, either express or implied. See the //
// License for the specific language governing permissions and //
// limitations under the License. //
//--------------------------------------------------------------------------//
.navbar.navbar-static
.navbar-inner
.container
%a.brand{href:"/user"} Users
%a.brand{href => "/user"} Users
= haml :nav_login
.container-fluid
File renamed without changes.
@@ -44,12 +44,11 @@ var OpenNebula = {
"Helper": {
"resource_state": function(type, value)
{
var state;
switch(type)
{
case "HOST":
case "host":
state = tr(["INIT",
return tr(["INIT",
"MONITORING_MONITORED",
"MONITORED",
"ERROR",
@@ -58,7 +57,7 @@ var OpenNebula = {
break;
case "HOST_SIMPLE":
case "host_simple":
state = tr(["INIT",
return tr(["INIT",
"UPDATE",
"ON",
"ERROR",
@@ -67,19 +66,18 @@ var OpenNebula = {
break;
case "VM":
case "vm":
state = tr(["INIT",
return tr(["INIT",
"PENDING",
"HOLD",
"ACTIVE",
"STOPPED",
"SUSPENDED",
"DONE",
"FAILED",
"POWEROFF"][value]);
"FAILED"][value]);
break;
case "VM_LCM":
case "vm_lcm":
state = tr(["LCM_INIT",
return tr(["LCM_INIT",
"PROLOG",
"BOOT",
"RUNNING",
@@ -96,12 +94,11 @@ var OpenNebula = {
"FAILURE",
"CLEANUP",
"UNKNOWN",
"HOTPLUG",
"SHUTDOWN_POWEROFF"][value]);
"HOTPLUG"][value]);
break;
case "IMAGE":
case "image":
state = tr(["INIT",
return tr(["INIT",
"READY",
"USED",
"DISABLED",
@@ -113,17 +110,15 @@ var OpenNebula = {
break;
case "VM_MIGRATE_REASON":
case "vm_migrate_reason":
state = tr(["NONE",
return tr(["NONE",
"ERROR",
"STOP_RESUME",
"USER",
"CANCEL"][value]);
break;
default:
return value;
return;
}
if (!state) state = value
return state;
},
"image_type": function(value)
@@ -361,6 +356,7 @@ var OpenNebula = {
var data = params.data;
var method = "monitor";
var action = OpenNebula.Helper.action(method);
var request = OpenNebula.Helper.request(resource,method, data);
var url = path ? path : resource.toLowerCase();
@@ -401,16 +397,9 @@ var OpenNebula = {
type: "POST",
data: {remember: remember},
beforeSend : function(req) {
var token = username + ':' + password;
var authString = 'Basic ';
if (typeof(btoa) === 'function')
authString += btoa(token)
else {
token = CryptoJS.enc.Utf8.parse(token);
authString += CryptoJS.enc.Base64.stringify(token)
}
req.setRequestHeader( "Authorization", authString);
req.setRequestHeader( "Authorization",
"Basic " + btoa(username + ":" + password)
)
},
success: function(response){
return callback ? callback(request, response) : null;
@@ -503,7 +492,7 @@ var OpenNebula = {
},
"monitor" : function(params){
OpenNebula.Action.monitor(params,OpenNebula.Host.resource,false);
}
},
},
"Network": {
@@ -577,7 +566,7 @@ var OpenNebula = {
},
"fetch_template" : function(params){
OpenNebula.Action.show(params,OpenNebula.Network.resource,"template");
}
},
},
"VM": {
@@ -635,9 +624,6 @@ var OpenNebula = {
"resubmit": function(params){
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"resubmit");
},
"poweroff" : function(params){
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"poweroff");
},
"reboot" : function(params){
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"reboot");
},
@@ -693,6 +679,9 @@ var OpenNebula = {
"startvnc" : function(params){
OpenNebula.VM.vnc(params,"startvnc");
},
"stopvnc" : function(params){
OpenNebula.VM.vnc(params,"stopvnc");
},
"monitor" : function(params){
OpenNebula.Action.monitor(params,OpenNebula.VM.resource,false);
},
@@ -726,9 +715,6 @@ var OpenNebula = {
},
"show" : function(params){
OpenNebula.Action.show(params,OpenNebula.Group.resource);
},
"accounting" : function(params){
OpenNebula.Action.monitor(params,OpenNebula.Group.resource,false);
}
},
@@ -772,13 +758,10 @@ var OpenNebula = {
"fetch_template" : function(params){
OpenNebula.Action.show(params,OpenNebula.User.resource,"template");
},
"accounting" : function(params){
OpenNebula.Action.monitor(params,OpenNebula.User.resource,false);
},
"set_quota" : function(params){
var action_obj = { quotas : params.data.extra_param };
OpenNebula.Action.simple_action(params,OpenNebula.User.resource,"set_quota",action_obj);
}
},
// "addgroup" : function(params){
// var action_obj = {"group_id": params.data.extra_param };
@@ -1020,7 +1003,7 @@ var OpenNebula = {
},
"fetch_template" : function(params){
OpenNebula.Action.show(params,OpenNebula.Datastore.resource,"template");
}
},
},
"Marketplace" : {
@@ -1048,8 +1031,8 @@ var OpenNebula = {
},
error: function(res){
return callback_error ? callback_error(request, OpenNebula.Error(res)) : null;
}
},
});
}
}
},
},
}
+11 -11
View File
@@ -5,7 +5,7 @@ Installing services can sometimes be tedious. Getting the VM ins good shape, ins
With this software we can script the installation and configuration of applications and services. You can also describe the services and their configuration that will be installed on a node so we can automate its installation. We will also be sure that each installation will be equal to other using the same configuration.
The tool oneenv will make use of [chef-solo](http://wiki.opscode.com/display/chef/Chef+Solo). It lets you register chef configurations and instantiate them using predefined templates and images.
The tool onestage will make use of [chef-solo](http://wiki.opscode.com/display/chef/Chef+Solo). It lets you register chef configurations and instantiate them using predefined templates and images.
# Guide
@@ -35,15 +35,15 @@ The node files are JSON encoded and contain the recipes that are going to be run
${WP_DB_NAME|wordpress}
oneenv comes with a template engine that will let you create node files with variables. These variables are named and can contain default values. the form is:
onestage comes with a template engine that will let you create node files with variables. These variables are named and can contain default values. the form is:
${NAME[|<default value>]}
The name will be used to refer to it on VM instantiation (we will see this later on) and the default value will substitute the variable if it is not explicitly specified.
We save this file as node.json and now comes the registration part. oneenv will let us register it in the OpenNebula database. To register the node file we can use the command `oneenv create`:
We save this file as node.json and now comes the registration part. onestage will let us register it in the OpenNebula database. To register the node file we can use the command `onestage create`:
$ oneenv create node.json
$ onestage create node.json
21
The number returned is the identifier to our newly registered node file. We can also specify some parameters:
@@ -54,19 +54,19 @@ The number returned is the identifier to our newly registered node file. We can
On VM creation the recipes specified in the node file will be automatically downloaded from the standard chef cookbooks repository but we can specify a URL of a tar.gz containing extra cookbooks that you have created. For example:
$ oneenv create --name my_blog --templates ubuntu,centos --cookbooks http://some.url.com/cookbooks.tar.gz node.json
$ onestage create --name my_blog --templates ubuntu,centos --cookbooks http://some.url.com/cookbooks.tar.gz node.json
22
We can list the nodes we already have defined:
$ oneenv list
$ onestage list
ID NAME
21 wordpress
22 my_blog
And show the properties:
$ ./oneenv show my_blog
$ ./onestage show my_blog
ROLE 22 INFORMATION
ID : 22
NAME : my_blog
@@ -107,11 +107,11 @@ And show the properties:
There we can see the node file and its properties. It is also handy the default variables. Those are the ones we can change on instantiation.
We will be also able to update the node file using `oneenv update <node>`. A text editor will be run letting us modify the node file.
We will be also able to update the node file using `onestage update <node>`. A text editor will be run letting us modify the node file.
To instantiate a VM that will use this node we will use the command `oneenv instantiate <template> <node>`. This command will also let us change the variables in the node using the parameter `-d`. For example:
To instantiate a VM that will use this node we will use the command `onestage instantiate <template> <node>`. This command will also let us change the variables in the node using the parameter `-d`. For example:
$ oneenv instantiate ubuntu my_blog -d WP_DB_NAME=myblog,MYSQL_ROOT_PASSWORD=some_other_password
$ onestage instantiate ubuntu my_blog -d WP_DB_NAME=myblog,MYSQL_ROOT_PASSWORD=some_other_password
Now we can check that a new VM was created:
@@ -137,7 +137,7 @@ These parameters will be used by the contextualization script inside the VM imag
# Preparing the VM
The VM images where these configurations will be applied need to be prepared to use the contextualization information provided by oneenv. The requirements are:
The VM images where these configurations will be applied need to be prepared to use the contextualization information provided by onestage. The requirements are:
* chef-solo installed
* ruby installed
+37 -6
View File
@@ -24,7 +24,7 @@ else
end
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+"/apptools/env"
$: << RUBY_LIB_LOCATION+"/oneapps/stage"
$: << RUBY_LIB_LOCATION+"/cli"
$: << '.'
@@ -32,7 +32,7 @@ require 'onechef'
require 'base64'
require 'command_parser'
require 'appenv_helper'
require 'appstage_helper'
require 'one_helper/onetemplate_helper'
require 'pp'
@@ -94,17 +94,25 @@ COOKBOOKS={
}
cmd = CommandParser::CmdParser.new(ARGV) do
usage "`appenv` <command> [<args>] [<options>]"
usage "`appstage` <command> [<args>] [<options>]"
version OpenNebulaHelper::ONE_VERSION
helper = AppEnvHelper.new
helper = AppStageHelper.new
template_helper = OneTemplateHelper.new
set :format, :node, AppEnvHelper.to_id_desc do |arg|
set :format, :groupid, OpenNebulaHelper.rname_to_id_desc("GROUP") do |arg|
OpenNebulaHelper.rname_to_id(arg, "GROUP")
end
set :format, :userid, OpenNebulaHelper.rname_to_id_desc("USER") do |arg|
OpenNebulaHelper.rname_to_id(arg, "USER")
end
set :format, :node, AppStageHelper.to_id_desc do |arg|
helper.to_id(arg)
end
set :format, :node_list, AppEnvHelper.list_to_id_desc do |arg|
set :format, :node_list, AppStageHelper.list_to_id_desc do |arg|
helper.list_to_id(arg)
end
@@ -197,6 +205,29 @@ cmd = CommandParser::CmdParser.new(ARGV) do
0
end
chgrp_desc = <<-EOT.unindent
Changes the node group
EOT
command :chgrp, chgrp_desc,[:range, :node_list], :groupid do
helper.perform_actions(args[0],options,"Group changed") do |node|
node.chown(-1, args[1].to_i)
end
end
chown_desc = <<-EOT.unindent
Changes the node owner and group
EOT
command :chown, chown_desc, [:range, :node_list], :userid,
[:groupid,nil] do
gid = args[2].nil? ? -1 : args[2].to_i
helper.perform_actions(args[0],options,
"Owner/Group changed") do |node|
node.chown(args[1].to_i, gid)
end
end
instantiate_desc = <<-EOT.unindent
Instantiate a template with a node
EOT
@@ -15,13 +15,13 @@
require 'one_helper'
class AppEnvHelper < OpenNebulaHelper::OneHelper
class AppStageHelper < OpenNebulaHelper::OneHelper
def self.rname
"DOCUMENT"
end
def self.conf_file
"appenv.yaml"
"appstage.yaml"
end
private
+1 -1
View File
@@ -17,7 +17,7 @@
. ../install_lib.sh
copy_files "lib/* cli/*" "$LIB_LOCATION/env"
copy_files "lib/* cli/*" "$LIB_LOCATION/stage"
copy_files "bin/*" "$BIN_LOCATION"
copy_files "share/packages/*" "$PACKAGES_LOCATION"
copy_files "sunstone/public/js/user-plugins/*" "$SUNSTONE_LOCATION/public/js/user-plugins"
File renamed without changes.
File renamed without changes.
@@ -31,9 +31,9 @@ Now we can update the packages located in the directory packages. Remember to us
$ git rm packages/app-context_3.6.0.deb
$ cp /Users/jfontan/tmp/borrar/git/one2/share/scripts/context-packages/app-context_3.6.1.deb packages/
$ git add packages/app-context_3.6.1.deb
$ git commit -m'appenv: added context package version 3.6.1'
$ git commit -m'appstage: added context package version 3.6.1'
$ git push
These packages will be used for the apptools package generation.
These packages will be used for the oneapps package generation.
@@ -18,7 +18,7 @@ This package prepares a VM image for OpenNebula:
* Deletes udev net and cd persistent rules
* Unconfigures the network
* Adds OpenNebula contextualization scripts to startup
* Prepares the image to be used with AppEnv
* Prepares the image to be used with AppStage
To get support use the OpenNebula.pro portal:
http://opennebula.pro
@@ -13,31 +13,31 @@
// limitations under the License. //
//--------------------------------------------------------------------------//
function updateAppEnvDashboard(what, json_info){
var db = $('#appenv_dashboard_tab',main_tabs_context);
function updateAppStageDashboard(what, json_info){
var db = $('#appstage_dashboard_tab',main_tabs_context);
switch (what){
case "environments":
var total_envs=json_info.length;
$('#appenv_total_environments',db).html(total_envs);
$('#appstage_total_environments',db).html(total_envs);
break;
};
}
var appenv_dashboard_tmpl = '\
<table class="dashboard_table" id="appenv_dashboard">\
var appstage_dashboard_tmpl = '\
<table class="dashboard_table" id="appstage_dashboard">\
<tr>\
<td style="width:50%">\
<table id="system_information_table" style="width:100%">\
<tr>\
<td>\
<div class="panel">\
<h3>' + tr("Summary of AppEnv resources") + '</h3>\
<h3>' + tr("Summary of AppStage resources") + '</h3>\
<div class="panel_info">\
\
<table class="info_table">\
<tr>\
<td class="key_td">Environments</td>\
<td class="value_td"><span id="appenv_total_environments"></span></td>\
<td class="value_td"><span id="appstage_total_environments"></span></td>\
</tr>\
</table>\
\
@@ -51,7 +51,7 @@ var appenv_dashboard_tmpl = '\
<h3>' + tr("Quickstart") + '</h3>\
<div class="panel_info dashboard_p">\
<ul>\
<li><a class="action_button" href="#appenvs_tab" value="AppEnv.create_dialog">Create a new Environment</a></li>\
<li><a class="action_button" href="#appstages_tab" value="AppStage.create_dialog">Create a new Environment</a></li>\
</ul>\
</div>\
</div>\
@@ -64,15 +64,15 @@ var appenv_dashboard_tmpl = '\
<tr>\
<td>\
<div class="panel">\
<h3>' + tr("AppEnv") + '</h3>\
<h3>' + tr("AppStage") + '</h3>\
<div class="panel_info">\
<p>\
<img src="images/appenv_icon.png" height="80px" style="float:right;margin:0px 15px 15px 15px;" alt="appenv logo"/>\
AppEnv performs the automatic installation and configuration of the software stack that constitutes an application environment. With AppEnv you can easily define software configurations for your VMs and share them with other users.\
<img src="images/appstage_icon.png" height="80px" style="float:right;margin:0px 15px 15px 15px;" alt="appstage logo"/>\
AppStage performs the automatic installation and configuration of the software stack that constitutes an application environment. With AppStage you can easily define software configurations for your VMs and share them with other users.\
</p>\
<p>'+tr("You can find further information on the following links:")+'</p>\
<ul>\
<li><a href="http://doc.opennebula.pro/doku.php?id=appenv" target="_blank">AppEnv Documentation</a></li>\
<li><a href="http://doc.opennebula.pro/doku.php?id=appstage" target="_blank">AppStage Documentation</a></li>\
</ul>\
</div>\
</div>\
@@ -82,10 +82,10 @@ var appenv_dashboard_tmpl = '\
</td>\
</tr></table>';
var appenv_dashboard_tab = {
title: '<i class="icon-magic"></i>AppEnv',
content: appenv_dashboard_tmpl,
var appstage_dashboard_tab = {
title: '<i class="icon-magic"></i>AppStage',
content: appstage_dashboard_tmpl,
}
Sunstone.addMainTab('appenv_dashboard_tab',appenv_dashboard_tab);
Sunstone.addMainTab('appstage_dashboard_tab',appstage_dashboard_tab);
@@ -13,7 +13,7 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
$: << RUBY_LIB_LOCATION+"/apptools/env"
$: << RUBY_LIB_LOCATION+"/oneapps/stage"
require 'onechef'
@@ -22,14 +22,14 @@ helpers do
settings.cloud_auth.client(session[:user])
end
def appenv_pool
def appstage_pool
pool = OpenNebula::ChefDocPool.new(client())
rc = pool.info
return [500, rc.to_json] if OpenNebula.is_error?(rc)
[200, pool.to_hash.to_json]
end
def appenv_create(template)
def appstage_create(template)
node = OpenNebula::ChefConf.new
node.description = template['description'] if template['description']
node.cookbooks = template['cookbooks'] if template['cookbacks']
@@ -51,7 +51,7 @@ helpers do
[201, doc.to_hash.to_json]
end
def appenv_retrieve(id)
def appstage_retrieve(id)
resource = OpenNebula::ChefDoc.new_with_id(id, client())
rc = resource.info
@@ -59,7 +59,7 @@ helpers do
[200, resource.to_hash.to_json]
end
def appenv_update(resource, template)
def appstage_update(resource, template)
node = resource.node
node.node = template['node'] if template['node']
node.templates = template['templates']
@@ -67,7 +67,7 @@ helpers do
resource.update(node.to_json)
end
def appenv_action(id, action_hash)
def appstage_action(id, action_hash)
resource = OpenNebula::ChefDoc.new_with_id(id,client())
rc = resource.info
if OpenNebula.is_error?(rc)
@@ -81,7 +81,7 @@ helpers do
when "chmod" then resource.chmod_octet(params['octet'])
when "update" then appenv_update(resource, params['DOCUMENT'])
when "update" then appstage_update(resource, params['DOCUMENT'])
when "instantiate" then resource.instantiate(params['template_id'],
params['vars'])
@@ -96,7 +96,7 @@ helpers do
[204, resource.to_hash.to_json]
end
def appenv_delete(id)
def appstage_delete(id)
resource = OpenNebula::ChefDoc.new_with_id(id, client())
rc = resource.delete
@@ -108,28 +108,28 @@ end
################################################################
# PLUGIN ROUTES
################################################################
get '/appenv' do
appenv_pool()
get '/appstage' do
appstage_pool()
end
post '/appenv' do
post '/appstage' do
template = parse_json(request.body.read, 'DOCUMENT')
appenv_create(template)
appstage_create(template)
end
get '/appenv/:id' do
appenv_retrieve(params[:id].to_i)
get '/appstage/:id' do
appstage_retrieve(params[:id].to_i)
end
post '/appenv/:id/action' do
post '/appstage/:id/action' do
action_hash = parse_json(request.body.read, 'action')
if OpenNebula.is_error?(action_hash)
return [500, action_hash.to_json]
end
appenv_action(params[:id].to_i, action_hash)
appstage_action(params[:id].to_i, action_hash)
end
delete '/appenv/:id' do
appenv_delete(params[:id].to_i)
delete '/appstage/:id' do
appstage_delete(params[:id].to_i)
end