' + tr("AppEnv - A tool to manage environments") + '
\
+
' + tr("AppEnv") + '
\
\
-\
-
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.
\
-
\
-
\
-
\
-
\
+
\
+ \
+ 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.\
+
\
+
'+tr("You can find further information on the following links:")+'
' + tr("Appflow - A tool to manage environments") + '
\
+
' + tr("Appflow - A tool to manage environments") + '
\
\
-\
-
AppFlow enables the automatic execution of multi-tiered applications. With AppFlow you can define multi-tier applications composed of interconnected VMs and manage them as a single entity.
\
-
\
-
\
-
\
-
\
+
\
+ \
+ AppFlow enables the automatic execution of multi-tiered applications. With AppFlow you can define multi-tier applications composed of interconnected VMs and manage them as a single entity.\
+
\
+
'+tr("You can find further information on the following links:")+'
\
diff --git a/flow/sunstone/public/js/user-plugins/apptools.appflow.services.js b/flow/sunstone/public/js/user-plugins/apptools.appflow.services.js
index 132010b09d..8bba09a124 100644
--- a/flow/sunstone/public/js/user-plugins/apptools.appflow.services.js
+++ b/flow/sunstone/public/js/user-plugins/apptools.appflow.services.js
@@ -429,6 +429,7 @@ function updateServicesView(request, services_list){
updateView(service_list_array,dataTable_services);
//updateVResDashboard("images",images_list);
+ updateAppFlowDashboard('services', service_list_array);
}
// Callback to refresh the list of Virtual Machines
diff --git a/flow/sunstone/public/js/user-plugins/apptools.appflow.templates.js b/flow/sunstone/public/js/user-plugins/apptools.appflow.templates.js
index 61fdd3edc1..0b76aa9a3e 100644
--- a/flow/sunstone/public/js/user-plugins/apptools.appflow.templates.js
+++ b/flow/sunstone/public/js/user-plugins/apptools.appflow.templates.js
@@ -435,6 +435,7 @@ function updateServiceTemplatesView(request, service_templates_list){
updateView(service_template_list_array,dataTable_service_templates);
//updateVResDashboard("images",images_list);
+ updateAppFlowDashboard('templates', service_template_list_array);
}
// Callback to update the information panel tabs and pop it up
diff --git a/flow/sunstone/routes/appflow.rb b/flow/sunstone/routes/appflow.rb
index 87b5730278..acaba258ab 100644
--- a/flow/sunstone/routes/appflow.rb
+++ b/flow/sunstone/routes/appflow.rb
@@ -1,24 +1,36 @@
+APPFLOW_CONF_FILE = ETC_LOCATION + "/sunstone-appflow.conf"
+
$: << RUBY_LIB_LOCATION+"/apptools/flow"
require 'appflow_client'
+begin
+ appflow_conf = YAML.load_file(APPFLOW_CONF_FILE)
+rescue Exception => e
+ STDERR.puts "Error parsing config file #{APPFLOW_CONF_FILE}: #{e.message}"
+ exit 1
+end
+
+set :appflow_config, appflow_conf
+
helpers do
- def build_client
+ def af_build_client
flow_client = settings.cloud_auth.client(session[:user])
split_array = flow_client.one_auth.split(':')
Service::Client.new(
- :url => settings.config[:appflow_server],
+ :url => settings.appflow_config[:appflow_server],
:user_agent => "Sunstone",
:username => split_array.shift,
:password => split_array.join(':'))
end
- def format_response(resp)
+ def af_format_response(resp)
if CloudClient::is_error?(resp)
logger.error("[AppFlow] " + resp.to_s)
- # TBD format error messages in JSON
- error 500, resp.to_s
+
+ error = Error.new(resp.to_s)
+ error resp.code.to_i, error.to_json
else
body resp.body.to_s
end
@@ -30,35 +42,35 @@ end
##############################################################################
get '/service' do
- client = build_client
+ client = af_build_client
resp = client.get('/service')
- format_response(resp)
+ af_format_response(resp)
end
get '/service/:id' do
- client = build_client
+ client = af_build_client
resp = client.get('/service/' + params[:id])
- format_response(resp)
+ af_format_response(resp)
end
delete '/service/:id' do
- client = build_client
+ client = af_build_client
resp = client.delete('/service/' + params[:id])
- format_response(resp)
+ af_format_response(resp)
end
post '/service/:id/action' do
- client = build_client
+ client = af_build_client
resp = client.post('/service/' + params[:id] + '/action', request.body.read)
- format_response(resp)
+ af_format_response(resp)
end
##############################################################################
@@ -66,41 +78,41 @@ end
##############################################################################
get '/service_template' do
- client = build_client
+ client = af_build_client
resp = client.get('/service_template')
- format_response(resp)
+ af_format_response(resp)
end
get '/service_template/:id' do
- client = build_client
+ client = af_build_client
resp = client.get('/service_template/' + params[:id])
- format_response(resp)
+ af_format_response(resp)
end
delete '/service_template/:id' do
- client = build_client
+ client = af_build_client
resp = client.delete('/service_template/' + params[:id])
- format_response(resp)
+ af_format_response(resp)
end
post '/service_template/:id/action' do
- client = build_client
+ client = af_build_client
resp = client.post('/service_template/' + params[:id] + '/action', request.body.read)
- format_response(resp)
+ af_format_response(resp)
end
post '/service_template' do
- client = build_client
+ client = af_build_client
resp = client.post('/service_template', request.body.read)
- format_response(resp)
+ af_format_response(resp)
end
\ No newline at end of file
diff --git a/market/client/lib/appplace_client.rb b/market/client/lib/appmarket_client.rb
similarity index 100%
rename from market/client/lib/appplace_client.rb
rename to market/client/lib/appmarket_client.rb
diff --git a/market/install.sh b/market/install.sh
index 925673d947..a7b47b2c18 100755
--- a/market/install.sh
+++ b/market/install.sh
@@ -96,5 +96,6 @@ copy_files "sunstone/routes/*" "$SUNSTONE_LOCATION/routes"
# Do not link the ETC files
LINK="no"
+copy_files "sunstone/etc/sunstone-appmarket.conf" "$ETC_LOCATION"
copy_files "config/appmarket-server.conf" "$ETC_LOCATION"
diff --git a/market/sunstone/etc/sunstone-appmarket.conf b/market/sunstone/etc/sunstone-appmarket.conf
new file mode 100644
index 0000000000..6a5a3b1086
--- /dev/null
+++ b/market/sunstone/etc/sunstone-appmarket.conf
@@ -0,0 +1,13 @@
+################################################################################
+# AppMarket
+################################################################################
+
+# AppMarket username and password
+# If no credentials are provided, an anonymous client will be used
+#
+#:appmarket_username:
+#:appmarket_password:
+
+# AppMarket endpoint
+#
+:appmarket_url: https://localhost:6242
\ No newline at end of file
diff --git a/market/sunstone/public/js/user-plugins/appmarket.js b/market/sunstone/public/js/user-plugins/appmarket.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/market/sunstone/public/js/user-plugins/apptools.appmarket-dashboard.js b/market/sunstone/public/js/user-plugins/apptools.appmarket-dashboard.js
index 31e26774af..a59c44d38b 100644
--- a/market/sunstone/public/js/user-plugins/apptools.appmarket-dashboard.js
+++ b/market/sunstone/public/js/user-plugins/apptools.appmarket-dashboard.js
@@ -13,22 +13,54 @@
// limitations under the License. //
//--------------------------------------------------------------------------//
+function updateAppMarketDashboard(what, json_info){
+ var db = $('#appmarket_dashboard_tab',main_tabs_context);
+ switch (what){
+ case "appliances":
+ $('#appmarket_total_appliances',db).html(json_info.length);
+ break;
+ };
+}
+
var appmarket_dashboard_tmpl = '\
\
\
-
\
+
\
+
\
+
\
+
\
+
\
+
' + tr("Summary of AppMarket resources") + '
\
+
\
+\
+
\
+
\
+
Appliances
\
+
\
+
\
+
\
+\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
\
\
\
\
-
' + tr("AppEnv - Image repository") + '
\
+
' + tr("AppMarket") + '
\
\
-\
-
AppMarket builds a centralized catalog of cloud applications. With AppMarket you can build a private repository to share and distribute virtual appliances across OpenNebula instances.
\
-
\
-
\
-
\
-
\
+
\
+ \
+ AppMarket builds a centralized catalog of cloud applications. With AppMarket you can build a private repository to share and distribute virtual appliances across OpenNebula instances.\
+
\
+
'+tr("You can find further information on the following links:")+'