manager

package
v0.0.0-...-79aafff Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCPULimit = "0.44"

DefaultCPULimit is the maximum cpu amount

View Source
var DefaultCPURequest = "0.22"

DefaultCPURequest is the cpu amount requested

View Source
var DefaultMemory = "650Mi"

DefaultMemory is the maximum memory assigned to a Pod

View Source
var RootToken string

RootToken is the token used for the cluster's authentication

Functions

func Init

func Init(token string, memory string) http.Handler

Init starts the manager

func Purge

func Purge(w http.ResponseWriter, r *http.Request, p httprouter.Params, response PostRequest, clientset kubernetes.Clientset)

Purge (delete) a task

func PurgeSelector

func PurgeSelector(clientset kubernetes.Clientset, selector string)

PurgeSelector purges tasks by selector

func Run

func Run(w http.ResponseWriter, r *http.Request, p httprouter.Params, response PostRequest, clientset kubernetes.Clientset)

Run a pod

func Status

func Status(w http.ResponseWriter, r *http.Request, p httprouter.Params, response PostRequest, clientset kubernetes.Clientset)

Status returns the status of all current importers in the cluster

func Stop

func Stop(w http.ResponseWriter, r *http.Request, p httprouter.Params, response PostRequest, clientset kubernetes.Clientset)

Stop (delete) a task

Types

type JobStatus

type JobStatus struct {
	Status string `json:"status"`
}

JobStatus is the JSON status sent back to the api

type PostErrorResponse

type PostErrorResponse struct {
	Success bool   `json:"success"`
	Code    int    `json:"code"`
	Error   string `json:"error"`
	Auth    bool   `json:"auth"`
	Id      string `json:"id"`
}

PostErrorResponse is the JSON error response payload

type PostRequest

type PostRequest struct {
	Token      string            `json:"token"`
	Command    string            `json:"command"`
	Image      string            `json:"image"`
	Auth       string            `json:"auth"`
	Labels     map[string]string `json:"labels`
	Name       string            `json:"name"`
	Id         string            `json:"id"`
	Memory     string            `json:"memory"` // 1G
	CPULimit   string            `json:"cpuLimit"`
	CPURequest string            `json:"cpuRequest"`
	JobID      string            `json:"jobId"`
	ImporterID string            `json:"importerId"`
	SourceID   string            `json:"sourceId"`
	PreStop    string            `json:"preStop"`
}

PostRequest is the request sent to the manager

func HandleGetAuth

func HandleGetAuth(w http.ResponseWriter, r *http.Request) (PostRequest, error)

func HandlePostAuth

func HandlePostAuth(w http.ResponseWriter, r *http.Request) (PostRequest, error)

type PostSuccessResponse

type PostSuccessResponse struct {
	Success    bool   `json:"success"`
	Id         string `json:"id"`
	ImporterID string `json:"importerId"`
	Status     string `json:"status"`
}

PostSuccessResponse is the JSON success response payload

Jump to

Keyboard shortcuts

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