1
+ syntax = "proto3" ;
2
+
3
+ package spaceone.api.inventory_v2.v1 ;
4
+
5
+ import "google/protobuf/empty.proto" ;
6
+ import "google/protobuf/struct.proto" ;
7
+ import "google/api/annotations.proto" ;
8
+ import "spaceone/api/core/v2/query.proto" ;
9
+
10
+ option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/inventory_v2/v1" ;
11
+
12
+ service Metric {
13
+ rpc create (CreateMetricRequest ) returns (MetricInfo ) {
14
+ option (google.api.http ) = {
15
+ post : "/inventory-v2/v1/metric/create"
16
+ body : "*"
17
+ };
18
+ }
19
+
20
+ rpc update (UpdateMetricRequest ) returns (MetricInfo ) {
21
+ option (google.api.http ) = {
22
+ post : "/inventory-v2/v1/metric/update"
23
+ body : "*"
24
+ };
25
+ }
26
+
27
+ rpc delete (MetricRequest ) returns (google .protobuf .Empty ) {
28
+ option (google.api.http ) = {
29
+ post : "/inventory-v2/v1/metric/delete"
30
+ body : "*"
31
+ };
32
+ }
33
+
34
+ rpc run (MetricRequest ) returns (google .protobuf .Empty ) {
35
+ option (google.api.http ) = {
36
+ post : "/inventory-v2/v1/metric/run"
37
+ body : "*"
38
+ };
39
+ }
40
+
41
+ rpc test (MetricTestRequest ) returns (google .protobuf .Struct ) {
42
+ option (google.api.http ) = {
43
+ post : "/inventory-v2/v1/metric/test"
44
+ body : "*"
45
+ };
46
+ }
47
+
48
+ rpc get (MetricRequest ) returns (MetricInfo ) {
49
+ option (google.api.http ) = {
50
+ post : "/inventory-v2/v1/metric/get"
51
+ body : "*"
52
+ };
53
+ }
54
+
55
+ rpc list (MetricQuery ) returns (MetricsInfo ) {
56
+ option (google.api.http ) = {
57
+ post : "/inventory-v2/v1/metric/list"
58
+ body : "*"
59
+ };
60
+ }
61
+
62
+ rpc stat (MetricStatQuery ) returns (google .protobuf .Struct ) {
63
+ option (google.api.http ) = {
64
+ post : "/inventory-v2/v1/metric/stat"
65
+ body : "*"
66
+ };
67
+ }
68
+ }
69
+
70
+ enum MetricType {
71
+ METRIC_TYPE_NONE = 0 ;
72
+ COUNTER = 1 ;
73
+ GAUGE = 2 ;
74
+ }
75
+
76
+ //{
77
+ //
78
+ //}
79
+ message CreateMetricRequest {
80
+ enum ResourceGroup {
81
+ RESOURCE_GROUP_NONE = 0 ;
82
+ DOMAIN = 1 ;
83
+ WORKSPACE = 2 ;
84
+ }
85
+
86
+ // +optional
87
+ string metric_id = 1 ;
88
+ string name = 2 ;
89
+ MetricType metric_type = 3 ;
90
+ // +optional
91
+ string resource_type = 4 ;
92
+ spaceone.api.core.v2.AnalyzeQuery query_options = 5 ;
93
+ // +optional
94
+ string date_field = 6 ;
95
+ // +optional
96
+ string unit = 7 ;
97
+ // +optional
98
+ google.protobuf.Struct tags = 8 ;
99
+ string namespace_id = 9 ;
100
+ ResourceGroup resource_group = 20 ;
101
+ // +optional
102
+ string workspace_id = 21 ;
103
+ }
104
+
105
+ //{
106
+ //
107
+ //}
108
+ message UpdateMetricRequest {
109
+ string metric_id = 1 ;
110
+ // +optional
111
+ string name = 2 ;
112
+ // +optional
113
+ spaceone.api.core.v2.AnalyzeQuery query_options = 3 ;
114
+ // +optional
115
+ string date_field = 4 ;
116
+ // +optional
117
+ string unit = 5 ;
118
+ // +optional
119
+ google.protobuf.Struct tags = 6 ;
120
+ }
121
+
122
+ //{
123
+ //
124
+ //}
125
+ message MetricRequest {
126
+ string metric_id = 1 ;
127
+ }
128
+
129
+ //{
130
+ //
131
+ //}
132
+ message MetricTestRequest {
133
+ string metric_id = 1 ;
134
+ spaceone.api.core.v2.AnalyzeQuery query_options = 2 ;
135
+ }
136
+
137
+ //{
138
+ //
139
+ //}
140
+ message MetricQuery {
141
+ // +optional
142
+ spaceone.api.core.v2.Query query = 1 ;
143
+ // +optional
144
+ string metric_id = 2 ;
145
+ // +optional
146
+ MetricType metric_type = 3 ;
147
+ // +optional
148
+ string resource_type = 4 ;
149
+ // +optional
150
+ string is_managed = 5 ;
151
+ // +optional
152
+ string namespace_id = 21 ;
153
+ }
154
+
155
+ //{
156
+ //
157
+ //}
158
+ message MetricInfo {
159
+ enum ResourceGroup {
160
+ RESOURCE_GROUP_NONE = 0 ;
161
+ DOMAIN = 1 ;
162
+ WORKSPACE = 2 ;
163
+ }
164
+
165
+ string metric_id = 1 ;
166
+ string name = 2 ;
167
+ MetricType metric_type = 3 ;
168
+ string resource_type = 4 ;
169
+ spaceone.api.core.v2.AnalyzeQuery query_options = 5 ;
170
+ string date_field = 6 ;
171
+ string unit = 7 ;
172
+ google.protobuf.Struct tags = 8 ;
173
+ repeated google.protobuf.Struct labels_info = 9 ;
174
+ bool is_managed = 10 ;
175
+
176
+ ResourceGroup resource_group = 20 ;
177
+ string domain_id = 21 ;
178
+ string workspace_id = 22 ;
179
+ string namespace_id = 23 ;
180
+
181
+ string created_at = 31 ;
182
+ string updated_at = 32 ;
183
+ }
184
+
185
+
186
+ message MetricsInfo {
187
+ repeated MetricInfo results = 1 ;
188
+ int32 total_count = 2 ;
189
+ }
190
+
191
+ message MetricStatQuery {
192
+ spaceone.api.core.v2.StatisticsQuery query = 1 ;
193
+ }
0 commit comments