mirror of
https://github.com/0x1d/rcond.git
synced 2025-12-14 18:25:21 +01:00
157 lines
4.3 KiB
YAML
157 lines
4.3 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: rcond API
|
|
description: API for managing network connections through NetworkManager
|
|
version: 1.0.0
|
|
|
|
servers:
|
|
- url: http://localhost:8080
|
|
description: Local development server
|
|
|
|
components:
|
|
securitySchemes:
|
|
ApiKeyAuth:
|
|
type: apiKey
|
|
in: header
|
|
name: X-API-Token
|
|
description: API token for authentication
|
|
|
|
security:
|
|
- ApiKeyAuth: []
|
|
|
|
paths:
|
|
/health:
|
|
get:
|
|
summary: Health check endpoint
|
|
description: Returns the health status of the service
|
|
responses:
|
|
'200':
|
|
description: Service is healthy
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: "healthy"
|
|
|
|
/network/up:
|
|
post:
|
|
summary: Create and activate WiFi access point
|
|
description: Creates and activates a WiFi access point on the specified interface
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- interface
|
|
- ssid
|
|
- password
|
|
properties:
|
|
interface:
|
|
type: string
|
|
description: Network interface name
|
|
example: "wlan0"
|
|
ssid:
|
|
type: string
|
|
description: WiFi network SSID
|
|
example: "MyNetworkSSID"
|
|
password:
|
|
type: string
|
|
description: WiFi network password
|
|
example: "SuperSecretPassword"
|
|
responses:
|
|
'200':
|
|
description: Network interface brought up successfully
|
|
'400':
|
|
description: Invalid request payload
|
|
'401':
|
|
description: Unauthorized - invalid or missing API token
|
|
'500':
|
|
description: Internal server error
|
|
|
|
/network/down:
|
|
post:
|
|
summary: Deactivate network interface
|
|
description: Deactivates the specified network interface
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- interface
|
|
properties:
|
|
interface:
|
|
type: string
|
|
description: Network interface name
|
|
example: "wlan0"
|
|
responses:
|
|
'200':
|
|
description: Network interface brought down successfully
|
|
'400':
|
|
description: Invalid request payload
|
|
'401':
|
|
description: Unauthorized - invalid or missing API token
|
|
'500':
|
|
description: Internal server error
|
|
|
|
/network/remove:
|
|
post:
|
|
summary: Remove stored connection profile
|
|
description: Removes the stored NetworkManager connection profile
|
|
responses:
|
|
'200':
|
|
description: Connection profile removed successfully
|
|
'401':
|
|
description: Unauthorized - invalid or missing API token
|
|
'500':
|
|
description: Internal server error
|
|
|
|
/hostname:
|
|
get:
|
|
summary: Get system hostname
|
|
description: Returns the current system hostname
|
|
responses:
|
|
'200':
|
|
description: Hostname retrieved successfully
|
|
content:
|
|
text/plain:
|
|
schema:
|
|
type: string
|
|
description: Current hostname
|
|
example: "MyHostname"
|
|
'401':
|
|
description: Unauthorized - invalid or missing API token
|
|
'500':
|
|
description: Internal server error
|
|
post:
|
|
summary: Set system hostname
|
|
description: Sets a new system hostname
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- hostname
|
|
properties:
|
|
hostname:
|
|
type: string
|
|
description: New hostname to set
|
|
example: "MyHostname"
|
|
responses:
|
|
'200':
|
|
description: Hostname set successfully
|
|
'400':
|
|
description: Invalid request payload
|
|
'401':
|
|
description: Unauthorized - invalid or missing API token
|
|
'500':
|
|
description: Internal server error
|