215 lines
4.5 KiB
JSON
215 lines
4.5 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "yanpm-agent",
|
|
"description": "",
|
|
"license": {
|
|
"name": ""
|
|
},
|
|
"version": "0.1.0"
|
|
},
|
|
"paths": {
|
|
"/status": {
|
|
"get": {
|
|
"tags": [
|
|
"Nginx Agent"
|
|
],
|
|
"summary": "Health check endpoint",
|
|
"operationId": "status",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Status response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResp"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/validate": {
|
|
"post": {
|
|
"tags": [
|
|
"Nginx Agent"
|
|
],
|
|
"operationId": "validate",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ValidateBody"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Validation response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/validate_and_reload": {
|
|
"post": {
|
|
"tags": [
|
|
"Nginx Agent"
|
|
],
|
|
"operationId": "validate_and_reload",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ValidateAndReloadBody"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Validate and reload response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ValidateAndReloadResp"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/write_config": {
|
|
"post": {
|
|
"tags": [
|
|
"Nginx Agent"
|
|
],
|
|
"operationId": "write_config",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/WriteConfigBody"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Write config response"
|
|
},
|
|
"500": {
|
|
"description": "Internal server error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"StatusResp": {
|
|
"type": "object",
|
|
"required": [
|
|
"ok"
|
|
],
|
|
"properties": {
|
|
"ok": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"ValidateAndReloadBody": {
|
|
"type": "object",
|
|
"required": [
|
|
"config_name",
|
|
"timestamp"
|
|
],
|
|
"properties": {
|
|
"config_name": {
|
|
"type": "string"
|
|
},
|
|
"timestamp": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
}
|
|
}
|
|
},
|
|
"ValidateAndReloadResp": {
|
|
"type": "object",
|
|
"required": [
|
|
"rc",
|
|
"ro"
|
|
],
|
|
"properties": {
|
|
"rc": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"ro": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ValidateBody": {
|
|
"type": "object",
|
|
"required": [
|
|
"config_name",
|
|
"timestamp"
|
|
],
|
|
"properties": {
|
|
"config_name": {
|
|
"type": "string"
|
|
},
|
|
"timestamp": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
}
|
|
}
|
|
},
|
|
"WriteConfigBody": {
|
|
"type": "object",
|
|
"required": [
|
|
"config_name",
|
|
"timestamp",
|
|
"content"
|
|
],
|
|
"properties": {
|
|
"config_name": {
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
},
|
|
"timestamp": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Nginx Agent",
|
|
"description": "Nginx Agent API"
|
|
}
|
|
]
|
|
} |