Skip to content

Commit

Permalink
openapi: init spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Aug 27, 2023
1 parent a37a0e4 commit 31ab7c4
Showing 1 changed file with 134 additions and 0 deletions.
134 changes: 134 additions & 0 deletions openapi/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
openapi: "3.0.0"
info:
title: OpenAPI of Django sspanel
description: ""
version: 0.0.1
servers:
- url: http://127.0.0.1:8000/openapi/v1
description: Local development server

components:
securitySchemes:
OpenApiKeyAuth:
type: apiKey
in: header
name: x-api-key
schemas:
ProxyNode:
type: object
properties:
id:
type: integer
format: int64
sequence:
type: integer
name:
type: string
server:
type: string
enable:
type: boolean
node_type:
type: string
info:
type: string
level:
type: integer
country:
type: string
used_traffic:
type: integer
total_traffic:
type: integer
provider_remark:
type: string
enable_udp:
type: boolean
current_used_download_bandwidth_bytes:
type: integer
current_used_upload_bandwidth_bytes:
type: integer
download_bandwidth_bytes:
type: integer
upload_bandwidth_bytes:
type: integer
required:
- id
- name
- server
- enable
- node_type
- info
- level
- country
- used_traffic
- total_traffic
- enlarge_scale
- provider_remark
- enable_udp
- current_used_download_bandwidth_bytes
- current_used_upload_bandwidth_bytes
- download_bandwidth_bytes
- upload_bandwidth_bytes
CommonErrorResp:
type: object
properties:
error_msg:
type: string
description: Error message
required:
- error_msg
UpdateProxyNodeReq:
type: object
properties:
enable:
type: boolean
description: Whether to enable or disable the ProxyNode
# TODO Add more properties as needed
security:
- OpenApiKeyAuth: []

paths:
/proxy_nodes/{node_id}/:
patch:
summary: Update a ProxyNode
tags:
- ProxyNode
parameters:
- name: node_id
in: path
required: true
schema:
type: integer
description: ID of the ProxyNode to update
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateProxyNodeReq"
responses:
200:
description: Successful update
content:
application/json:
schema:
$ref: "#/components/schemas/ProxyNode"
400:
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/CommonErrorResp"
404:
description: ProxyNode not found
content:
application/json:
schema:
$ref: "#/components/schemas/CommonErrorResp"
500:
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/CommonErrorResp"

0 comments on commit 31ab7c4

Please sign in to comment.