mirror of
https://github.com/1Panel-dev/KubePi.git
synced 2025-10-06 15:57:03 +08:00
623 lines
18 KiB
Go
623 lines
18 KiB
Go
// Package docs GENERATED BY SWAG; DO NOT EDIT
|
|
// This file was generated by swaggo/swag
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"termsOfService": "http://kubeoperator.io",
|
|
"contact": {
|
|
"name": "Fit2cloud Support",
|
|
"url": "https://www.fit2cloud.com",
|
|
"email": "support@fit2cloud.com"
|
|
},
|
|
"license": {
|
|
"name": "Apache 2.0",
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/roles": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "List all roles",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"roles"
|
|
],
|
|
"summary": "List all roles",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/role.Role"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Create role",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"roles"
|
|
],
|
|
"summary": "Create role",
|
|
"parameters": [
|
|
{
|
|
"description": "request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/role.Role"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/role.Role"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/roles/{name}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Get role by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"roles"
|
|
],
|
|
"summary": "Get role by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/role.Role"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Update role by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"roles"
|
|
],
|
|
"summary": "Update role by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "角色名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/role.Role"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Delete role by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"roles"
|
|
],
|
|
"summary": "Delete role by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "角色名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/role.Role"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "List all users",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "List all users",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/user.User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Create user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Create user",
|
|
"parameters": [
|
|
{
|
|
"description": "request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/docs.UserCreate"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/user.User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/search": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Search users by Condition",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Search users",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/{name}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Get user by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Get user by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/user.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Update user by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Update user by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/user.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Delete user by name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Delete user by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/user.User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"api.Page": {
|
|
"type": "object",
|
|
"properties": {
|
|
"items": {},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"docs.Authenticate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"docs.Mfa": {
|
|
"type": "object",
|
|
"properties": {
|
|
"enable": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"docs.UserCreate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"authenticate": {
|
|
"$ref": "#/definitions/docs.Authenticate"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"isAdmin": {
|
|
"type": "boolean"
|
|
},
|
|
"mfa": {
|
|
"$ref": "#/definitions/docs.Mfa"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"nickName": {
|
|
"type": "string"
|
|
},
|
|
"roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"role.PolicyRule": {
|
|
"type": "object",
|
|
"properties": {
|
|
"resource": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"resourceNames": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"verbs": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"role.Role": {
|
|
"type": "object",
|
|
"properties": {
|
|
"apiVersion": {
|
|
"type": "string"
|
|
},
|
|
"builtIn": {
|
|
"type": "boolean"
|
|
},
|
|
"createAt": {
|
|
"type": "string"
|
|
},
|
|
"createdBy": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"rules": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/role.PolicyRule"
|
|
}
|
|
},
|
|
"updateAt": {
|
|
"type": "string"
|
|
},
|
|
"uuid": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"user.Authenticate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"user.Mfa": {
|
|
"type": "object",
|
|
"properties": {
|
|
"enable": {
|
|
"type": "boolean"
|
|
},
|
|
"secret": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"user.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"apiVersion": {
|
|
"type": "string"
|
|
},
|
|
"authenticate": {
|
|
"$ref": "#/definitions/user.Authenticate"
|
|
},
|
|
"builtIn": {
|
|
"type": "boolean"
|
|
},
|
|
"createAt": {
|
|
"type": "string"
|
|
},
|
|
"createdBy": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"isAdmin": {
|
|
"type": "boolean"
|
|
},
|
|
"kind": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"mfa": {
|
|
"$ref": "#/definitions/user.Mfa"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"nickName": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"updateAt": {
|
|
"type": "string"
|
|
},
|
|
"uuid": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "",
|
|
Host: "",
|
|
BasePath: "/kubepi/api/v1",
|
|
Schemes: []string{},
|
|
Title: "KubePi Restful API",
|
|
Description: "",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|