Committed by
Gerrit Code Review
[ONOS-3394] JsonModels for Swagger UI
Change-Id: I57503b28df517642ab15e2b18f66ad63c15b7b8a
Showing
9 changed files
with
425 additions
and
1 deletions
... | @@ -68,6 +68,7 @@ public class DhcpWebResource extends AbstractWebResource { | ... | @@ -68,6 +68,7 @@ public class DhcpWebResource extends AbstractWebResource { |
68 | * Get all MAC/IP mappings. | 68 | * Get all MAC/IP mappings. |
69 | * Shows all MAC/IP mappings held by the DHCP server. | 69 | * Shows all MAC/IP mappings held by the DHCP server. |
70 | * | 70 | * |
71 | + * @rsModel DhcpConfigGetMappings | ||
71 | * @return 200 OK | 72 | * @return 200 OK |
72 | */ | 73 | */ |
73 | @GET | 74 | @GET |
... | @@ -89,6 +90,7 @@ public class DhcpWebResource extends AbstractWebResource { | ... | @@ -89,6 +90,7 @@ public class DhcpWebResource extends AbstractWebResource { |
89 | * Get all available IPs. | 90 | * Get all available IPs. |
90 | * Shows all the IPs in the free pool of the DHCP Server. | 91 | * Shows all the IPs in the free pool of the DHCP Server. |
91 | * | 92 | * |
93 | + * @rsModel DhcpConfigGetAvailable | ||
92 | * @return 200 OK | 94 | * @return 200 OK |
93 | */ | 95 | */ |
94 | @GET | 96 | @GET | ... | ... |
... | @@ -46,6 +46,7 @@ public class DevicesWebResource extends AbstractWebResource { | ... | @@ -46,6 +46,7 @@ public class DevicesWebResource extends AbstractWebResource { |
46 | * Returns array of all discovered infrastructure devices. | 46 | * Returns array of all discovered infrastructure devices. |
47 | * | 47 | * |
48 | * @return 200 OK | 48 | * @return 200 OK |
49 | + * @rsModel DevicesGet | ||
49 | */ | 50 | */ |
50 | @GET | 51 | @GET |
51 | public Response getDevices() { | 52 | public Response getDevices() { |
... | @@ -59,6 +60,7 @@ public class DevicesWebResource extends AbstractWebResource { | ... | @@ -59,6 +60,7 @@ public class DevicesWebResource extends AbstractWebResource { |
59 | * | 60 | * |
60 | * @param id device identifier | 61 | * @param id device identifier |
61 | * @return 200 OK | 62 | * @return 200 OK |
63 | + * @rsModel DeviceGet | ||
62 | */ | 64 | */ |
63 | @GET | 65 | @GET |
64 | @Path("{id}") | 66 | @Path("{id}") |
... | @@ -89,6 +91,7 @@ public class DevicesWebResource extends AbstractWebResource { | ... | @@ -89,6 +91,7 @@ public class DevicesWebResource extends AbstractWebResource { |
89 | * Get ports of infrastructure device. | 91 | * Get ports of infrastructure device. |
90 | * Returns details of the specified infrastructure device. | 92 | * Returns details of the specified infrastructure device. |
91 | * | 93 | * |
94 | + * @rsModel DeviceGetPorts | ||
92 | * @param id device identifier | 95 | * @param id device identifier |
93 | * @return 200 OK | 96 | * @return 200 OK |
94 | */ | 97 | */ | ... | ... |
... | @@ -40,7 +40,7 @@ public class NetworkConfigWebResource extends AbstractWebResource { | ... | @@ -40,7 +40,7 @@ public class NetworkConfigWebResource extends AbstractWebResource { |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Get entire network configuration base. | 42 | * Get entire network configuration base. |
43 | - * | 43 | + * @rsModel NetCfgGet |
44 | * @return network configuration JSON | 44 | * @return network configuration JSON |
45 | */ | 45 | */ |
46 | @GET | 46 | @GET |
... | @@ -131,6 +131,7 @@ public class NetworkConfigWebResource extends AbstractWebResource { | ... | @@ -131,6 +131,7 @@ public class NetworkConfigWebResource extends AbstractWebResource { |
131 | /** | 131 | /** |
132 | * Upload bulk network configuration. | 132 | * Upload bulk network configuration. |
133 | * | 133 | * |
134 | + * @rsModel NetCfgGet | ||
134 | * @param request network configuration JSON rooted at the top node | 135 | * @param request network configuration JSON rooted at the top node |
135 | * @return empty response | 136 | * @return empty response |
136 | * @throws IOException if unable to parse the request | 137 | * @throws IOException if unable to parse the request | ... | ... |
1 | +{ | ||
2 | + "type": "object", | ||
3 | + "title": "device", | ||
4 | + "required": [ | ||
5 | + "id", | ||
6 | + "type", | ||
7 | + "available", | ||
8 | + "role", | ||
9 | + "mfr", | ||
10 | + "hw", | ||
11 | + "sw", | ||
12 | + "serial", | ||
13 | + "chassisId", | ||
14 | + "annotations" | ||
15 | + ], | ||
16 | + "properties": { | ||
17 | + "id": { | ||
18 | + "type": "string", | ||
19 | + "example": "of:0000000000000001" | ||
20 | + }, | ||
21 | + "type": { | ||
22 | + "type": "string", | ||
23 | + "example": "SWITCH" | ||
24 | + }, | ||
25 | + "available": { | ||
26 | + "type": "boolean", | ||
27 | + "example": true | ||
28 | + }, | ||
29 | + "role": { | ||
30 | + "type": "string", | ||
31 | + "example": "of:0000000000000001" | ||
32 | + }, | ||
33 | + "mfr": { | ||
34 | + "type": "string", | ||
35 | + "example": "Nicira, Inc." | ||
36 | + }, | ||
37 | + "hw": { | ||
38 | + "type": "string", | ||
39 | + "example": "Open vSwitch" | ||
40 | + }, | ||
41 | + "sw": { | ||
42 | + "type": "string", | ||
43 | + "example": "2.3.1" | ||
44 | + }, | ||
45 | + "serial": { | ||
46 | + "type": "string", | ||
47 | + "example": "123" | ||
48 | + }, | ||
49 | + "chassisId": { | ||
50 | + "type": "string", | ||
51 | + "example": "1" | ||
52 | + }, | ||
53 | + "annotations": { | ||
54 | + "type": "object", | ||
55 | + "title": "annotations", | ||
56 | + "required": [ | ||
57 | + "managementAddress", | ||
58 | + "protocol", | ||
59 | + "channelId" | ||
60 | + ], | ||
61 | + "properties": { | ||
62 | + "managementAddress": { | ||
63 | + "type": "string", | ||
64 | + "example": "123" | ||
65 | + }, | ||
66 | + "protocol": { | ||
67 | + "type": "string", | ||
68 | + "example": "OF_13" | ||
69 | + }, | ||
70 | + "channelId": { | ||
71 | + "type": "string", | ||
72 | + "example": "10.128.12.4:34689" | ||
73 | + } | ||
74 | + } | ||
75 | + } | ||
76 | + } | ||
77 | +} |
1 | +{ | ||
2 | + "type": "object", | ||
3 | + "title": "device", | ||
4 | + "required": [ | ||
5 | + "id", | ||
6 | + "type", | ||
7 | + "available", | ||
8 | + "role", | ||
9 | + "mfr", | ||
10 | + "hw", | ||
11 | + "sw", | ||
12 | + "serial", | ||
13 | + "chassisId", | ||
14 | + "annotations" | ||
15 | + ], | ||
16 | + "properties": { | ||
17 | + "id": { | ||
18 | + "type": "string", | ||
19 | + "example": "of:0000000000000001" | ||
20 | + }, | ||
21 | + "type": { | ||
22 | + "type": "string", | ||
23 | + "example": "SWITCH" | ||
24 | + }, | ||
25 | + "available": { | ||
26 | + "type": "boolean", | ||
27 | + "example": true | ||
28 | + }, | ||
29 | + "role": { | ||
30 | + "type": "string", | ||
31 | + "example": "of:0000000000000001" | ||
32 | + }, | ||
33 | + "mfr": { | ||
34 | + "type": "string", | ||
35 | + "example": "Nicira, Inc." | ||
36 | + }, | ||
37 | + "hw": { | ||
38 | + "type": "string", | ||
39 | + "example": "Open vSwitch" | ||
40 | + }, | ||
41 | + "sw": { | ||
42 | + "type": "string", | ||
43 | + "example": "2.3.1" | ||
44 | + }, | ||
45 | + "serial": { | ||
46 | + "type": "string", | ||
47 | + "example": "123" | ||
48 | + }, | ||
49 | + "chassisId": { | ||
50 | + "type": "string", | ||
51 | + "example": "1" | ||
52 | + }, | ||
53 | + "annotations": { | ||
54 | + "type": "object", | ||
55 | + "title": "annotations", | ||
56 | + "required": [ | ||
57 | + "managementAddress", | ||
58 | + "protocol", | ||
59 | + "channelId" | ||
60 | + ], | ||
61 | + "properties": { | ||
62 | + "managementAddress": { | ||
63 | + "type": "string", | ||
64 | + "example": "123" | ||
65 | + }, | ||
66 | + "protocol": { | ||
67 | + "type": "string", | ||
68 | + "example": "OF_13" | ||
69 | + }, | ||
70 | + "channelId": { | ||
71 | + "type": "string", | ||
72 | + "example": "10.128.12.4:34689" | ||
73 | + } | ||
74 | + } | ||
75 | + }, | ||
76 | + "ports": { | ||
77 | + "type": "array", | ||
78 | + "xml": { | ||
79 | + "name": "port", | ||
80 | + "wrapped": true | ||
81 | + }, | ||
82 | + "items": { | ||
83 | + "type": "object", | ||
84 | + "title": "port", | ||
85 | + "required": [ | ||
86 | + "element", | ||
87 | + "port", | ||
88 | + "isEnabled", | ||
89 | + "type", | ||
90 | + "portSpeed", | ||
91 | + "annotations" | ||
92 | + ], | ||
93 | + "properties": { | ||
94 | + "element": { | ||
95 | + "type": "string", | ||
96 | + "example": "of:0000000000000001" | ||
97 | + }, | ||
98 | + "port": { | ||
99 | + "type": "string", | ||
100 | + "example": "2" | ||
101 | + }, | ||
102 | + "isEnabled": { | ||
103 | + "type": "boolean", | ||
104 | + "example": true | ||
105 | + }, | ||
106 | + "type": { | ||
107 | + "type": "string", | ||
108 | + "example": "copper" | ||
109 | + }, | ||
110 | + "portSpeed": { | ||
111 | + "type": "integer", | ||
112 | + "format": "int64", | ||
113 | + "example": 0 | ||
114 | + }, | ||
115 | + "annotations": { | ||
116 | + "type": "object", | ||
117 | + "title": "annotations", | ||
118 | + "required": [ | ||
119 | + "portName" | ||
120 | + ], | ||
121 | + "properties": { | ||
122 | + "portName": { | ||
123 | + "type": "string", | ||
124 | + "example": "s1" | ||
125 | + } | ||
126 | + } | ||
127 | + } | ||
128 | + } | ||
129 | + } | ||
130 | + } | ||
131 | + } | ||
132 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +{ | ||
2 | + "type": "array", | ||
3 | + "xml": { | ||
4 | + "name": "device", | ||
5 | + "wrapped": true | ||
6 | + }, | ||
7 | + "items": { | ||
8 | + "type": "object", | ||
9 | + "title": "device", | ||
10 | + "required": [ | ||
11 | + "id", | ||
12 | + "type", | ||
13 | + "available", | ||
14 | + "role", | ||
15 | + "mfr", | ||
16 | + "hw", | ||
17 | + "sw", | ||
18 | + "serial", | ||
19 | + "chassisId", | ||
20 | + "annotations" | ||
21 | + ], | ||
22 | + "properties": { | ||
23 | + "id": { | ||
24 | + "type": "string", | ||
25 | + "example": "of:0000000000000001" | ||
26 | + }, | ||
27 | + "type": { | ||
28 | + "type": "string", | ||
29 | + "example": "SWITCH" | ||
30 | + }, | ||
31 | + "available": { | ||
32 | + "type": "boolean", | ||
33 | + "example": true | ||
34 | + }, | ||
35 | + "role": { | ||
36 | + "type": "string", | ||
37 | + "example": "of:0000000000000001" | ||
38 | + }, | ||
39 | + "mfr": { | ||
40 | + "type": "string", | ||
41 | + "example": "Nicira, Inc." | ||
42 | + }, | ||
43 | + "hw": { | ||
44 | + "type": "string", | ||
45 | + "example": "Open vSwitch" | ||
46 | + }, | ||
47 | + "sw": { | ||
48 | + "type": "string", | ||
49 | + "example": "2.3.1" | ||
50 | + }, | ||
51 | + "serial": { | ||
52 | + "type": "string", | ||
53 | + "example": "123" | ||
54 | + }, | ||
55 | + "chassisId": { | ||
56 | + "type": "string", | ||
57 | + "example": "1" | ||
58 | + }, | ||
59 | + "annotations": { | ||
60 | + "type": "object", | ||
61 | + "title": "annotations", | ||
62 | + "required": [ | ||
63 | + "managementAddress", | ||
64 | + "protocol", | ||
65 | + "channelId" | ||
66 | + ], | ||
67 | + "properties": { | ||
68 | + "managementAddress": { | ||
69 | + "type": "string", | ||
70 | + "example": "123" | ||
71 | + }, | ||
72 | + "protocol": { | ||
73 | + "type": "string", | ||
74 | + "example": "OF_13" | ||
75 | + }, | ||
76 | + "channelId": { | ||
77 | + "type": "string", | ||
78 | + "example": "10.128.12.4:34689" | ||
79 | + } | ||
80 | + } | ||
81 | + } | ||
82 | + } | ||
83 | + } | ||
84 | +} |
1 | +{ | ||
2 | + "type": "object", | ||
3 | + "required": [ | ||
4 | + "apps", | ||
5 | + "links", | ||
6 | + "domains", | ||
7 | + "hosts", | ||
8 | + "ports", | ||
9 | + "devices" | ||
10 | + ], | ||
11 | + "properties": { | ||
12 | + "apps": { | ||
13 | + "type": "object" | ||
14 | + }, | ||
15 | + "links": { | ||
16 | + "title": "links", | ||
17 | + "type": "object", | ||
18 | + "properties": { | ||
19 | + "deviceId/port-deviceId/port": { | ||
20 | + "title": "basic", | ||
21 | + "type": "object", | ||
22 | + "required": [ | ||
23 | + "basic" | ||
24 | + ], | ||
25 | + "properties": { | ||
26 | + "basic": { | ||
27 | + "title": "basic", | ||
28 | + "type": "object", | ||
29 | + "properties": { | ||
30 | + "allowed": { | ||
31 | + "type": "boolean", | ||
32 | + "example": true | ||
33 | + } | ||
34 | + } | ||
35 | + } | ||
36 | + } | ||
37 | + } | ||
38 | + } | ||
39 | + }, | ||
40 | + "domains": { | ||
41 | + "type": "object" | ||
42 | + }, | ||
43 | + "hosts": { | ||
44 | + "type": "object" | ||
45 | + }, | ||
46 | + "ports": { | ||
47 | + "type": "object" | ||
48 | + }, | ||
49 | + "devices": { | ||
50 | + "title": "Devices", | ||
51 | + "type": "object", | ||
52 | + "required": [ | ||
53 | + "deviceId" | ||
54 | + ], | ||
55 | + "properties": { | ||
56 | + "deviceId": { | ||
57 | + "title": "basic", | ||
58 | + "type": "object", | ||
59 | + "required": [ | ||
60 | + "basic" | ||
61 | + ], | ||
62 | + "properties": { | ||
63 | + "basic": { | ||
64 | + "title": "basicDevice", | ||
65 | + "type": "object", | ||
66 | + "required": [ | ||
67 | + "allowed" | ||
68 | + ], | ||
69 | + "properties": { | ||
70 | + "allowed": { | ||
71 | + "type": "boolean", | ||
72 | + "example": true | ||
73 | + }, | ||
74 | + "name": { | ||
75 | + "type": "string", | ||
76 | + "example": "DeviceName" | ||
77 | + }, | ||
78 | + "owner": { | ||
79 | + "type": "string", | ||
80 | + "example": "OwnerName" | ||
81 | + }, | ||
82 | + "latitude": { | ||
83 | + "type": "string", | ||
84 | + "example": "25" | ||
85 | + } | ||
86 | + } | ||
87 | + } | ||
88 | + } | ||
89 | + } | ||
90 | + } | ||
91 | + } | ||
92 | + } | ||
93 | +} |
-
Please register or login to post a comment