api

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V0 = "apiv0"
	V1 = "apiv1"
)

API Version constants

Variables

This section is empty.

Functions

func RequestFromV0

func RequestFromV0(req RequestV0) eremetic.Request

RequestFromV0 is needed for Go versions < 1.8 In go 1.8, Request(RequestV0) would work instead

func RequestFromV1

func RequestFromV1(req RequestV1) eremetic.Request

RequestFromV1 is needed for Go versions < 1.8 In go 1.8, Request(RequestV1) would work instead

func TaskFromV0

func TaskFromV0(task *TaskV0) eremetic.Task

TaskFromV0 is needed for Go versions < 1.8 In go 1.8, Task(TaskV0) would work instead

func TaskFromV1

func TaskFromV1(task *TaskV1) eremetic.Task

TaskFromV1 is needed for Go versions < 1.8 In go 1.8, Task(TaskV1) would work instead

Types

type RequestV0

type RequestV0 struct {
	TaskCPUs          float64                    `json:"task_cpus"`
	TaskMem           float64                    `json:"task_mem"`
	DockerImage       string                     `json:"docker_image"`
	Command           string                     `json:"command"`
	Args              []string                   `json:"args"`
	Volumes           []eremetic.Volume          `json:"volumes"`
	Ports             []eremetic.Port            `json:"ports"`
	Network           string                     `json:"network"`
	DNS               string                     `json:"dns"`
	Environment       map[string]string          `json:"env"`
	MaskedEnvironment map[string]string          `json:"masked_env"`
	AgentConstraints  []eremetic.AgentConstraint `json:"slave_constraints"`
	CallbackURI       string                     `json:"callback_uri"`
	URIs              []string                   `json:"uris"`
	Fetch             []eremetic.URI             `json:"fetch"`
	ForcePullImage    bool                       `json:"force_pull_image"`
}

RequestV0 represents the old deprecated json-structure of a job request

type RequestV1

type RequestV1 struct {
	TaskCPUs          float64                    `json:"cpu"`
	TaskMem           float64                    `json:"mem"`
	DockerImage       string                     `json:"image"`
	Command           string                     `json:"command"`
	Args              []string                   `json:"args"`
	Volumes           []eremetic.Volume          `json:"volumes"`
	Ports             []eremetic.Port            `json:"ports"`
	Network           string                     `json:"network"`
	DNS               string                     `json:"dns"`
	Environment       map[string]string          `json:"env"`
	MaskedEnvironment map[string]string          `json:"masked_env"`
	AgentConstraints  []eremetic.AgentConstraint `json:"agent_constraints"`
	CallbackURI       string                     `json:"callback_uri"`
	Fetch             []eremetic.URI             `json:"fetch"`
	ForcePullImage    bool                       `json:"force_pull_image"`
}

RequestV1 represents the V1 json-structure of a job request

type Route

type Route struct {
	Name    string
	Method  string
	Pattern string
	Handler http.Handler
}

Route enforces the structure of a route

type Routes

type Routes []Route

Routes is a collection of route structs

type TaskV0

type TaskV0 struct {
	TaskCPUs          float64                    `json:"task_cpus"`
	TaskMem           float64                    `json:"task_mem"`
	Command           string                     `json:"command"`
	Args              []string                   `json:"args"`
	User              string                     `json:"user"`
	Environment       map[string]string          `json:"env"`
	MaskedEnvironment map[string]string          `json:"masked_env"`
	Image             string                     `json:"image"`
	Volumes           []eremetic.Volume          `json:"volumes"`
	Ports             []eremetic.Port            `json:"ports"`
	Status            []eremetic.Status          `json:"status"`
	ID                string                     `json:"id"`
	Name              string                     `json:"name"`
	Network           string                     `json:"network"`
	DNS               string                     `json:"dns"`
	FrameworkID       string                     `json:"framework_id"`
	AgentID           string                     `json:"slave_id"`
	AgentConstraints  []eremetic.AgentConstraint `json:"slave_constraints"`
	Hostname          string                     `json:"hostname"`
	Retry             int                        `json:"retry"`
	CallbackURI       string                     `json:"callback_uri"`
	SandboxPath       string                     `json:"sandbox_path"`
	AgentIP           string                     `json:"agent_ip"`
	AgentPort         int32                      `json:"agent_port"`
	ForcePullImage    bool                       `json:"force_pull_image"`
	FetchURIs         []eremetic.URI             `json:"fetch"`
}

TaskV0 defines the deprecated json-structure for the properties of a scheduled task.

func TaskV0FromTask

func TaskV0FromTask(task *eremetic.Task) TaskV0

TaskV0FromTask is needed for Go versions < 1.8 In go 1.8, TaskV0(Task) would work instead

type TaskV1

type TaskV1 struct {
	TaskCPUs          float64                    `json:"cpu"`
	TaskMem           float64                    `json:"mem"`
	Command           string                     `json:"command"`
	Args              []string                   `json:"args"`
	User              string                     `json:"user"`
	Environment       map[string]string          `json:"env"`
	MaskedEnvironment map[string]string          `json:"masked_env"`
	Image             string                     `json:"image"`
	Volumes           []eremetic.Volume          `json:"volumes"`
	Ports             []eremetic.Port            `json:"ports"`
	Status            []eremetic.Status          `json:"status"`
	ID                string                     `json:"id"`
	Name              string                     `json:"name"`
	Network           string                     `json:"network"`
	DNS               string                     `json:"dns"`
	FrameworkID       string                     `json:"framework_id"`
	AgentID           string                     `json:"agent_id"`
	AgentConstraints  []eremetic.AgentConstraint `json:"agent_constraints"`
	Hostname          string                     `json:"hostname"`
	Retry             int                        `json:"retry"`
	CallbackURI       string                     `json:"callback_uri"`
	SandboxPath       string                     `json:"sandbox_path"`
	AgentIP           string                     `json:"agent_ip"`
	AgentPort         int32                      `json:"agent_port"`
	ForcePullImage    bool                       `json:"force_pull_image"`
	FetchURIs         []eremetic.URI             `json:"fetch"`
}

TaskV1 defines the API V1 json-structure for the properties of a scheduled task.

func TaskV1FromTask

func TaskV1FromTask(task *eremetic.Task) TaskV1

TaskV1FromTask is needed for Go versions < 1.8 In go 1.8, TaskV1(Task) would work instead

Jump to

Keyboard shortcuts

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