From 355c31501f7ac63a323773a4e4c5f440ad72fad3 Mon Sep 17 00:00:00 2001 From: Claudio-Daniel Freire Date: Thu, 12 May 2011 16:44:36 +0200 Subject: [PATCH] Allow customization of the PLC API to be used for experiments --- src/nepi/testbeds/planetlab/execute.py | 9 ++++++++- src/nepi/testbeds/planetlab/metadata_v01.py | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/nepi/testbeds/planetlab/execute.py b/src/nepi/testbeds/planetlab/execute.py index 47f0550d..d9506f5b 100644 --- a/src/nepi/testbeds/planetlab/execute.py +++ b/src/nepi/testbeds/planetlab/execute.py @@ -31,7 +31,10 @@ class TestbedController(testbed_impl.TestbedController): if self.authUser: self._plapi = plcapi.PLCAPI( username = self.authUser, - password = self.authString) + password = self.authString, + hostname = self.plcHost, + urlpattern = self.plcUrl + ) else: # anonymous access - may not be enough for much self._plapi = plcapi.PLCAPI() @@ -59,6 +62,10 @@ class TestbedController(testbed_impl.TestbedController): get_attribute_value("authPass") self.sliceSSHKey = self._attributes.\ get_attribute_value("sliceSSHKey") + self.plcHost = self._attributes.\ + get_attribute_value("plcHost") + self.plcUrl = self._attributes.\ + get_attribute_value("plcUrl") super(TestbedController, self).do_setup() def do_preconfigure(self): diff --git a/src/nepi/testbeds/planetlab/metadata_v01.py b/src/nepi/testbeds/planetlab/metadata_v01.py index 79d1956d..8b765e66 100644 --- a/src/nepi/testbeds/planetlab/metadata_v01.py +++ b/src/nepi/testbeds/planetlab/metadata_v01.py @@ -1040,6 +1040,22 @@ testbed_attributes = dict({ "flags": Attribute.DesignOnly | Attribute.HasNoDefaultValue, "validation_function": validation.is_string }), + "plc_host": dict({ + "name": "plcHost", + "help": "The PlanetLab PLC API host", + "type": Attribute.STRING, + "value": "www.planet-lab.eu", + "flags": Attribute.DesignOnly, + "validation_function": validation.is_string + }), + "plc_url": dict({ + "name": "plcUrl", + "help": "The PlanetLab PLC API url pattern - %(hostname)s is replaced by plcHost.", + "type": Attribute.STRING, + "value": "https://%(hostname)s:443/PLCAPI/", + "flags": Attribute.DesignOnly, + "validation_function": validation.is_string + }), "slice_ssh_key": dict({ "name": "sliceSSHKey", "help": "The controller-local path to the slice user's ssh private key. " -- 2.47.0