marathon

package module
v0.0.0-...-fca56e9 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2015 License: MIT Imports: 6 Imported by: 0

README

Go Marathon

An api client for interacting with Mesosphere's Marathon

Go Lib for interacting with Mesosphere's Marathon

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ID              string                 `json:"id"`
	CMD             string                 `json:"cmd,omitempty" bson:"cmd,omitempty"`
	Args            []string               `json:"args,omitempty" bson:"args,omitempty"`
	CPUS            float64                `json:"cpus,omitempty" bson:"cpus"`
	Mem             float64                `json:"mem,omitempty" bson:"mem"`
	HealthChecks    []HealthCheck          `json:"healthChecks,omitempty" bson:"healthChecks"`
	Container       Container              `json:"container,omitempty" bson:"container"`
	Ports           []int                  `json:"ports,omitempty" bson:"ports,omitempty"`
	Instances       int                    `json:"instances,omitempty" bson:"instances,omitempty"`
	UpgradeStrategy UpgradeStrategy        `json:"upgradeStrategy,omitempty" bson:"upgradeStrategy,omitempty"`
	Version         string                 `json:"version,omitempty" bson:"version,omitempty"`
	Env             map[string]interface{} `json:"env" bson:"env,omitempty"`
	URIs            []string               `json:"uris" bson:"uris,omitempty"`
	DockerImage     string                 `json:"dockerImage" bson:"dockerImage,omitempty"`
	Tag             string                 `json:"tag" bson:"tag,omitempty"`
	TasksRunning    int                    `json:"tasksRunning,omitempty" bson:"tasksRunning,omitempty"`
	TasksStaged     int                    `json:"tasksStaged,omitempty" bson:"tasksStaged,omitempty"`
	Tasks           []Task                 `json:"tasks,omitempty" bson:"tasks,omitempty"`
	User            string                 `json:"user,omitempty" bson:"user,omitempty"`
	// contains filtered or unexported fields
}

App is sets the basic app structure

func (App) All

func (a App) All() (AppsResponse, error)

All Returns information about all the apps

func (App) Create

func (a App) Create(body App) (App, error)

Create builds an app in marathon

func (App) Delete

func (a App) Delete(id string) error

Delete removes an Application from marathon

func (App) GetVersion

func (a App) GetVersion(name, v string) (App, error)

GetVersion gets info about a single version

func (App) GetVersions

func (a App) GetVersions(name string) (VersionsResponse, error)

GetVersions return all the versions of an app

func (App) One

func (a App) One(id string) (AppResponse, error)

One returns information about a single app

func (App) Update

func (a App) Update(id string, body App) (App, error)

Update builds an app in marathon

type AppResponse

type AppResponse struct {
	App App `json:"app"`
}

AppResponse is the response wrapper for getting information about an app

type AppsResponse

type AppsResponse struct {
	Apps []App `json:"apps"`
}

AppsResponse is the response wrapper for getting information about all apps

type Client

type Client struct {
	App  App  `json:"app"`
	Task Task `json:"task"`
}

Client is the object for containing the client for

func NewClient

func NewClient(uri string) Client

NewClient returns the Client object to interact with marathon

type Container

type Container struct {
	Type    string           `json:"type"`
	Docker  DockerProperties `json:"docker"`
	Volumes Volume           `json:"volumes"`
}

Container is the structure for creating a container object

type DockerProperties

type DockerProperties struct {
	Image        string        `json:"image"`
	Network      string        `json:"network,omitempty"`
	PortMappings []PortMapping `json:"portMappings,omitempty"`
}

DockerProperties is everything to you need to send a docker container

type HealthCheck

type HealthCheck struct {
	Protocol               string `json:"protocol"`
	Path                   string `json:"path"`
	GracePeriodSeconds     int    `json:"gracePeriodSeconds,omitempty"`
	IntervalSeconds        int    `json:"intervalSeconds,omitempty"`
	PortIndex              int    `json:"portIndex,omitempty"`
	TimeoutSeconds         int    `json:"timeoutSeconds,omitempty"`
	MaxConsecutiveFailures int    `json:"maxConsecutiveFailures,omitempty"`
}

HealthCheck is structure for creating a health check

type HealthCheckResult

type HealthCheckResult struct {
	Alive               bool   `json:"alive" bson:"alive"`
	ConsecutiveFailures int    `json:"consecutiveFailures" bson:"consecutiveFailures"`
	FirstSuccess        string `json:"firstSuccess" bson:"firstSuccess"`
	LastFailure         string `json:"lastFailure,omitempty" bson:"lastFailure"`
	LastSuccess         string `json:"lastSuccess" bson:"lastSuccess"`
	TaskID              string `json:"taskId" bson:"taskId"`
}

HealthCheckResult is the structure of the status check

type PortMapping

type PortMapping struct {
	ContainerPort int    `json:"containerPort"`
	HostPort      int    `json:"hostPort"`
	ServicePort   int    `json:"servicePort"`
	Protocol      string `json:"protocol"`
}

PortMapping is used to map ports

type Task

type Task struct {
	AppID              string              `json:"appId" bson:"appId"`
	Host               string              `json:"host" bson:"host"`
	ID                 string              `json:"id" bson:"id"`
	Ports              []int               `json:"ports" bson:"ports"`
	StagedAt           string              `json:"stagedAt" bson:"stagedAt"`
	StartedAt          string              `json:"startedAt" bson:"startedAt"`
	Version            string              `json:"version" bson:"version"`
	HealthCheckResults []HealthCheckResult `json:"healthCheckResults" bson:"healthCheckResults"`
	// contains filtered or unexported fields
}

Task is the structure of a task in app response

func (Task) List

func (t Task) List() (TasksResponse, error)

List lists all the current running tasks

type TasksResponse

type TasksResponse struct {
	Tasks []Task `json:"tasks" bson:"tasks"`
}

TasksResponse is the object returned from marathon

type UpgradeStrategy

type UpgradeStrategy struct {
	MinimumHealthCapacity float64 `json:"minimumHealthCapacity"`
}

UpgradeStrategy allsow your to set your deploy

type VersionsResponse

type VersionsResponse struct {
	Versions []string `json:"versions"`
}

VersionsResponse is the response wrapper for getting information about all apps

type Volume

type Volume struct {
	ContainerPath string `json:"containerPath"`
	HostPath      string `json:"hostPath"`
	Mode          string `json:"mode"`
}

Volume is the structure for appending volumnes

Jump to

Keyboard shortcuts

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