blob: d0383ca20a3d02b3e435e5d4cd757edf81bd7287 [file] [log] [blame]
Srikanth Vavilapalli1725e492014-12-01 17:50:52 -08001#
2# Copyright (c) 2013 Big Switch Networks, Inc.
3#
4# Licensed under the Eclipse Public License, Version 1.0 (the
5# "License"); you may not use this file except in compliance with the
6# License. You may obtain a copy of the License at
7#
8# http://www.eclipse.org/legal/epl-v10.html
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied. See the License for the specific language governing
14# permissions and limitations under the License.
15#
16import fmtcnv
17SWITCH_ROUTER_COMMAND_DESCRIPTION = {
18 'name' : 'show',
19 'mode' : 'login',
20 'command-type' : 'display-table',
21 'all-help' : 'Show switch information',
22 'short-help' : 'Show switch summary',
23 #'obj-type' : 'switches',
24 'doc' : 'switch|show',
25 'doc-example' : 'switch|show-example',
26 'args' : (
27 {
28 'token' : 'router',
29 'field' : 'router',
30 'action' : 'display-rest',
31 'sort' : ['dpid',],
32 'doc' : 'switch|show',
33 'url' : [
34 'routers',
35 ],
36 'format' : 'router',
37 },
38 )
39}
40
41
42
43ROUTER_SHOW_REALTIME_STATS_COMMAND_DESCRIPTION = {
44 'name' : 'show',
45 'mode' : 'login',
46 'short-help' : 'Show router stats via direct query to switch',
47 'no-supported' : False,
48 'short-help' : 'Show realtime stats for router',
49 'parent-field' : None,
50 'obj-type' : 'switches',
51 'args' : (
52 {
53 'token' : 'router',
54 'obj-type' : 'switches',
55 'command-type' : 'display-table',
56 # 'command-type' : 'display-rest',
57 },
58 {
59 'choices' : (
60 {
61 'field' : 'dpid',
62 'completion' : 'complete-alias-choice',
63 'type' : 'dpid',
64 'help-name' : 'switch dpid or alias',
65 'data-handler' : 'alias-to-value',
66 'data' : { 'detail' : 'scoped' },
67 },
68 {
69 'token' : 'all',
70 'doc' : 'reserved|all',
71 },
72 ),
73 },
74 {
75 'choices' : (
76 (
77 {
78 'field' : 'routerrealtimestats',
79 'type' : 'enum',
80 'values' : (
81 'port', 'adjacency'
82 ),
83 'action' : 'display-rest',
84 'sort' : ['portNo'],
85 'url' : 'router/%(dpid)s/%(routerrealtimestats)s',
86 'rest-type' : 'dict-of-list-of-switch',
87 'format' : 'router_%(routerrealtimestats)s',
88 'short-help' : 'Show requested item by querying router/switch',
89 'doc' : 'switch|realtime-+',
90 },
91 {
92 'field' : 'detail',
93 'optional' : True,
94 'type' : 'enum',
95 'values' : ('details','brief'),
96 'doc' : 'format|+',
97 },
98 ),
99
100 )
101 }
102 )
103}