This commit is contained in:
2023-06-11 12:40:53 -04:00
parent f9b6e2136b
commit 7fc4336397
14 changed files with 393 additions and 201 deletions

View File

@@ -13,8 +13,8 @@ const docTemplate = `{
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
"url": "https://durp.info",
"email": "developerdurp@durp.info"
},
"license": {
"name": "Apache 2.0",
@@ -42,7 +42,13 @@ const docTemplate = `{
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
},
"400": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
@@ -55,7 +61,7 @@ const docTemplate = `{
"application/json"
],
"produces": [
"text/plain"
"application/json"
],
"tags": [
"openai"
@@ -74,7 +80,13 @@ const docTemplate = `{
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
},
"400": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
@@ -87,7 +99,7 @@ const docTemplate = `{
"application/json"
],
"produces": [
"text/plain"
"application/json"
],
"tags": [
"openai"
@@ -106,30 +118,13 @@ const docTemplate = `{
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
}
}
}
},
"/token/GenerateToken": {
"get": {
"description": "Get the health of the API",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"token"
],
"summary": "Generate Health status",
"responses": {
"200": {
"description": "response",
},
"400": {
"description": "error",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
}
}
@@ -152,18 +147,90 @@ const docTemplate = `{
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.PowerSupply"
}
},
"412": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
"definitions": {
"model.Message": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "message"
}
}
},
"model.PowerSupply": {
"type": "object",
"properties": {
"12v_load": {
"type": "integer"
},
"12v_watts": {
"type": "integer"
},
"3v_load": {
"type": "integer"
},
"3v_watts": {
"type": "integer"
},
"5v_load": {
"type": "integer"
},
"5v_watts": {
"type": "integer"
},
"capacity": {
"type": "string"
},
"efficiency": {
"type": "integer"
},
"fan_rpm": {
"type": "integer"
},
"load": {
"type": "integer"
},
"poweredon": {
"type": "string"
},
"poweredon_raw": {
"type": "string"
},
"product": {
"type": "string"
},
"temp1": {
"type": "integer"
},
"temp2": {
"type": "integer"
},
"uptime": {
"type": "string"
},
"uptime_raw": {
"type": "string"
},
"vendor": {
"type": "string"
},
"watts": {
"type": "integer"
}
}
}
}
}`

View File

@@ -6,8 +6,8 @@
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
"url": "https://durp.info",
"email": "developerdurp@durp.info"
},
"license": {
"name": "Apache 2.0",
@@ -33,7 +33,13 @@
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
},
"400": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
@@ -46,7 +52,7 @@
"application/json"
],
"produces": [
"text/plain"
"application/json"
],
"tags": [
"openai"
@@ -65,7 +71,13 @@
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
},
"400": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
@@ -78,7 +90,7 @@
"application/json"
],
"produces": [
"text/plain"
"application/json"
],
"tags": [
"openai"
@@ -97,30 +109,13 @@
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
}
}
}
},
"/token/GenerateToken": {
"get": {
"description": "Get the health of the API",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"token"
],
"summary": "Generate Health status",
"responses": {
"200": {
"description": "response",
},
"400": {
"description": "error",
"schema": {
"type": "string"
"$ref": "#/definitions/model.Message"
}
}
}
@@ -143,18 +138,90 @@
"200": {
"description": "response",
"schema": {
"type": "string"
"$ref": "#/definitions/model.PowerSupply"
}
},
"412": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
"definitions": {
"model.Message": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "message"
}
}
},
"model.PowerSupply": {
"type": "object",
"properties": {
"12v_load": {
"type": "integer"
},
"12v_watts": {
"type": "integer"
},
"3v_load": {
"type": "integer"
},
"3v_watts": {
"type": "integer"
},
"5v_load": {
"type": "integer"
},
"5v_watts": {
"type": "integer"
},
"capacity": {
"type": "string"
},
"efficiency": {
"type": "integer"
},
"fan_rpm": {
"type": "integer"
},
"load": {
"type": "integer"
},
"poweredon": {
"type": "string"
},
"poweredon_raw": {
"type": "string"
},
"product": {
"type": "string"
},
"temp1": {
"type": "integer"
},
"temp2": {
"type": "integer"
},
"uptime": {
"type": "string"
},
"uptime_raw": {
"type": "string"
},
"vendor": {
"type": "string"
},
"watts": {
"type": "integer"
}
}
}
}
}

View File

@@ -1,9 +1,57 @@
basePath: /api/v1
definitions:
model.Message:
properties:
message:
example: message
type: string
type: object
model.PowerSupply:
properties:
3v_load:
type: integer
3v_watts:
type: integer
5v_load:
type: integer
5v_watts:
type: integer
12v_load:
type: integer
12v_watts:
type: integer
capacity:
type: string
efficiency:
type: integer
fan_rpm:
type: integer
load:
type: integer
poweredon:
type: string
poweredon_raw:
type: string
product:
type: string
temp1:
type: integer
temp2:
type: integer
uptime:
type: string
uptime_raw:
type: string
vendor:
type: string
watts:
type: integer
type: object
info:
contact:
email: support@swagger.io
email: developerdurp@durp.info
name: API Support
url: http://www.swagger.io/support
url: https://durp.info
description: API for Durp's needs
license:
name: Apache 2.0
@@ -22,7 +70,11 @@ paths:
"200":
description: response
schema:
type: string
$ref: '#/definitions/model.Message'
"400":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Generate Health status
tags:
- health
@@ -38,12 +90,16 @@ paths:
required: true
type: string
produces:
- text/plain
- application/json
responses:
"200":
description: response
schema:
type: string
$ref: '#/definitions/model.Message'
"400":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Gerneral ChatGPT
tags:
- openai
@@ -59,30 +115,19 @@ paths:
required: true
type: string
produces:
- text/plain
- application/json
responses:
"200":
description: response
schema:
type: string
$ref: '#/definitions/model.Message'
"400":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Travel Agent ChatGPT
tags:
- openai
/token/GenerateToken:
get:
consumes:
- application/json
description: Get the health of the API
produces:
- application/json
responses:
"200":
description: response
schema:
type: string
summary: Generate Health status
tags:
- token
/unraid/powerusage:
get:
consumes:
@@ -94,13 +139,12 @@ paths:
"200":
description: response
schema:
type: string
$ref: '#/definitions/model.PowerSupply'
"412":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Unraid PSU Stats
tags:
- unraid
securityDefinitions:
ApiKeyAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"