Examples PL and Wilab sfa
[nepi.git] / examples / omf / wilabt_provision.py
1 #!/usr/bin/env python
2 #
3 #    NEPI, a framework to manage network experiments
4 #    Copyright (C) 2013 INRIA
5 #
6 #    This program is free software: you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation, either version 3 of the License, or
9 #    (at your option) any later version.
10 #
11 #    This program is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 # Author: Lucia Guevgeozian <lucia.guevgeozian_odizzio@inria.fr>
20
21 from nepi.execution.ec import ExperimentController
22 import os
23
24 # Create the EC
25 exp_id = "sfa_test"
26 ec = ExperimentController(exp_id)
27
28 slicename = 'ple.inria.lguevgeo'
29 sfauser = os.environ.get('SFA_USER')
30 sfaPrivateKey = os.environ.get('SFA_PK')
31
32 # nodes
33 node1 = ec.register_resource("WilabtSfaNode")
34 ec.set(node1, "hostname", 'zotacB5')
35 ec.set(node1, "slicename", slicename)
36 ec.set(node1, "sfauser", sfauser)
37 ec.set(node1, "sfaPrivateKey", sfaPrivateKey)
38 ec.set(node1, "gatewayUser", "nepi")
39 ec.set(node1, "gateway", "bastion.test.iminds.be")
40 ec.set(node1, "cleanHome", True)
41 ec.set(node1, "cleanProcesses", True)
42
43 node2 = ec.register_resource("WilabtSfaNode")
44 ec.set(node2, "hostname", 'zotacM20')
45 ec.set(node2, "slicename", slicename)
46 ec.set(node2, "sfauser", sfauser)
47 ec.set(node2, "sfaPrivateKey", sfaPrivateKey)
48 ec.set(node2, "gatewayUser", "nepi")
49 ec.set(node2, "gateway", "bastion.test.iminds.be")
50 ec.set(node2, "cleanHome", True)
51 ec.set(node2, "cleanProcesses", True)
52
53 # Deploy
54 ec.deploy()
55
56 ec.wait_deployed([node1, node2])
57
58 ec.shutdown()
59
60 # End