Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
eb3d09f6
Commit
eb3d09f6
authored
13 years ago
by
Colin Dixon
Browse files
Options
Downloads
Patches
Plain Diff
updated CLI
parent
10b5c915
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/cli.py
+30
-24
30 additions, 24 deletions
example/cli.py
with
30 additions
and
24 deletions
example/cli.py
+
30
−
24
View file @
eb3d09f6
...
@@ -46,45 +46,51 @@ class RestApi(object):
...
@@ -46,45 +46,51 @@ class RestApi(object):
usage_desc
=
"""
usage_desc
=
"""
Command descriptions:
Command descriptions:
host <MAC>
host [debug]
link [tunnellinks]
link
port <blocked | broadcast>
memory
memory
switch
switch
switchclusters
switch_stats [port, queue, flow, aggregate, desc, table, features, host]
counter [DPID] <name>
switch_stats [DPID] <port | queue | flow | aggregate | desc | table | features | host>
per_switch_stats [DPID] [port, queue, flow, aggregate, desc, table, features, host]
"""
"""
def
lookupPath
(
cmd
):
def
lookupPath
(
cmd
):
path
=
''
path
=
''
numargs
=
len
(
args
.
otherargs
)
numargs
=
len
(
args
.
otherargs
)
if
args
.
cmd
==
'
switch_stats
'
and
numargs
==
1
:
if
args
.
cmd
==
'
switch_stats
'
:
path
=
'
/wm/core/switch/all/
'
+
args
.
otherargs
[
0
]
+
'
/json
'
if
numargs
==
1
:
elif
args
.
cmd
==
'
per_switch_stats
'
and
numargs
==
2
:
path
=
'
/wm/core/switch/all/
'
+
args
.
otherargs
[
0
]
+
'
/json
'
path
=
'
/wm/core/switch/
'
+
args
.
ortherargs
[
0
]
+
'
/
'
+
args
.
otherargs
[
1
]
+
'
/json
'
elif
numargs
==
2
:
path
=
'
/wm/core/switch/
'
+
args
.
otherargs
[
0
]
+
'
/
'
+
args
.
otherargs
[
1
]
+
'
/json
'
elif
args
.
cmd
==
'
switch
'
:
elif
args
.
cmd
==
'
switch
'
:
path
=
'
/wm/core/controller/switches/json
'
path
=
'
/wm/core/controller/switches/json
'
elif
args
.
cmd
==
'
counter
'
and
numargs
==
1
:
elif
args
.
cmd
==
'
counter
'
:
path
=
'
/wm/core/counter/
'
+
args
.
otherargs
[
0
]
+
'
/json
'
if
numargs
==
1
:
elif
args
.
cmd
==
'
switch_counter
'
and
numargs
==
2
:
path
=
'
/wm/core/counter/
'
+
args
.
otherargs
[
0
]
+
'
/json
'
path
=
'
/wm/core/counter/
'
+
args
.
otherargs
[
0
]
+
'
/
'
+
otherargs
[
1
]
+
'
/json
'
elif
numargs
==
2
:
path
=
'
/wm/core/counter/
'
+
args
.
otherargs
[
0
]
+
'
/
'
+
args
.
otherargs
[
1
]
+
'
/json
'
elif
args
.
cmd
==
'
memory
'
:
elif
args
.
cmd
==
'
memory
'
:
path
=
'
/wm/core/memory/json
'
path
=
'
/wm/core/memory/json
'
elif
args
.
cmd
==
'
link
'
:
elif
args
.
cmd
==
'
link
'
:
path
=
'
/wm/topology/links/json
'
if
numargs
==
0
:
path
=
'
/wm/topology/links/json
'
elif
numargs
==
1
:
path
=
'
/wm/topology/
'
+
args
.
otherargs
[
0
]
+
'
/json
'
elif
args
.
cmd
==
'
port
'
and
numargs
==
1
:
if
args
.
otherargs
[
0
]
==
"
blocked
"
:
path
=
'
/wm/topology/blockedports/json
'
elif
args
.
otherargs
[
0
]
==
"
broadcast
"
:
path
=
'
/wm/topology/broadcastdomainports/json
'
elif
args
.
cmd
==
'
switchclusters
'
:
elif
args
.
cmd
==
'
switchclusters
'
:
path
=
'
/wm/topology/switchclusters/json
'
path
=
'
/wm/topology/switchclusters/json
'
elif
args
.
cmd
==
'
host
'
:
elif
args
.
cmd
==
'
host
'
:
if
len
(
args
.
otherargs
)
==
0
:
path
=
'
/wm/device/
'
args
.
otherargs
.
append
(
"
all
"
)
if
len
(
args
.
otherargs
)
==
1
and
args
.
otherargs
[
0
]
==
'
debug
'
:
path
=
'
/wm/device
manager/device/
'
+
args
.
otherargs
[
0
]
+
'
/json
'
path
=
'
/wm/device
/debug
'
else
:
else
:
print
usage_desc
print
usage_desc
path
=
''
path
=
''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment