代码拉取完成,页面将自动刷新
// Copyright (c) 2022 Yaohui Wang (yaohuiwang@outlook.com)
// FlexLB is licensed under Mulan PubL v2.
// You can use this software according to the terms and conditions of the Mulan PubL v2.
// You may obtain a copy of Mulan PubL v2 at:
// http://license.coscl.org.cn/MulanPubL-2.0
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PubL v2 for more details.
// Code generated by go-swagger; DO NOT EDIT.
package restapi
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
)
var (
// SwaggerJSON embedded version of the swagger document used at generation time
SwaggerJSON json.RawMessage
// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
FlatSwaggerJSON json.RawMessage
)
func init() {
SwaggerJSON = json.RawMessage([]byte(`{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https",
"http"
],
"swagger": "2.0",
"info": {
"description": "Flexible load balancer API to control keepalived and haproxy\n",
"title": "flexlb",
"contact": {
"name": "Yaohui Wang",
"email": "yaohuiwang@outlook.com"
},
"version": "v1"
},
"basePath": "/flexlb/v1",
"paths": {
"/instances": {
"get": {
"description": "List Instances",
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "list",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": true,
"description": "Instance name",
"name": "name",
"in": "query"
}
],
"responses": {
"200": {
"description": "List Instances succeeded",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Instance"
}
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
},
"put": {
"description": "Modify Instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "modify",
"parameters": [
{
"description": "Instance request",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/InstanceConfig"
}
}
],
"responses": {
"200": {
"description": "Modify Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
},
"post": {
"description": "Create Instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "create",
"parameters": [
{
"description": "Instance config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/InstanceConfig"
}
}
],
"responses": {
"200": {
"description": "Create Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
}
},
"/instances/{name}": {
"get": {
"description": "Get Instance",
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "get",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Get Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
},
"delete": {
"description": "Delete Instance",
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "delete",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Delete Instance succeeded",
"schema": {
"type": "object"
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
}
},
"/instances/{name}/start": {
"post": {
"description": "Start instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "start",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Start instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
}
},
"/instances/{name}/stop": {
"post": {
"description": "Stop Instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "stop",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Stop Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"$ref": "#/responses/trait:standardErrors:400"
},
"401": {
"$ref": "#/responses/trait:standardErrors:401"
},
"403": {
"$ref": "#/responses/trait:standardErrors:403"
},
"404": {
"$ref": "#/responses/trait:standardErrors:404"
},
"500": {
"$ref": "#/responses/trait:standardErrors:500"
}
}
}
},
"/readyz": {
"get": {
"description": "Ready status",
"produces": [
"application/json"
],
"tags": [
"Service"
],
"operationId": "readyz",
"responses": {
"200": {
"description": "Ready status",
"schema": {
"$ref": "#/definitions/ReadyStatus"
}
}
}
}
}
},
"definitions": {
"BackendServer": {
"description": "Backend server",
"required": [
"name",
"ipaddress",
"port"
],
"properties": {
"check_ssl_options": {
"description": "Backend check commands",
"type": "object",
"properties": {
"ca_cert": {
"type": "string",
"x-nullable": true
},
"client_cert": {
"type": "string",
"x-nullable": false
},
"client_key": {
"type": "string",
"x-nullable": false
},
"verify": {
"type": "string",
"enum": [
"none"
],
"x-nullable": true
}
},
"x-nullable": true
},
"ipaddress": {
"description": "Backend server IP address",
"type": "string",
"pattern": "((^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$))",
"x-nullable": false
},
"name": {
"description": "Backend server name",
"type": "string",
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"x-nullable": false
},
"options": {
"description": "Backend server options",
"type": "string",
"default": "",
"x-nullable": true
},
"port": {
"description": "Backend server port",
"type": "integer",
"format": "uint16",
"x-nullable": false
}
},
"additionalProperties": false
},
"Endpoint": {
"description": "Endpoint",
"required": [
"frontend_port",
"mode",
"balance",
"backend_servers"
],
"properties": {
"backend_check_commands": {
"description": "Backend check commands",
"type": "object",
"properties": {
"check_type": {
"type": "string",
"enum": [
"http-check",
"tcp-check"
],
"x-nullable": false,
"example": "http-check"
},
"commands": {
"description": "Backend TCP check commands",
"type": "array",
"items": {
"type": "string"
},
"x-nullable": true,
"example": [
"expect status 200"
]
}
},
"x-nullable": true
},
"backend_default_server": {
"description": "Backend default server options",
"type": "string",
"default": "inter 2s downinter 5s rise 2 fall 2 slowstart 60s maxconn 2000 maxqueue 2000 weight 100",
"x-nullable": true
},
"backend_options": {
"description": "Backend options",
"type": "array",
"items": {
"type": "string"
},
"x-nullable": true,
"example": [
"httpchk GET /"
]
},
"backend_servers": {
"description": "Backend servers",
"type": "array",
"items": {
"$ref": "#/definitions/BackendServer"
},
"x-nullable": false
},
"balance": {
"description": "Balance algorithm",
"type": "string",
"default": "roundrobin",
"x-nullable": false
},
"frontend_options": {
"description": "Frontend options",
"type": "string",
"default": "",
"x-nullable": true,
"example": "ssl"
},
"frontend_port": {
"description": "Frontend port",
"type": "integer",
"format": "uint16",
"x-nullable": false,
"example": 443
},
"frontend_ssl_options": {
"description": "Backend check commands",
"type": "object",
"properties": {
"ca_cert": {
"type": "string",
"x-nullable": true
},
"server_cert": {
"type": "string",
"x-nullable": false
},
"server_key": {
"type": "string",
"x-nullable": false
},
"verify": {
"type": "string",
"enum": [
"required",
"optional"
],
"x-nullable": true
}
},
"x-nullable": true
},
"mode": {
"description": "Protocol mode",
"type": "string",
"default": "tcp",
"enum": [
"tcp",
"udp",
"http"
],
"x-nullable": false
}
},
"additionalProperties": false
},
"Instance": {
"description": "Instance",
"required": [
"id",
"config",
"status"
],
"properties": {
"config": {
"x-nullable": false,
"$ref": "#/definitions/InstanceConfig"
},
"id": {
"description": "Instance ID",
"type": "integer",
"format": "uint8",
"maximum": 255,
"x-nullable": false
},
"last_modified": {
"description": "Last modified time",
"type": "integer",
"format": "int64",
"x-nullable": false
},
"status": {
"description": "Instance status",
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-nullable": false
}
}
},
"InstanceConfig": {
"description": "Instance config",
"required": [
"name",
"frontend_interface",
"frontend_ipaddress",
"frontend_net_prefix",
"endpoints"
],
"properties": {
"endpoints": {
"description": "Endpoints",
"type": "array",
"items": {
"$ref": "#/definitions/Endpoint"
},
"x-nullable": false
},
"frontend_interface": {
"description": "Frontend network interface",
"type": "string",
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"x-nullable": false,
"example": "eth0"
},
"frontend_ipaddress": {
"description": "Frontend IP address",
"type": "string",
"pattern": "((^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$))",
"x-nullable": false,
"example": "192.168.1.2"
},
"frontend_net_prefix": {
"description": "Frontend network prefix",
"type": "integer",
"format": "uint8",
"default": 32,
"maximum": 32,
"minimum": 8,
"x-nullable": false,
"example": 24
},
"name": {
"description": "Instance name",
"type": "string",
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"x-nullable": false
}
}
},
"ReadyStatus": {
"description": "Ready status",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"parameters": {
"trait:paged:limit": {
"maximum": 255,
"type": "integer",
"format": "uint8",
"name": "limit",
"in": "query"
},
"trait:paged:skip": {
"type": "string",
"name": "skip",
"in": "query"
}
},
"responses": {
"trait:standardErrors:400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"trait:standardErrors:401": {
"description": "",
"schema": {
"type": "object"
}
},
"trait:standardErrors:403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"trait:standardErrors:404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"trait:standardErrors:500": {
"description": "",
"schema": {
"type": "object"
}
}
},
"tags": [
{
"description": "Instance",
"name": "Instance"
},
{
"description": "Service",
"name": "Service"
}
]
}`))
FlatSwaggerJSON = json.RawMessage([]byte(`{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https",
"http"
],
"swagger": "2.0",
"info": {
"description": "Flexible load balancer API to control keepalived and haproxy\n",
"title": "flexlb",
"contact": {
"name": "Yaohui Wang",
"email": "yaohuiwang@outlook.com"
},
"version": "v1"
},
"basePath": "/flexlb/v1",
"paths": {
"/instances": {
"get": {
"description": "List Instances",
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "list",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": true,
"description": "Instance name",
"name": "name",
"in": "query"
}
],
"responses": {
"200": {
"description": "List Instances succeeded",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Instance"
}
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
},
"put": {
"description": "Modify Instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "modify",
"parameters": [
{
"description": "Instance request",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/InstanceConfig"
}
}
],
"responses": {
"200": {
"description": "Modify Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
},
"post": {
"description": "Create Instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "create",
"parameters": [
{
"description": "Instance config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/InstanceConfig"
}
}
],
"responses": {
"200": {
"description": "Create Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
}
},
"/instances/{name}": {
"get": {
"description": "Get Instance",
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "get",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Get Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
},
"delete": {
"description": "Delete Instance",
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "delete",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Delete Instance succeeded",
"schema": {
"type": "object"
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
}
},
"/instances/{name}/start": {
"post": {
"description": "Start instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "start",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Start instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
}
},
"/instances/{name}/stop": {
"post": {
"description": "Stop Instance",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Instance"
],
"operationId": "stop",
"parameters": [
{
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"type": "string",
"x-nullable": false,
"description": "Instance name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Stop Instance succeeded",
"schema": {
"$ref": "#/definitions/Instance"
}
},
"400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"401": {
"description": "",
"schema": {
"type": "object"
}
},
"403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "",
"schema": {
"type": "object"
}
}
}
}
},
"/readyz": {
"get": {
"description": "Ready status",
"produces": [
"application/json"
],
"tags": [
"Service"
],
"operationId": "readyz",
"responses": {
"200": {
"description": "Ready status",
"schema": {
"$ref": "#/definitions/ReadyStatus"
}
}
}
}
}
},
"definitions": {
"BackendServer": {
"description": "Backend server",
"required": [
"name",
"ipaddress",
"port"
],
"properties": {
"check_ssl_options": {
"description": "Backend check commands",
"type": "object",
"properties": {
"ca_cert": {
"type": "string",
"x-nullable": true
},
"client_cert": {
"type": "string",
"x-nullable": false
},
"client_key": {
"type": "string",
"x-nullable": false
},
"verify": {
"type": "string",
"enum": [
"none"
],
"x-nullable": true
}
},
"x-nullable": true
},
"ipaddress": {
"description": "Backend server IP address",
"type": "string",
"pattern": "((^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$))",
"x-nullable": false
},
"name": {
"description": "Backend server name",
"type": "string",
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"x-nullable": false
},
"options": {
"description": "Backend server options",
"type": "string",
"default": "",
"x-nullable": true
},
"port": {
"description": "Backend server port",
"type": "integer",
"format": "uint16",
"x-nullable": false
}
},
"additionalProperties": false
},
"BackendServerCheckSslOptions": {
"description": "Backend check commands",
"type": "object",
"properties": {
"ca_cert": {
"type": "string",
"x-nullable": true
},
"client_cert": {
"type": "string",
"x-nullable": false
},
"client_key": {
"type": "string",
"x-nullable": false
},
"verify": {
"type": "string",
"enum": [
"none"
],
"x-nullable": true
}
},
"x-nullable": true
},
"Endpoint": {
"description": "Endpoint",
"required": [
"frontend_port",
"mode",
"balance",
"backend_servers"
],
"properties": {
"backend_check_commands": {
"description": "Backend check commands",
"type": "object",
"properties": {
"check_type": {
"type": "string",
"enum": [
"http-check",
"tcp-check"
],
"x-nullable": false,
"example": "http-check"
},
"commands": {
"description": "Backend TCP check commands",
"type": "array",
"items": {
"type": "string"
},
"x-nullable": true,
"example": [
"expect status 200"
]
}
},
"x-nullable": true
},
"backend_default_server": {
"description": "Backend default server options",
"type": "string",
"default": "inter 2s downinter 5s rise 2 fall 2 slowstart 60s maxconn 2000 maxqueue 2000 weight 100",
"x-nullable": true
},
"backend_options": {
"description": "Backend options",
"type": "array",
"items": {
"type": "string"
},
"x-nullable": true,
"example": [
"httpchk GET /"
]
},
"backend_servers": {
"description": "Backend servers",
"type": "array",
"items": {
"$ref": "#/definitions/BackendServer"
},
"x-nullable": false
},
"balance": {
"description": "Balance algorithm",
"type": "string",
"default": "roundrobin",
"x-nullable": false
},
"frontend_options": {
"description": "Frontend options",
"type": "string",
"default": "",
"x-nullable": true,
"example": "ssl"
},
"frontend_port": {
"description": "Frontend port",
"type": "integer",
"format": "uint16",
"x-nullable": false,
"example": 443
},
"frontend_ssl_options": {
"description": "Backend check commands",
"type": "object",
"properties": {
"ca_cert": {
"type": "string",
"x-nullable": true
},
"server_cert": {
"type": "string",
"x-nullable": false
},
"server_key": {
"type": "string",
"x-nullable": false
},
"verify": {
"type": "string",
"enum": [
"required",
"optional"
],
"x-nullable": true
}
},
"x-nullable": true
},
"mode": {
"description": "Protocol mode",
"type": "string",
"default": "tcp",
"enum": [
"tcp",
"udp",
"http"
],
"x-nullable": false
}
},
"additionalProperties": false
},
"EndpointBackendCheckCommands": {
"description": "Backend check commands",
"type": "object",
"properties": {
"check_type": {
"type": "string",
"enum": [
"http-check",
"tcp-check"
],
"x-nullable": false,
"example": "http-check"
},
"commands": {
"description": "Backend TCP check commands",
"type": "array",
"items": {
"type": "string"
},
"x-nullable": true,
"example": [
"expect status 200"
]
}
},
"x-nullable": true
},
"EndpointFrontendSslOptions": {
"description": "Backend check commands",
"type": "object",
"properties": {
"ca_cert": {
"type": "string",
"x-nullable": true
},
"server_cert": {
"type": "string",
"x-nullable": false
},
"server_key": {
"type": "string",
"x-nullable": false
},
"verify": {
"type": "string",
"enum": [
"required",
"optional"
],
"x-nullable": true
}
},
"x-nullable": true
},
"Instance": {
"description": "Instance",
"required": [
"id",
"config",
"status"
],
"properties": {
"config": {
"x-nullable": false,
"$ref": "#/definitions/InstanceConfig"
},
"id": {
"description": "Instance ID",
"type": "integer",
"format": "uint8",
"maximum": 255,
"minimum": 0,
"x-nullable": false
},
"last_modified": {
"description": "Last modified time",
"type": "integer",
"format": "int64",
"minimum": 0,
"x-nullable": false
},
"status": {
"description": "Instance status",
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-nullable": false
}
}
},
"InstanceConfig": {
"description": "Instance config",
"required": [
"name",
"frontend_interface",
"frontend_ipaddress",
"frontend_net_prefix",
"endpoints"
],
"properties": {
"endpoints": {
"description": "Endpoints",
"type": "array",
"items": {
"$ref": "#/definitions/Endpoint"
},
"x-nullable": false
},
"frontend_interface": {
"description": "Frontend network interface",
"type": "string",
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"x-nullable": false,
"example": "eth0"
},
"frontend_ipaddress": {
"description": "Frontend IP address",
"type": "string",
"pattern": "((^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$))",
"x-nullable": false,
"example": "192.168.1.2"
},
"frontend_net_prefix": {
"description": "Frontend network prefix",
"type": "integer",
"format": "uint8",
"default": 32,
"maximum": 32,
"minimum": 8,
"x-nullable": false,
"example": 24
},
"name": {
"description": "Instance name",
"type": "string",
"pattern": "^[A-Za-z0-9\\-_.]{1,32}$",
"x-nullable": false
}
}
},
"ReadyStatus": {
"description": "Ready status",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"parameters": {
"trait:paged:limit": {
"maximum": 255,
"type": "integer",
"format": "uint8",
"name": "limit",
"in": "query"
},
"trait:paged:skip": {
"type": "string",
"name": "skip",
"in": "query"
}
},
"responses": {
"trait:standardErrors:400": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"trait:standardErrors:401": {
"description": "",
"schema": {
"type": "object"
}
},
"trait:standardErrors:403": {
"description": "",
"schema": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
},
"trait:standardErrors:404": {
"description": "",
"schema": {
"type": "object",
"required": [
"status",
"error"
],
"properties": {
"error": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"trait:standardErrors:500": {
"description": "",
"schema": {
"type": "object"
}
}
},
"tags": [
{
"description": "Instance",
"name": "Instance"
},
{
"description": "Service",
"name": "Service"
}
]
}`))
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。