Merge "Adding a new verification job for testapi UI."
[releng.git] / modules / opnfv / deployment / example.py
1 # This is an example of usage of this Tool
2 # Author: Jose Lausuch (jose.lausuch@ericsson.com)
3
4 from opnfv.deployment import factory
5
6 print("########## APEX ##########")
7 handler = factory.Factory.get_handler('apex',
8                                       '192.168.122.135',
9                                       'stack',
10                                       pkey_file='/root/.ssh/id_rsa')
11
12
13 installer_node = handler.get_installer_node()
14 print("Hello, I am node '%s'" % installer_node.run_cmd('hostname'))
15 installer_node.get_file('/home/stack/overcloudrc', './overcloudrc')
16
17 nodes = handler.get_nodes()
18 for node in nodes:
19     print("Hello, I am node '%s' and my ip is %s." %
20           (node.run_cmd('hostname'), node.ip))
21
22 print(handler.get_deployment_info())
23
24
25 print("########## FUEL ##########")
26 # NOTE: If you get traces containing <paramiko.ecdsakey.ECDSAKey object [...]>
27 # make sure 10.20.0.2 is not already in ~/.ssh/known_hosts with another sig
28 handler = factory.Factory.get_handler('fuel',
29                                       '10.20.0.2',
30                                       'ubuntu',
31                                       pkey_file='/var/lib/opnfv/mcp.rsa')
32
33 print(handler.get_deployment_info())
34
35 print("List of nodes in cluster")
36 nodes = handler.get_nodes()
37 for node in nodes:
38     print(node)
39
40
41 print("########## COMPASS ##########")
42 handler = factory.Factory.get_handler('compass',
43                                       '192.168.200.2',
44                                       'root',
45                                       installer_pwd='root')
46
47 print(handler.get_deployment_status())
48 print(handler.get_deployment_info())
49 print('Details of each node:')
50 nodes = handler.nodes
51 for node in nodes:
52     print(node)