Skip to content

Commit a8b116d

Browse files
committed
feat(api)-Removed unused restapis from settingsservice[eclipse-pullpiri#296]
1 parent 903fa24 commit a8b116d

File tree

5 files changed

+19
-529
lines changed

5 files changed

+19
-529
lines changed

src/server/settingsservice/README.md

Lines changed: 2 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ The Settings Service is a core component of the PICCOLO framework that provides
88
- **Schema Validation**: Validate configurations against JSON schemas
99
- **Change History**: Track configuration changes with rollback capabilities
1010
- **Metrics Retrieval**: Retrieve and filter monitoring metrics from ETCD (NodeInfo, ContainerInfo, SocInfo, BoardInfo)
11-
- **Resource Management**: Create and delete vehicle orchestration resources (nodes, containers, SoCs, boards)
12-
- **Multiple Interfaces**: REST API and CLI interfaces
11+
- **Resource Management**: List vehicle orchestration resources (nodes, containers, SoCs, boards)
12+
- **Multiple Interfaces**: REST API interface
1313
- **ETCD Integration**: Direct integration with monitoring ETCD storage for real-time vehicle orchestration data
1414

1515
## Architecture
@@ -71,8 +71,6 @@ The Settings Service provides a comprehensive REST API:
7171
**Node Management:**
7272
- `GET /api/v1/nodes` - List all nodes
7373
- `GET /api/v1/nodes/{name}` - Get specific node
74-
- `POST /api/v1/nodes` - Create new node
75-
- `DELETE /api/v1/nodes/{name}` - Delete node
7674
- `GET /api/v1/nodes/{name}/pods/metrics` - Get pod metrics for specific node (enhanced with hostname)
7775
- `GET /api/v1/nodes/{name}/containers` - Get all containers for specific node
7876

@@ -85,14 +83,10 @@ The Settings Service provides a comprehensive REST API:
8583
**SoC Management:**
8684
- `GET /api/v1/socs` - List all SoCs
8785
- `GET /api/v1/socs/{name}` - Get specific SoC
88-
- `POST /api/v1/socs` - Create new SoC
89-
- `DELETE /api/v1/socs/{name}` - Delete SoC
9086

9187
**Board Management:**
9288
- `GET /api/v1/boards` - List all boards
9389
- `GET /api/v1/boards/{name}` - Get specific board
94-
- `POST /api/v1/boards` - Create new board
95-
- `DELETE /api/v1/boards/{name}` - Delete board
9690

9791
### Metrics Management (Vehicle Orchestration)
9892

@@ -136,7 +130,6 @@ The service can be configured using command-line arguments or environment variab
136130
- `--bind-address`: HTTP server bind address (default: `0.0.0.0`)
137131
- `--bind-port`: HTTP server bind port (default: `8080`)
138132
- `--log-level`: Log level (default: `info`)
139-
- `--cli`: Run in CLI mode instead of server mode
140133

141134
## Testing
142135

@@ -182,89 +175,6 @@ curl -X POST http://localhost:8080/api/v1/settings/vehicle/orchestrator \
182175
}'
183176
```
184177

185-
### Create a New Node
186-
187-
```bash
188-
curl -X POST http://localhost:8080/api/v1/nodes \
189-
-H "Content-Type: application/json" \
190-
-d '{
191-
"name": "vehicle-ecu-02",
192-
"image": "pullpiri/node-agent:latest",
193-
"ip": "192.168.1.102",
194-
"labels": {
195-
"zone": "engine_bay",
196-
"tier": "edge",
197-
"capability": "processing"
198-
}
199-
}'
200-
```
201-
202-
### Create a New Container
203-
204-
```bash
205-
curl -X POST http://localhost:8080/api/v1/containers \
206-
-H "Content-Type: application/json" \
207-
-d '{
208-
"name": "vehicle-diagnostics",
209-
"image": "pullpiri/diagnostics:v1.0.0",
210-
"node_name": "vehicle-ecu-01",
211-
"description": "Vehicle diagnostic service container",
212-
"labels": {
213-
"service": "diagnostics",
214-
"version": "1.0.0",
215-
"critical": "true"
216-
}
217-
}'
218-
```
219-
220-
### Create a New SoC
221-
222-
```bash
223-
curl -X POST http://localhost:8080/api/v1/socs \
224-
-H "Content-Type: application/json" \
225-
-d '{
226-
"name": "nvidia-xavier-01",
227-
"description": "NVIDIA Xavier SoC for AI processing",
228-
"labels": {
229-
"vendor": "nvidia",
230-
"series": "xavier",
231-
"capability": "ai_inference"
232-
}
233-
}'
234-
```
235-
236-
### Create a New Board
237-
238-
```bash
239-
curl -X POST http://localhost:8080/api/v1/boards \
240-
-H "Content-Type: application/json" \
241-
-d '{
242-
"name": "vehicle-mainboard-01",
243-
"description": "Primary vehicle compute board",
244-
"labels": {
245-
"type": "main_compute",
246-
"location": "dashboard",
247-
"power_class": "high"
248-
}
249-
}'
250-
```
251-
252-
### Delete Resources
253-
254-
```bash
255-
# Delete a container
256-
curl -X DELETE http://localhost:8080/api/v1/containers/vehicle-diagnostics
257-
258-
# Delete a node
259-
curl -X DELETE http://localhost:8080/api/v1/nodes/vehicle-ecu-02
260-
261-
# Delete a SoC
262-
curl -X DELETE http://localhost:8080/api/v1/socs/nvidia-xavier-01
263-
264-
# Delete a board
265-
curl -X DELETE http://localhost:8080/api/v1/boards/vehicle-mainboard-01
266-
```
267-
268178
### Get Configuration
269179

270180
```bash
@@ -336,43 +246,6 @@ RUST_LOG=debug ./target/debug/settingsservice
336246
}
337247
```
338248

339-
### Node Creation Request
340-
341-
```json
342-
{
343-
"name": "string (required)",
344-
"image": "string (required)",
345-
"ip": "string (required)",
346-
"labels": {
347-
"key": "value"
348-
}
349-
}
350-
```
351-
352-
### SoC Creation Request
353-
354-
```json
355-
{
356-
"name": "string (required)",
357-
"description": "string (optional)",
358-
"labels": {
359-
"key": "value"
360-
}
361-
}
362-
```
363-
364-
### Board Creation Request
365-
366-
```json
367-
{
368-
"name": "string (required)",
369-
"description": "string (optional)",
370-
"labels": {
371-
"key": "value"
372-
}
373-
}
374-
```
375-
376249
### Pod Metrics Response (Enhanced)
377250

378251
```json
@@ -412,7 +285,6 @@ The Settings Service integrates directly with the Pullpiri vehicle orchestration
412285
- **NodeAgent**: Reports node resource utilization and container status to MonitoringServer
413286
- **APIServer**: Consumes configurations for orchestration policies and resource management
414287
- **ETCD**: Central storage for both configurations (`/piccolo/settings/`) and real-time metrics (`/piccolo/metrics/`)
415-
- **Resource Lifecycle**: Create/delete operations are synchronized with the monitoring server for consistent state management
416288

417289
## Port Usage
418290

@@ -426,8 +298,6 @@ Following Pullpiri networking conventions:
426298
The API returns standard HTTP status codes:
427299

428300
- `200 OK` - Successful operation
429-
- `201 Created` - Resource created successfully
430-
- `204 No Content` - Resource deleted successfully
431301
- `400 Bad Request` - Invalid request data
432302
- `404 Not Found` - Resource not found
433303
- `500 Internal Server Error` - Server error

src/server/settingsservice/board-soc-node-rest-api.md

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,13 @@ http://localhost:8080/api/v1
2727
- **Response:** `NodeListResponse`
2828
- **Status Codes:** 200, 500
2929

30-
### Create Node
31-
32-
- **Endpoint:** `POST /nodes`
33-
- **Description:** Create a new node.
34-
- **Request Body:** `CreateNodeRequest`
35-
- **Response:** `NodeInfo`
36-
- **Status Codes:** 200, 400, 500
37-
3830
### Get Node Details
3931

4032
- **Endpoint:** `GET /nodes/{name}`
4133
- **Description:** Get specific node details including logs.
4234
- **Response:** `NodeInfo` (with logs)
4335
- **Status Codes:** 200, 404, 500
4436

45-
### Delete Node
46-
47-
- **Endpoint:** `DELETE /nodes/{name}`
48-
- **Description:** Delete a specific node.
49-
- **Response:** None
50-
- **Status Codes:** 204, 500
51-
5237
### Get Pod Metrics for Node
5338

5439
- **Endpoint:** `GET /nodes/{name}/pods/metrics`
@@ -73,28 +58,13 @@ http://localhost:8080/api/v1
7358
- **Response:** `SocListResponse`
7459
- **Status Codes:** 200, 500
7560

76-
### Create SoC
77-
78-
- **Endpoint:** `POST /socs`
79-
- **Description:** Create a new SoC.
80-
- **Request Body:** `CreateSocRequest`
81-
- **Response:** `SocInfo`
82-
- **Status Codes:** 200, 400, 500
83-
8461
### Get SoC Details
8562

8663
- **Endpoint:** `GET /socs/{name}`
8764
- **Description:** Get specific SoC details including logs.
8865
- **Response:** `SocInfo` (with logs)
8966
- **Status Codes:** 200, 404, 500
9067

91-
### Delete SoC
92-
93-
- **Endpoint:** `DELETE /socs/{name}`
94-
- **Description:** Delete a specific SoC.
95-
- **Response:** None
96-
- **Status Codes:** 204, 500
97-
9868
---
9969

10070
## Board Management
@@ -110,28 +80,13 @@ http://localhost:8080/api/v1
11080
- **Response:** `BoardListResponse`
11181
- **Status Codes:** 200, 500
11282

113-
### Create Board
114-
115-
- **Endpoint:** `POST /boards`
116-
- **Description:** Create a new board.
117-
- **Request Body:** `CreateBoardRequest`
118-
- **Response:** `BoardInfo`
119-
- **Status Codes:** 200, 400, 500
120-
12183
### Get Board Details
12284

12385
- **Endpoint:** `GET /boards/{name}`
12486
- **Description:** Get specific board details including logs.
12587
- **Response:** `BoardInfo` (with logs)
12688
- **Status Codes:** 200, 404, 500
12789

128-
### Delete Board
129-
130-
- **Endpoint:** `DELETE /boards/{name}`
131-
- **Description:** Delete a specific board.
132-
- **Response:** None
133-
- **Status Codes:** 204, 500
134-
13590
---
13691

13792
## Monitoring Integration
@@ -145,53 +100,6 @@ http://localhost:8080/api/v1
145100

146101
---
147102

148-
## Request Body Schemas
149-
150-
### CreateNodeRequest
151-
152-
```json
153-
{
154-
"name": "string",
155-
"ip": "string",
156-
"image": "string",
157-
"labels": {
158-
"environment": "string",
159-
"region": "string",
160-
"type": "string"
161-
}
162-
}
163-
```
164-
165-
### CreateSocRequest
166-
167-
```json
168-
{
169-
"name": "string",
170-
"description": "string",
171-
"labels": {
172-
"architecture": "string",
173-
"vendor": "string",
174-
"generation": "string"
175-
}
176-
}
177-
```
178-
179-
### CreateBoardRequest
180-
181-
```json
182-
{
183-
"name": "string",
184-
"description": "string",
185-
"labels": {
186-
"function": "string",
187-
"criticality": "string",
188-
"location": "string"
189-
}
190-
}
191-
```
192-
193-
---
194-
195103
## Response Schemas
196104

197105
- See the original documentation for `NodeInfo`, `SocInfo`, `BoardInfo`, `NodeListResponse`, `SocListResponse`, `BoardListResponse`, `SuccessResponse`, and `ErrorResponse` JSON structures.

0 commit comments

Comments
 (0)