373 lines
11 KiB
YAML
373 lines
11 KiB
YAML
|
openapi: 3.0.3
|
||
|
info:
|
||
|
title: Azalea
|
||
|
version: 1.0.0
|
||
|
description: 'This is the API endpoint for the Azalea Reverse Proxy. NOTE: Most of the endpoints here can only be accessed internally.'
|
||
|
termsOfService: https://mrmelon54.com/terms/api
|
||
|
contact:
|
||
|
name: Webmaster
|
||
|
email: webmaster@mrmelon54.com
|
||
|
license:
|
||
|
name: MIT
|
||
|
url: https://mrmelon54.com/license/api
|
||
|
servers:
|
||
|
- url: https://api.mrmelon54.com/v1/azalea
|
||
|
description: Production Endpoint
|
||
|
- url: https://api.mrmelon54.xyz/v1/azalea
|
||
|
description: Staging Endpoint
|
||
|
security:
|
||
|
- BearerAuth: []
|
||
|
paths:
|
||
|
/http-services:
|
||
|
get:
|
||
|
summary: List HTTP services
|
||
|
operationId: findHttpServices
|
||
|
tags:
|
||
|
- Proxy Management
|
||
|
responses:
|
||
|
200:
|
||
|
description: HTTP services response
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
$ref: "#/components/schemas/HttpService"
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
post:
|
||
|
summary: Create a HTTP service
|
||
|
operationId: addHttpService
|
||
|
tags:
|
||
|
- Proxy Management
|
||
|
requestBody:
|
||
|
description: Site configuration
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/NewHttpService"
|
||
|
examples:
|
||
|
'Example':
|
||
|
value:
|
||
|
address: mrmelon54.com
|
||
|
dst_host: 127.0.0.1
|
||
|
dst_port: 8080
|
||
|
responses:
|
||
|
201:
|
||
|
$ref: "#/components/responses/HttpServiceResp"
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
/http-service/{id}:
|
||
|
parameters:
|
||
|
- in: path
|
||
|
name: id
|
||
|
required: true
|
||
|
schema:
|
||
|
type: integer
|
||
|
examples:
|
||
|
"Example":
|
||
|
value: 5
|
||
|
get:
|
||
|
summary: Get a HTTP service
|
||
|
operationId: getHttpService
|
||
|
tags:
|
||
|
- Proxy Management
|
||
|
responses:
|
||
|
200:
|
||
|
$ref: "#/components/responses/HttpServiceResp"
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
put:
|
||
|
summary: Update a HTTP service, any valid configuration will enable a disabled HTTP service
|
||
|
operationId: editHttpService
|
||
|
tags:
|
||
|
- Proxy Management
|
||
|
requestBody:
|
||
|
description: HTTP service configuration
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/NewHttpService"
|
||
|
examples:
|
||
|
'Example':
|
||
|
value:
|
||
|
address: mrmelon54.com
|
||
|
dst_host: 127.0.0.1
|
||
|
dst_port: 8080
|
||
|
responses:
|
||
|
204:
|
||
|
description: Empty updated response, Success.
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
patch:
|
||
|
summary: Update a HTTP service, any valid configuration will enable a disabled HTTP service, an empty patch request enables a disabled HTTP service without modifying it
|
||
|
operationId: patchHttpService
|
||
|
tags:
|
||
|
- Proxy Management
|
||
|
requestBody:
|
||
|
description: HTTP service configuration
|
||
|
required: false
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/NewHttpService"
|
||
|
examples:
|
||
|
'Example':
|
||
|
value:
|
||
|
dst_host: 127.0.0.1
|
||
|
dst_port: 8080
|
||
|
'Empty':
|
||
|
value: {}
|
||
|
responses:
|
||
|
204:
|
||
|
description: Empty patched response, Success.
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
delete:
|
||
|
summary: Disables a HTTP service
|
||
|
operationId: deleteHttpService
|
||
|
tags:
|
||
|
- Proxy Management
|
||
|
responses:
|
||
|
204:
|
||
|
description: Empty deleted response, Success.
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
/http-redirects:
|
||
|
get:
|
||
|
summary: List HTTP redirects
|
||
|
operationId: findHttpRedirects
|
||
|
tags:
|
||
|
- Redirect Management
|
||
|
responses:
|
||
|
200:
|
||
|
description: HTTP redirects response
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
$ref: "#/components/schemas/HttpRedirect"
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
post:
|
||
|
summary: Create a HTTP redirect
|
||
|
operationId: addHttpRedirect
|
||
|
tags:
|
||
|
- Redirect Management
|
||
|
requestBody:
|
||
|
description: Redirect configuration
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/NewHttpRedirect"
|
||
|
examples:
|
||
|
'Example':
|
||
|
value:
|
||
|
address: mrmelon54.xyz
|
||
|
target: mrmelon54.com/%path%
|
||
|
responses:
|
||
|
201:
|
||
|
$ref: "#/components/responses/HttpRedirectResp"
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
/http-redirect/{id}:
|
||
|
parameters:
|
||
|
- in: path
|
||
|
name: id
|
||
|
required: true
|
||
|
schema:
|
||
|
type: integer
|
||
|
examples:
|
||
|
"Example":
|
||
|
value: 5
|
||
|
get:
|
||
|
summary: Get a HTTP redirect
|
||
|
operationId: getHttpRedirect
|
||
|
tags:
|
||
|
- Redirect Management
|
||
|
responses:
|
||
|
200:
|
||
|
$ref: "#/components/responses/HttpRedirectResp"
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
put:
|
||
|
summary: Create or update a HTTP redirect, any valid configuration will enable a disabled HTTP redirect
|
||
|
operationId: editHttpRedirect
|
||
|
tags:
|
||
|
- Redirect Management
|
||
|
requestBody:
|
||
|
description: Redirect configuration
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/NewHttpRedirect"
|
||
|
examples:
|
||
|
'Example':
|
||
|
value:
|
||
|
address: mrmelon54.xyz
|
||
|
target: mrmelon54.com/%path%
|
||
|
responses:
|
||
|
204:
|
||
|
description: Empty updated response, Success.
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
patch:
|
||
|
summary: Update a HTTP redirect, any valid configuration will enable a disabled HTTP redirect, an empty patch request enables a disabled HTTP redirect without modifying it
|
||
|
operationId: patchHttpRedirect
|
||
|
tags:
|
||
|
- Redirect Management
|
||
|
requestBody:
|
||
|
description: Redirect configuration
|
||
|
required: false
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/NewHttpRedirect"
|
||
|
examples:
|
||
|
'Example':
|
||
|
value:
|
||
|
target: mrmelon54.com/%path%
|
||
|
'Empty':
|
||
|
value: {}
|
||
|
responses:
|
||
|
204:
|
||
|
description: Empty patched response, Success.
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
delete:
|
||
|
summary: Disables a HTTP redirect
|
||
|
operationId: deleteHttpRedirect
|
||
|
tags:
|
||
|
- Redirect Management
|
||
|
responses:
|
||
|
204:
|
||
|
description: Empty deleted response, Success.
|
||
|
400:
|
||
|
$ref: "base.yml#/components/responses/BadReq"
|
||
|
401:
|
||
|
$ref: "base.yml#/components/responses/UnAuth"
|
||
|
403:
|
||
|
$ref: "base.yml#/components/responses/Forb"
|
||
|
components:
|
||
|
responses:
|
||
|
HttpServiceResp:
|
||
|
description: http service response
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/HttpService"
|
||
|
HttpRedirectResp:
|
||
|
description: http redirect response
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
$ref: "#/components/schemas/HttpRedirect"
|
||
|
schemas:
|
||
|
HttpService:
|
||
|
allOf:
|
||
|
- $ref: "#/components/schemas/NewHttpService"
|
||
|
- type: object
|
||
|
required:
|
||
|
- id
|
||
|
properties:
|
||
|
id:
|
||
|
type: integer
|
||
|
description: ID for the HTTP service
|
||
|
enabled:
|
||
|
type: boolean
|
||
|
description: If the HTTP service is enabled
|
||
|
NewHttpService:
|
||
|
type: object
|
||
|
properties:
|
||
|
address:
|
||
|
type: string
|
||
|
description: Address to access
|
||
|
dst_host:
|
||
|
type: string
|
||
|
description: Destination host
|
||
|
dst_port:
|
||
|
type: integer
|
||
|
description: Destination port
|
||
|
secure_mode:
|
||
|
type: boolean
|
||
|
description: Use secure connection mode
|
||
|
ignore_cert:
|
||
|
type: boolean
|
||
|
description: Ignore internal service certificate
|
||
|
HttpRedirect:
|
||
|
allOf:
|
||
|
- $ref: "#/components/schemas/NewHttpRedirect"
|
||
|
- type: object
|
||
|
required:
|
||
|
- id
|
||
|
properties:
|
||
|
id:
|
||
|
type: integer
|
||
|
description: ID for the HTTP redirect
|
||
|
enabled:
|
||
|
type: boolean
|
||
|
description: If the HTTP redirect is enabled
|
||
|
NewHttpRedirect:
|
||
|
type: object
|
||
|
properties:
|
||
|
address:
|
||
|
type: string
|
||
|
description: Address to access
|
||
|
target:
|
||
|
type: string
|
||
|
description: Destination target
|
||
|
securitySchemes:
|
||
|
BearerAuth:
|
||
|
type: http
|
||
|
scheme: bearer
|
||
|
bearerFormat: JWT
|