118 lines
2.9 KiB
YAML
118 lines
2.9 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: Proxmox Server Management API
|
|
description: API for managing Proxmox server statuses and power states.
|
|
version: 1.0.0
|
|
servers:
|
|
- url: http://localhost:8000
|
|
paths:
|
|
/servers:
|
|
get:
|
|
summary: Get the list of registered servers
|
|
operationId: getServers
|
|
responses:
|
|
'200':
|
|
description: A list of registered servers
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
ip:
|
|
type: string
|
|
mac:
|
|
type: string
|
|
post:
|
|
summary: Add or update a server
|
|
operationId: addServer
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
ip:
|
|
type: string
|
|
mac:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Server added or updated successfully
|
|
/statuses:
|
|
get:
|
|
summary: Get the statuses of all servers
|
|
operationId: listAllStatuses
|
|
responses:
|
|
'200':
|
|
description: A list of all server statuses
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
/statuses/{server_name}:
|
|
get:
|
|
summary: Get the status of a specific server
|
|
operationId: getStatus
|
|
parameters:
|
|
- name: server_name
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Server status
|
|
/states:
|
|
get:
|
|
summary: Get the power states of all servers
|
|
operationId: listAllStates
|
|
responses:
|
|
'200':
|
|
description: A list of all server power states
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
/states/{server_name}:
|
|
get:
|
|
summary: Get the power state of a specific server
|
|
operationId: getPowerStatus
|
|
parameters:
|
|
- name: server_name
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Server power state
|
|
put:
|
|
summary: Control the power state of a server
|
|
operationId: controlPower
|
|
parameters:
|
|
- name: server_name
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
state:
|
|
type: string
|
|
enum: [on, off]
|
|
responses:
|
|
'200':
|
|
description: Power state updated
|