marathon

package
v0.0.0-...-11f2a26 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DeclinedScarceResources = "DeclinedScarceResources"
View Source
const InsufficientCpus = "InsufficientCpus"
View Source
const InsufficientDisk = "InsufficientDisk"
View Source
const InsufficientMemory = "InsufficientMemory"
View Source
const InsufficientPorts = "InsufficientPorts"
View Source
const UnfulfilledConstraint = "UnfulfilledConstraint"
View Source
const UnfulfilledRole = "UnfulfilledRole"

Variables

View Source
var ErrCannotReadAppDefinition = errors.New("cannot read app definition")

Functions

func NormalizeAppID

func NormalizeAppID(appID string) string

NormalizeAppID will return a string with the correct Application ID form based on the given string

Types

type Client

type Client struct {
	API goMarathon.Marathon
	// contains filtered or unexported fields
}

Client to interact with the Marathon API.

func NewClient

func NewClient(ctx api.Context) (*Client, error)

NewClient creates a new HTTP wrapper client to talk to the Marathon service.

func (*Client) AddApp

func (c *Client) AddApp(ctx api.Context, appLocation string) (*goMarathon.Application, error)

AddApp creates a deployment from the app definition referenced in appFile which can be a local file name or an HTTP URL. If appFile is empty, the definition is read from ctx.Input().

func (*Client) ApplicationByVersion

func (c *Client) ApplicationByVersion(appID string, version string) (*goMarathon.Application, error)

func (*Client) ApplicationVersions

func (c *Client) ApplicationVersions(appID string) (goMarathon.ApplicationVersions, error)

func (*Client) Applications

func (c *Client) Applications() ([]goMarathon.Application, error)

func (*Client) Deployments

func (c *Client) Deployments() ([]goMarathon.Deployment, error)

func (*Client) GroupsWithoutRootSlash

func (c *Client) GroupsWithoutRootSlash() (map[string]bool, error)

GroupsWithoutRootSlash returns the Marathon groups' names as a map without the first "/". This makes it easy to match Marathon groups with Mesos roles that cannot start with "/".

func (*Client) Info

func (c *Client) Info() (map[string]interface{}, error)

Info returns the content of the Marathon endpoint 'v2/info'.

func (*Client) KillTasks

func (c *Client) KillTasks(appID string, host string) (map[string]interface{}, error)

KillTasks kill all the tasks of a Marathon app.

func (*Client) Queue

func (c *Client) Queue() (goMarathon.Queue, error)

func (*Client) QueueWithLastUnusedOffers

func (c *Client) QueueWithLastUnusedOffers() (goMarathon.Queue, error)

func (*Client) RawQueue

func (c *Client) RawQueue() (*RawQueue, error)

RawQueue returns the content of a Marathon endpoint url.

type ErrAppAlreadyExists

type ErrAppAlreadyExists struct {
	// contains filtered or unexported fields
}

func (ErrAppAlreadyExists) Error

func (e ErrAppAlreadyExists) Error() string

type Groups

type Groups struct {
	Groups []struct {
		ID string `json:"id"`
	} `json:"groups"`
}

Groups represents a stripped down version of the Marathon groups

type RawQueue

type RawQueue struct {
	Queue []map[string]interface{} `json:"queue"`
}

RawQueue represents a queue returned by /v2/queue?embed=lastUnusedOffers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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