b742339d730e1fb2f6d13733f443fe10e305f037
[osm/osmclient.git] / README.md
1 # python-osmclient
2 A python client for osm orchestration
3
4
5 # Installation
6
7 ## Install dependencies
8 ```bash
9 sudo apt-get install python-dev libcurl4-gnutls-dev python-pip libgnutls-dev python-prettytable   
10 sudo pip install pycurl
11 ```
12
13 ## Install python-osmclient
14     sudo pip install git+https://github.com/mfmarche/python-osmclient
15
16 # Setup
17 Set the OSM_HOSTNAME variable to the host of the osm server.
18
19 Example
20 ```bash
21 localhost$ export OSM_HOSTNAME=<hostname>:8008
22 ```
23
24 # Examples 
25
26 ## upload vnfd
27 ```bash
28 localhost$ osm upload-package ubuntu_xenial_vnf.tar.gz
29 {'transaction_id': 'ec12af77-1b91-4c84-b233-60f2c2c16d14'}
30 localhost$ osm vnfd-list
31 +--------------------+--------------------+
32 | vnfd name          | id                 |
33 +--------------------+--------------------+
34 | ubuntu_xenial_vnfd | ubuntu_xenial_vnfd |
35 +--------------------+--------------------+
36 ```
37
38 ## upload nsd
39 ```bash
40 localhost$ osm upload-package ubuntu_xenial_ns.tar.gz
41 {'transaction_id': 'b560c9cb-43e1-49ef-a2da-af7aab24ce9d'}
42 localhost$ osm nsd-list
43 +-------------------+-------------------+
44 | nsd name          | id                |
45 +-------------------+-------------------+
46 | ubuntu_xenial_nsd | ubuntu_xenial_nsd |
47 +-------------------+-------------------+
48 ```
49 ## vim-list
50
51 ```bash
52 localhost$ osm vim-list
53 +-------------+-----------------+--------------------------------------+
54 | ro-account  | datacenter name | uuid                                 |
55 +-------------+-----------------+--------------------------------------+
56 | osmopenmano | openstack-site  | 2ea04690-0e4a-11e7-89bc-00163e59ff0c |
57 +-------------+-----------------+--------------------------------------+
58 ```
59
60
61 ## instantiate ns
62 ```bash
63 localhost$ osm ns-create ubuntu_xenial_nsd testns openstack-site
64 {'success': ''}
65 localhost$ osm ns-list
66 +------------------+--------------------------------------+-------------------+--------------------+---------------+
67 | ns instance name | id                                   | catalog name      | operational status | config status |
68 +------------------+--------------------------------------+-------------------+--------------------+---------------+
69 | testns           | 6b0d2906-13d4-11e7-aa01-b8ac6f7d0c77 | ubuntu_xenial_nsd | running            | configured    |
70 +------------------+--------------------------------------+-------------------+--------------------+---------------+
71 ```
72
73 # Bash Completion
74 python-osmclient uses [click](http://click.pocoo.org/5/).  You can setup bash completion by putting this in your .bashrc:
75     
76     eval "$(_OSM_COMPLETE=source osm)"
77