1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-26 06:50:09 +03:00

Feature #4217: Add capabilities to market_mad/one to talk with other

MarketPlaces
This commit is contained in:
Jaime Melis 2016-02-10 15:09:34 +01:00
parent b332b5a4cb
commit 4333bb6da2

View File

@ -20,6 +20,7 @@ require 'net/http'
require 'uri'
require 'json'
require 'base64'
require 'rexml/document'
class OneMarket
ONE_MARKET_URL = 'http://marketplace.opennebula.systems/'
@ -143,6 +144,11 @@ end
################################################################################
# Main Program. Outpust the list of marketplace appliances
################################################################################
drv_message = Base64::decode64(ARGV[0])
doc = REXML::Document.new(drv_message).root
url = doc.elements['MARKETPLACE/TEMPLATE/ENDPOINT'].text rescue nil
#TODO get marketplace URL from MARKETPLACE Templace for other markets
one_market = OneMarket.new
puts one_market.get_appliances()
one_market = OneMarket.new(url)
puts one_market.get_appliances