blob: d37b2fcc838a7302bcdf374eb110f6fb07910bcf [file]
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Package doc Code generated by swaggo/swag. DO NOT EDIT
package doc
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/config/api/base": {
"get": {
"description": "get pixiu base info such as name,desc",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get basic configuration of Pixiu",
"responses": {
"200": {
"description": "YAML content",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/base/": {
"put": {
"description": "Pass YAML content through the form's content field to set basic information.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "modify pixiu base info such as name,desc",
"parameters": [
{
"type": "string",
"description": "YAML content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "Pass YAML content through the form's content field to set basic information.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "modify pixiu base info such as name,desc",
"parameters": [
{
"type": "string",
"description": "YAML content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/cluster": {
"put": {
"description": "Create a cluster by passing the YAML/JSON configuration for the cluster through the form's content field.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "create cluster",
"parameters": [
{
"type": "string",
"description": "Cluster content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "pass the Cluster's YAML/JSON via the form's content field to update the cluster.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "update cluster",
"parameters": [
{
"type": "string",
"description": "Cluster content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"description": "delete cluster according to cluster ID",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "delete cluster",
"parameters": [
{
"type": "string",
"description": "Cluster ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/cluster/detail": {
"get": {
"description": "get cluster detail according to cluster ID",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get cluster detail",
"parameters": [
{
"type": "string",
"description": "Cluster ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/cluster/list": {
"get": {
"description": "get all clusters' info",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get cluster list",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/listener": {
"put": {
"description": "pass the YAML/JSON for the Listener through the form's content field to create the Listener.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "create a Listener",
"parameters": [
{
"type": "string",
"description": "Listener content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "pass the YAML/JSON for the Listener through the form's content field to update the Listener.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "update Listener",
"parameters": [
{
"type": "string",
"description": "Listener content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"description": "delete the Listener based on the name",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "delete Listener",
"parameters": [
{
"type": "string",
"description": "Listener id",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/listener/detail": {
"get": {
"description": "get Listener details based on name",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get Listener detail",
"parameters": [
{
"type": "string",
"description": "Listener name",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/listener/list": {
"get": {
"description": "get all Listener list",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get all Listener list",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/plugin_group/publish": {
"put": {
"description": "publish the PluginGroup from the unpublished space to the published space.",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "batch Release PluginGroup Config",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource": {
"put": {
"description": "modify resource content, where content is the YAML of the Resource. Use resourceId to specify the resource to be modified.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "modify resource",
"parameters": [
{
"type": "integer",
"description": "resource ID",
"name": "resourceId",
"in": "query"
},
{
"type": "string",
"description": "Resource YAML",
"name": "content",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "create a resource by passing the Resource's YAML via the form's content field (simultaneously writing to the staging area and production area).",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "create resource",
"parameters": [
{
"type": "string",
"description": "Resource YAML",
"name": "content",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"description": "delete resources by ID. When unpublished is 1, this indicates deleting configurations for unpublished spaces (requires checking published spaces).",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "delete resource",
"parameters": [
{
"type": "integer",
"description": "resource ID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/detail": {
"get": {
"description": "get resource details according to resource ID and return the YAML",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get resource detail with yml",
"parameters": [
{
"type": "integer",
"description": "ResourceID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "YAML content",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/list": {
"get": {
"description": "Retrieve the list of resources. Use the unpublished parameter to control whether to include unpublished or published resources.",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get all resource list",
"parameters": [
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "JSON array",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/method": {
"put": {
"description": "Modify the specified method, where content is the YAML for Method.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "modify method",
"parameters": [
{
"type": "integer",
"description": "ResourceID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "MethodID",
"name": "methodId",
"in": "query"
},
{
"type": "string",
"description": "Method YAML",
"name": "content",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "create a method under the specified resource, where content is the YAML for Method.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "create method",
"parameters": [
{
"type": "integer",
"description": "ResourceID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Method YAML",
"name": "content",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"description": "Deleting a method under a resource, where ` + "`" + `unpublished` + "`" + ` equals 1 indicates removing the configuration for unpublished spaces (requires checking published spaces).",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "delete method",
"parameters": [
{
"type": "integer",
"description": "ResourceID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "MethodID",
"name": "methodId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/method/detail": {
"get": {
"description": "get method details based on resourceId and methodId, returning YAML.",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get method detail with yml",
"parameters": [
{
"type": "integer",
"description": "resource ID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "method ID",
"name": "methodId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "YAML content",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/method/list": {
"get": {
"description": "get the list of methods under the specified resource",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get all method list below one resource",
"parameters": [
{
"type": "integer",
"description": "resource ID",
"name": "resourceId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "1: unpublished; 0 or empty: published",
"name": "unpublished",
"in": "formData"
}
],
"responses": {
"200": {
"description": "JSON array",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/method/publish": {
"put": {
"description": "TODO: unimplemented",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "batch Release Method Config",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/opa/policy": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "get OPA policy (server mode)",
"parameters": [
{
"type": "string",
"description": "OPA server url",
"name": "server_url",
"in": "query"
},
{
"type": "string",
"description": "Policy ID",
"name": "policy_id",
"in": "query"
},
{
"type": "string",
"description": "Bearer token",
"name": "bearer_token",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"put": {
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "upload OPA policy (server mode)",
"parameters": [
{
"type": "string",
"description": "OPA server url",
"name": "server_url",
"in": "formData"
},
{
"type": "string",
"description": "Policy ID",
"name": "policy_id",
"in": "formData"
},
{
"type": "string",
"description": "Bearer token",
"name": "bearer_token",
"in": "formData"
},
{
"type": "string",
"description": "Rego content",
"name": "content",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "delete OPA policy (server mode)",
"parameters": [
{
"type": "string",
"description": "OPA server url",
"name": "server_url",
"in": "query"
},
{
"type": "string",
"description": "Policy ID",
"name": "policy_id",
"in": "query"
},
{
"type": "string",
"description": "Bearer token",
"name": "bearer_token",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/config/api/resource/publish": {
"put": {
"description": "publish resources from unpublished spaces to published spaces",
"produces": [
"application/json"
],
"tags": [
"Config"
],
"summary": "publish all configuration information",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/register": {
"post": {
"produces": [
"application/json"
],
"tags": [
"Register"
],
"summary": "user registration",
"parameters": [
{
"type": "string",
"description": "username",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "password",
"name": "password",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "{\"code\":\"\",\"data\":\"\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/user/checkIsAdmin": {
"post": {
"description": "to determine whether the current user is an administrator, the header must include the username.",
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "determine whether you are an administrator",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/user/getInfo": {
"post": {
"description": "return the current user's detailed information. The header must include the username.",
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "get user information",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/user/getUserRole": {
"post": {
"description": "return the current user's role information. The header must include the username.",
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "get user role",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/user/logout": {
"post": {
"description": "log out the current user (invalidate the token)",
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "user logout",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/user/password/edit": {
"post": {
"description": "to modify the current user's password, the username must be included in the header.",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "modify account password",
"parameters": [
{
"type": "string",
"description": "old password",
"name": "oldPassword",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "new password",
"name": "newPassword",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}