Skip to content

Commit 67fd34a

Browse files
authored
Merge pull request #459 from ImMin5/master
Add collector service at inventory-v2
2 parents a654bc5 + 1d7f9cd commit 67fd34a

File tree

5 files changed

+972
-23
lines changed

5 files changed

+972
-23
lines changed

proto/spaceone/api/identity/v2/agent.proto

+68-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "google/api/annotations.proto";
1010
import "spaceone/api/core/v2/query.proto";
1111
import "spaceone/api/identity/v2/app.proto";
1212

13-
13+
// Create Agent with service account , Currently only Kubernetes service account is supported for OpenCost
1414
service Agent {
1515
rpc create(CreateAgentRequest) returns (AgentInfo) {
1616
option (google.api.http) = {
@@ -62,15 +62,48 @@ service Agent {
6262
}
6363
}
6464

65+
66+
//{
67+
// "service_account_id": "sa-a120f6d21c4e",
68+
// "options": {
69+
// "cluster_name": "k8s-prd-cluster",
70+
// "kube_state_metrics": "false",
71+
// "prometheus_node_exporter": "false"
72+
// }
73+
//}
6574
message CreateAgentRequest {
6675
string service_account_id = 1;
6776
google.protobuf.Struct options = 2;
6877
}
6978

79+
//{
80+
// "service_account_id": "sa-a120f6d21c4e"
81+
//}
7082
message AgentRequest {
7183
string service_account_id = 1;
7284
}
7385

86+
//{
87+
// "agent_id": "agent-5cb52dc61c70",
88+
// "options": {
89+
// "kube_state_metrics": false,
90+
// "cluster_name": "k8s-prd-cluster",
91+
// "prometheus_node_exporter": false
92+
// },
93+
// "client_secret": "client_secret_from_app",
94+
// "state": "ENABLED",
95+
// "is_managed": true,
96+
// "role_type": "WORKSPACE_OWNER",
97+
// "domain_id": "domain-116226a1516a",
98+
// "workspace_id": "workspace-7a0aebcf4eb2",
99+
// "project_id": "project-441975c8dfd8",
100+
// "service_account_id": "sa-a120f6d21c4e",
101+
// "app_id": "app-aa7bf47c98ea",
102+
// "role_id": "managed-workspace-owner",
103+
// "client_id": "client-36e1034b3512",
104+
// "created_at": "2024-11-13T00:34:09.125Z",
105+
// "expired_at": "2025-11-13T00:34:09.000Z"
106+
//}
74107
message AgentInfo {
75108
enum State {
76109
STATE_NONE = 0;
@@ -107,6 +140,14 @@ message AgentInfo {
107140
string last_accessed_at = 33;
108141
}
109142

143+
//{
144+
// "query": {
145+
// "page": {
146+
// "start":1,
147+
// "limit": 10
148+
// }
149+
// }
150+
//}
110151
message AgentSearchQuery {
111152
enum State {
112153
STATE_NONE = 0;
@@ -126,6 +167,32 @@ message AgentSearchQuery {
126167

127168
}
128169

170+
//{
171+
// "results": [
172+
// {
173+
// "agent_id": "agent-5cb52dc61c70",
174+
// "options": {
175+
// "kube_state_metrics": false,
176+
// "cluster_name": "k8s-prd-cluster",
177+
// "prometheus_node_exporter": false
178+
// },
179+
// "client_secret": "client_secret_from_app",
180+
// "state": "ENABLED",
181+
// "is_managed": true,
182+
// "role_type": "WORKSPACE_OWNER",
183+
// "domain_id": "domain-116226a1516a",
184+
// "workspace_id": "workspace-7a0aebcf4eb2",
185+
// "project_id": "project-441975c8dfd8",
186+
// "service_account_id": "sa-a120f6d21c4e",
187+
// "app_id": "app-aa7bf47c98ea",
188+
// "role_id": "managed-workspace-owner",
189+
// "client_id": "client-36e1034b3512",
190+
// "created_at": "2024-11-13T00:34:09.125Z",
191+
// "expired_at": "2025-11-13T00:34:09.000Z"
192+
// }
193+
// ],
194+
// "total_count": 1
195+
//}
129196
message AgentsInfo {
130197
repeated AgentInfo results = 1;
131198
int32 total_count = 2;

proto/spaceone/api/identity/v2/endpoint.proto

+37-22
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,52 @@ import "spaceone/api/core/v2/query.proto";
99

1010

1111
service Endpoint {
12+
// Get gRPC endpoint list.
1213
// +noauth
1314
rpc list (EndpointSearchQuery) returns (EndpointsInfo) {
14-
option (google.api.http) = {
15-
post: "/identity/v2/endpoint/list"
16-
body: "*"
17-
};
18-
}
15+
option (google.api.http) = {
16+
post: "/identity/v2/endpoint/list"
17+
body: "*"
18+
};
19+
}
1920
}
2021

2122
message EndpointInfo {
22-
enum EndpointState {
23-
NONE = 0;
24-
ACTIVE = 1;
25-
INACTIVE = 2;
26-
}
27-
28-
string name = 1;
29-
string service = 2;
30-
string endpoint = 3;
31-
EndpointState state = 4;
32-
string version = 5;
23+
enum EndpointState {
24+
NONE = 0;
25+
ACTIVE = 1;
26+
INACTIVE = 2;
27+
}
28+
29+
string name = 1;
30+
string service = 2;
31+
string endpoint = 3;
32+
EndpointState state = 4;
33+
string version = 5;
3334
}
3435

36+
//{
37+
// "service": "inventory",
38+
// "query": {}
39+
//}
3540
message EndpointSearchQuery {
36-
// +optional
37-
spaceone.api.core.v2.Query query = 1;
38-
// +optional
39-
string service = 2;
41+
// +optional
42+
spaceone.api.core.v2.Query query = 1;
43+
// +optional
44+
string service = 2;
4045
}
4146

47+
//{
48+
// "results": [
49+
// {
50+
// "name": "Inventory Service",
51+
// "service": "inventory",
52+
// "endpoint": "grpc://localhost:50051",
53+
// }
54+
// ],
55+
// "total_count": 1
56+
//}
4257
message EndpointsInfo {
43-
repeated EndpointInfo results = 1;
44-
int32 total_count = 2;
58+
repeated EndpointInfo results = 1;
59+
int32 total_count = 2;
4560
}

0 commit comments

Comments
 (0)