Jian Li
Committed by Gerrit Code Review

[ONOS-3601] Bugfix: resolve swagger doc issue of metric REST API

Change-Id: I76f04fbd3e7ed6aa2ab35dcb39bcbeacc9675282
...@@ -2,113 +2,19 @@ ...@@ -2,113 +2,19 @@
2 "type": "object", 2 "type": "object",
3 "title": "metric", 3 "title": "metric",
4 "required": [ 4 "required": [
5 - "name",
6 "metric" 5 "metric"
7 ], 6 ],
8 "properties": { 7 "properties": {
9 - "name": {
10 - "type": "string",
11 - "example": "cpu"
12 - },
13 "metric": { 8 "metric": {
14 "type": "object", 9 "type": "object",
15 - "title": "metric", 10 + "title": "property",
16 "optional": [ 11 "optional": [
17 - "counter", 12 + "type"
18 - "gauge",
19 - "meter",
20 - "histogram",
21 - "timer"
22 ], 13 ],
23 "properties": { 14 "properties": {
24 - "counter": {
25 - "type": "object",
26 - "required": [
27 - "counter"
28 - ],
29 - "properties": {
30 - "counter": {
31 - "type": "integer",
32 - "example": "1"
33 - }
34 - }
35 - },
36 - "gauge": {
37 - "type": "object",
38 - "required": [
39 - "value"
40 - ],
41 - "properties": {
42 - "value": "string",
43 - "example": "1"
44 - }
45 - },
46 - "meter": {
47 - "type": "object",
48 - "required": [
49 - "counter",
50 - "mean_rate",
51 - "1_min_rate",
52 - "5_min_rate",
53 - "15_min_rate"
54 - ],
55 - "properties": {
56 - "counter": {
57 - "type": "integer",
58 - "example": "1"
59 - },
60 - "mean_rate": {
61 - "type": "double",
62 - "example": "1.0"
63 - },
64 - "1_min_rate": {
65 - "type": "double",
66 - "example": "1.0"
67 - },
68 - "5_min_rate": {
69 - "type": "double",
70 - "example": "1.0"
71 - },
72 - "15_min_rate": {
73 - "type": "double",
74 - "example": "1.0"
75 - }
76 - }
77 - },
78 - "histogram": {
79 - "type": "object",
80 - "required": [
81 - "counter",
82 - "mean",
83 - "min",
84 - "max",
85 - "stddev"
86 - ],
87 - "properties": {
88 - "counter": {
89 - "type": "integer",
90 - "example": "1"
91 - },
92 - "mean": {
93 - "type": "double",
94 - "example": "1.0"
95 - },
96 - "min": {
97 - "type": "double",
98 - "example": "1.0"
99 - },
100 - "max": {
101 - "type": "double",
102 - "example": "1.0"
103 - },
104 - "stddev": {
105 - "type": "double",
106 - "example": "1.0"
107 - }
108 - }
109 - },
110 "timer": { 15 "timer": {
111 "type": "object", 16 "type": "object",
17 + "title": "timer",
112 "required": [ 18 "required": [
113 "counter", 19 "counter",
114 "mean_rate", 20 "mean_rate",
......
...@@ -8,119 +8,26 @@ ...@@ -8,119 +8,26 @@
8 "metrics": { 8 "metrics": {
9 "type": "array", 9 "type": "array",
10 "xml": { 10 "xml": {
11 - "name": "metrics", 11 + "name": "metric",
12 "wrapped": true 12 "wrapped": true
13 }, 13 },
14 "items": { 14 "items": {
15 "type": "object", 15 "type": "object",
16 "title": "metric", 16 "title": "metric",
17 "required": [ 17 "required": [
18 - "name",
19 "metric" 18 "metric"
20 ], 19 ],
21 "properties": { 20 "properties": {
22 - "name": {
23 - "type": "string",
24 - "example": "cpu"
25 - },
26 "metric": { 21 "metric": {
27 "type": "object", 22 "type": "object",
23 + "title": "property",
28 "optional": [ 24 "optional": [
29 - "counter", 25 + "type"
30 - "gauge",
31 - "meter",
32 - "histogram",
33 - "timer"
34 ], 26 ],
35 "properties": { 27 "properties": {
36 - "counter": {
37 - "type": "object",
38 - "required": [
39 - "counter"
40 - ],
41 - "properties": {
42 - "counter": {
43 - "type": "integer",
44 - "example": "1"
45 - }
46 - }
47 - },
48 - "gauge": {
49 - "type": "object",
50 - "required": [
51 - "value"
52 - ],
53 - "properties": {
54 - "value": "string",
55 - "example": "1"
56 - }
57 - },
58 - "meter": {
59 - "type": "object",
60 - "required": [
61 - "counter",
62 - "mean_rate",
63 - "1_min_rate",
64 - "5_min_rate",
65 - "15_min_rate"
66 - ],
67 - "properties": {
68 - "counter": {
69 - "type": "integer",
70 - "example": "1"
71 - },
72 - "mean_rate": {
73 - "type": "double",
74 - "example": "1.0"
75 - },
76 - "1_min_rate": {
77 - "type": "double",
78 - "example": "1.0"
79 - },
80 - "5_min_rate": {
81 - "type": "double",
82 - "example": "1.0"
83 - },
84 - "15_min_rate": {
85 - "type": "double",
86 - "example": "1.0"
87 - }
88 - }
89 - },
90 - "histogram": {
91 - "type": "object",
92 - "required": [
93 - "counter",
94 - "mean",
95 - "min",
96 - "max",
97 - "stddev"
98 - ],
99 - "properties": {
100 - "counter": {
101 - "type": "integer",
102 - "example": "1"
103 - },
104 - "mean": {
105 - "type": "double",
106 - "example": "1.0"
107 - },
108 - "min": {
109 - "type": "double",
110 - "example": "1.0"
111 - },
112 - "max": {
113 - "type": "double",
114 - "example": "1.0"
115 - },
116 - "stddev": {
117 - "type": "double",
118 - "example": "1.0"
119 - }
120 - }
121 - },
122 "timer": { 28 "timer": {
123 "type": "object", 29 "type": "object",
30 + "title": "timer",
124 "required": [ 31 "required": [
125 "counter", 32 "counter",
126 "mean_rate", 33 "mean_rate",
......