aboutsummaryrefslogtreecommitdiffstats
path: root/opnfv/deployment/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'opnfv/deployment/example.py')
-rw-r--r--opnfv/deployment/example.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/opnfv/deployment/example.py b/opnfv/deployment/example.py
new file mode 100644
index 0000000..6a76eb9
--- /dev/null
+++ b/opnfv/deployment/example.py
@@ -0,0 +1,21 @@
+# This is an example of usage of this Tool
+# Author: Jose Lausuch (jose.lausuch@ericsson.com)
+
+from opnfv.deployment import factory
+
+handler = factory.Factory.get_handler('apex',
+ '192.168.122.135',
+ 'stack',
+ pkey_file='/root/.ssh/id_rsa')
+
+
+installer_node = handler.get_installer_node()
+print("Hello, I am node '%s'" % installer_node.run_cmd('hostname'))
+installer_node.get_file('/home/stack/overcloudrc', './overcloudrc')
+
+nodes = handler.get_nodes()
+for node in nodes:
+ print("Hello, I am node '%s' and my ip is %s." %
+ (node.run_cmd('hostname'), node.ip))
+
+print handler.get_deployment_info()