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