projects
/
osm
/
vim-emu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix issues with installing docker management networks
[osm/vim-emu.git]
/
src
/
emuvim
/
cli
/
rest
/
network.py
diff --git
a/src/emuvim/cli/rest/network.py
b/src/emuvim/cli/rest/network.py
index
c87a924
..
91051dd
100755
(executable)
--- a/
src/emuvim/cli/rest/network.py
+++ b/
src/emuvim/cli/rest/network.py
@@
-26,10
+26,8
@@
acknowledge the contributions of their colleagues of the SONATA
partner consortium (www.sonata-nfv.eu).
"""
from requests import get,put, delete
partner consortium (www.sonata-nfv.eu).
"""
from requests import get,put, delete
-from tabulate import tabulate
import pprint
import argparse
import pprint
import argparse
-import json
pp = pprint.PrettyPrinter(indent=4)
pp = pprint.PrettyPrinter(indent=4)
@@
-55,13
+53,14
@@
class RestApiClient():
weight=args.get("weight"),
match=args.get("match"),
bidirectional=args.get("bidirectional"),
weight=args.get("weight"),
match=args.get("match"),
bidirectional=args.get("bidirectional"),
- cookie=args.get("cookie"))
+ cookie=args.get("cookie"),
+ priority=args.get("priority"))
response = put("%s/restapi/network/%s/%s" %
(args.get("endpoint"),
vnf_src_name,
vnf_dst_name),
response = put("%s/restapi/network/%s/%s" %
(args.get("endpoint"),
vnf_src_name,
vnf_dst_name),
- json=
json.dumps(params)
)
+ json=
params
)
pp.pprint(response.json())
def remove(self, args):
pp.pprint(response.json())
def remove(self, args):
@@
-74,13
+73,14
@@
class RestApiClient():
weight=args.get("weight"),
match=args.get("match"),
bidirectional=args.get("bidirectional"),
weight=args.get("weight"),
match=args.get("match"),
bidirectional=args.get("bidirectional"),
- cookie=args.get("cookie"))
+ cookie=args.get("cookie"),
+ priority=args.get("priority"))
response = delete("%s/restapi/network/%s/%s" %
(args.get("endpoint"),
vnf_src_name,
vnf_dst_name),
response = delete("%s/restapi/network/%s/%s" %
(args.get("endpoint"),
vnf_src_name,
vnf_dst_name),
- json=
json.dumps(params)
)
+ json=
params
)
pp.pprint(response.json())
def _parse_vnf_name(self, vnf_name_str):
pp.pprint(response.json())
def _parse_vnf_name(self, vnf_name_str):
@@
-114,13
+114,15
@@
parser.add_argument(
help="vnf name of the destination of the chain")
parser.add_argument(
"--weight", "-w", dest="weight",
help="vnf name of the destination of the chain")
parser.add_argument(
"--weight", "-w", dest="weight",
- help="weight metric to calculate the path")
+ help="weight edge attribute to calculate the path")
+parser.add_argument(
+ "--priority", "-p", dest="priority", default="0",
+ help="priority of flow rule")
parser.add_argument(
"--match", "-m", dest="match",
help="string holding extra matches for the flow entries")
parser.add_argument(
parser.add_argument(
"--match", "-m", dest="match",
help="string holding extra matches for the flow entries")
parser.add_argument(
- "--bidirectional", "-b", dest="bidirectional",
- action='store_true',
+ "--bidirectional", "-b", dest="bidirectional", action='store_true',
help="add/remove the flow entries from src to dst and back")
parser.add_argument(
"--cookie", "-c", dest="cookie",
help="add/remove the flow entries from src to dst and back")
parser.add_argument(
"--cookie", "-c", dest="cookie",
@@
-133,4
+135,4
@@
parser.add_argument(
def main(argv):
args = vars(parser.parse_args(argv))
c = RestApiClient()
def main(argv):
args = vars(parser.parse_args(argv))
c = RestApiClient()
- c.execute_command(args)
\ No newline at end of file
+ c.execute_command(args)