Skip to content

Commit

Permalink
Merge pull request #2873 from walterlife/feature/workflow-swagger-docs
Browse files Browse the repository at this point in the history
[ISSUE #2865] add workflow swagger doc
  • Loading branch information
xwm1992 authored Jan 10, 2023
2 parents aa6ee3b + 4bee4ca commit be19e22
Show file tree
Hide file tree
Showing 3 changed files with 1,006 additions and 0 deletions.
392 changes: 392 additions & 0 deletions eventmesh-workflow-go/cmd/controller/docs/docs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,392 @@
// 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 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}}",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/workflow": {
"get": {
"description": "query workflow list",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "query workflow list",
"parameters": [
{
"type": "string",
"description": "workflow id",
"name": "workflow_id",
"in": "query"
},
{
"type": "string",
"description": "workflow status",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "query page",
"name": "page",
"in": "query"
},
{
"type": "string",
"description": "query size",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.QueryWorkflowsResponse"
}
},
"400": {
"description": "Bad Request"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"post": {
"description": "save a workflow",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "save a workflow",
"parameters": [
{
"description": "workflow data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/main.SaveWorkflowRequest"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/workflow/instances": {
"get": {
"description": "query workflow instances",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "query workflow instances",
"parameters": [
{
"type": "string",
"description": "workflow id",
"name": "workflow_id",
"in": "query"
},
{
"type": "string",
"description": "query page",
"name": "page",
"in": "query"
},
{
"type": "string",
"description": "query size",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.QueryWorkflowInstancesResponse"
}
},
"400": {
"description": "Bad Request"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/workflow/{workflowId}": {
"get": {
"description": "query workflow detail info",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "query workflow detail info",
"parameters": [
{
"type": "string",
"description": "workflow id",
"name": "workflowId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.QueryWorkflowResponse"
}
},
"400": {
"description": "Bad Request"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
},
"delete": {
"description": "delete a workflow",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "delete a workflow",
"parameters": [
{
"type": "string",
"description": "workflow id",
"name": "workflowId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.QueryWorkflowsResponse"
}
},
"400": {
"description": "Bad Request"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
}
}
},
"definitions": {
"main.QueryWorkflowInstancesResponse": {
"type": "object",
"properties": {
"total": {
"description": "total count",
"type": "integer"
},
"workflow_instances": {
"type": "array",
"items": {
"$ref": "#/definitions/model.WorkflowInstance"
}
}
}
},
"main.QueryWorkflowResponse": {
"type": "object",
"properties": {
"workflow": {
"$ref": "#/definitions/model.Workflow"
}
}
},
"main.QueryWorkflowsResponse": {
"type": "object",
"properties": {
"total": {
"description": "total count",
"type": "integer"
},
"workflows": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Workflow"
}
}
}
},
"main.SaveWorkflowRequest": {
"type": "object",
"properties": {
"workflow": {
"$ref": "#/definitions/model.Workflow"
}
}
},
"model.Workflow": {
"type": "object",
"properties": {
"create_time": {
"type": "string"
},
"definition": {
"type": "string"
},
"id": {
"type": "integer"
},
"status": {
"type": "integer"
},
"total_failed_instances": {
"type": "integer"
},
"total_instances": {
"type": "integer"
},
"total_running_instances": {
"type": "integer"
},
"update_time": {
"type": "string"
},
"version": {
"type": "string"
},
"workflow_id": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
}
},
"model.WorkflowInstance": {
"type": "object",
"properties": {
"create_time": {
"type": "string"
},
"id": {
"type": "integer"
},
"update_time": {
"type": "string"
},
"workflow_id": {
"type": "string"
},
"workflow_instance_id": {
"type": "string"
},
"workflow_status": {
"type": "integer"
}
}
}
}
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Workflow API",
Description: "This is a workflow server.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
Loading

0 comments on commit be19e22

Please sign in to comment.