Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2023 License: Apache-2.0, MIT Imports: 24 Imported by: 0

README

blueprint

Summary

Users can set pipepline plan by config-ui to create schedule jobs. And config-ui will send blueprint request with cronConfig in crontab format.

Cron Job

cronConfig should look like this: "M H D M WD"

M: minute

H: hour

D: day(month)

M: month

WD: day(week)

Please check cron time format in https://crontab.guru/

API

POST /blueprints

Request
{
	"name": "COLLECT 1648121282469",
	"tasks": [
		[
			{
				"plugin": "github",
				"options": {
					"repo": "lake",
					"owner": "merico-dev"
				}
			}
		]
	],
	"enable": true,
	"cronConfig": "103 13 /13 * *"
}
Response
{
	"id": 7,
	"createdAt": "2022-03-27T10:16:20.046+08:00",
	"updatedAt": "2022-03-27T10:16:20.046+08:00",
	"name": "COLLECT 1648121282469",
	"tasks": [
		[
			{
				"plugin": "github",
				"options": {
					"owner": "merico-dev",
					"repo": "lake"
				}
			}
		]
	],
	"enable": true,
	"cronConfig": "103 13 /13 * *"
}

GET /blueprints

Response
{
	"id": 7,
	"createdAt": "2022-03-27T10:16:20.046+08:00",
	"updatedAt": "2022-03-27T10:16:20.046+08:00",
	"name": "COLLECT 1648121282469",
	"tasks": [
		[
			{
				"plugin": "github",
				"options": {
					"owner": "merico-dev",
					"repo": "lake"
				}
			}
		]
	],
	"enable": true,
	"cronConfig": "103 13 /13 * *"

}

GET /blueprints/:blueprintId

Response
{
	"id": 7,
	"createdAt": "2022-03-27T10:16:20.046+08:00",
	"updatedAt": "2022-03-27T10:16:20.046+08:00",
	"name": "COLLECT 1648121282469",
	"tasks": [
		[
			{
				"plugin": "github",
				"options": {
					"owner": "merico-dev",
					"repo": "lake"
				}
			}
		]
	],
	"enable": true,
	"cronConfig": "103 13 /13 * *"
}

PATCH /blueprints/:blueprintId

Request
{
	"name": "COLLECT 1648121282469",
	"tasks": [
		[
			{
				"plugin": "github",
				"options": {
					"repo": "lake",
					"owner": "merico-dev"
				}
			}
		]
	],
	"enable": true,
	"cronConfig": "103 13 /13 * *"
}
Response
{
	"id": 7,
	"createdAt": "2022-03-27T10:16:20.046+08:00",
	"updatedAt": "2022-03-27T10:16:20.046+08:00",
	"name": "COLLECT 1648121282469",
	"tasks": [
		[
			{
				"plugin": "github",
				"options": {
					"owner": "merico-dev",
					"repo": "lake"
				}
			}
		]
	],
	"enable": true,
	"cronConfig": "103 13 /13 * *"
}

Documentation

Index

Constants

View Source
const DB_MIGRATION_REQUIRED = `` /* 393-byte string literal not displayed */

Variables

This section is empty.

Functions

func CreateApiService

func CreateApiService()

@title DevLake Swagger API @version 0.1 @description <h2>This is the main page of devlake api</h2> @license.name Apache-2.0 @host localhost:8080 @BasePath /

func RegisterRouter

func RegisterRouter(r *gin.Engine)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL