- Added upstream objects
- Renamed host templates to nginx templates - Generate upstream templates - Better nginx error reporting when reloading - Use tparse for golang test reporting
This commit is contained in:
79
backend/embed/api_docs/paths/nginx-templates/get.json
Normal file
79
backend/embed/api_docs/paths/nginx-templates/get.json
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"operationId": "getNginxTemplates",
|
||||
"summary": "Get a list of Nginx Templates",
|
||||
"tags": ["Nginx Templates"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "offset",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "The pagination row offset, default 0",
|
||||
"example": 0
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "limit",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
},
|
||||
"description": "The pagination row limit, default 10",
|
||||
"example": 10
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "sort",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "The sorting of the list",
|
||||
"example": "id,name.asc,value.desc"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"required": ["result"],
|
||||
"properties": {
|
||||
"result": {
|
||||
"$ref": "#/components/schemas/NginxTemplateList"
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": {
|
||||
"total": 1,
|
||||
"offset": 0,
|
||||
"limit": 10,
|
||||
"sort": [
|
||||
{
|
||||
"field": "created_on",
|
||||
"direction": "ASC"
|
||||
}
|
||||
],
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": 1646218093,
|
||||
"modified_on": 1646218093,
|
||||
"user_id": 1,
|
||||
"name": "Default Proxy Template",
|
||||
"type": "proxy",
|
||||
"template": "# this is a proxy template"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
backend/embed/api_docs/paths/nginx-templates/post.json
Normal file
46
backend/embed/api_docs/paths/nginx-templates/post.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"operationId": "createNginxTemplate",
|
||||
"summary": "Create a new Nginx Template",
|
||||
"tags": ["Nginx Templates"],
|
||||
"requestBody": {
|
||||
"description": "Template to Create",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": "{{schema.CreateNginxTemplate}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"required": ["result"],
|
||||
"properties": {
|
||||
"result": {
|
||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": {
|
||||
"id": 10,
|
||||
"created_on": 1646218093,
|
||||
"modified_on": 1646218093,
|
||||
"user_id": 1,
|
||||
"name": "My proxy template",
|
||||
"type": "proxy",
|
||||
"template": "# this is a proxy template"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
{
|
||||
"operationId": "deleteNginxTemplate",
|
||||
"summary": "Delete a Nginx Template",
|
||||
"tags": ["Nginx Templates"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "templateID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "Numeric ID of the Template",
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": null,
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "You cannot delete a template that is in use!"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
{
|
||||
"operationId": "getNginxTemplate",
|
||||
"summary": "Get a Nginx Template object by ID",
|
||||
"tags": ["Nginx Templates"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "templateID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "ID of the Host Template",
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"required": ["result"],
|
||||
"properties": {
|
||||
"result": {
|
||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": {
|
||||
"id": 1,
|
||||
"created_on": 1646218093,
|
||||
"modified_on": 1646218093,
|
||||
"user_id": 1,
|
||||
"name": "Default Proxy Template",
|
||||
"type": "proxy",
|
||||
"template": "# this is a proxy template"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "updateNginxTemplate",
|
||||
"summary": "Update an existing Nginx Template",
|
||||
"tags": ["Nginx Templates"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "templateID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "ID of the Template",
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Template details to update",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": "{{schema.UpdateNginxTemplate}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"required": ["result"],
|
||||
"properties": {
|
||||
"result": {
|
||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": {
|
||||
"id": 1,
|
||||
"created_on": 1646218093,
|
||||
"modified_on": 1646218093,
|
||||
"user_id": 1,
|
||||
"name": "My renamed proxy template",
|
||||
"type": "proxy",
|
||||
"template": "# this is a proxy template"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user