Documentation
¶
Index ¶
- type App
- type AppDefinition
- type AppVersions
- type Application
- func (ma *Application) AddParameter(key, value string, force bool) error
- func (ma *Application) Apply(force bool) error
- func (ma *Application) AsRaw() AppDefinition
- func (ma *Application) Container() *marathon.Container
- func (ma *Application) Cpus() float64
- func (ma *Application) Create(app AppDefinition) *Application
- func (ma *Application) DelEnv(name string, force bool) error
- func (ma *Application) DelParameter(key string, force bool) error
- func (ma *Application) Destroy() error
- func (ma *Application) Dump(fileName string) (err error)
- func (ma *Application) Env() map[string]string
- func (ma *Application) Get(id string) *Application
- func (ma *Application) GetTag() (string, error)
- func (ma *Application) Instances() int
- func (ma *Application) Load(fileName string) *Application
- func (ma *Application) Memory() float64
- func (ma *Application) Parameters() (map[string]string, error)
- func (ma *Application) Restart(force bool) error
- func (ma *Application) Role() string
- func (ma *Application) Scale(instances int, force bool) error
- func (ma *Application) Set(app AppDefinition) *Application
- func (ma *Application) SetContainer(to *marathon.Container, force bool) error
- func (ma *Application) SetCpus(to float64, force bool) error
- func (ma *Application) SetEnv(name, value string, force bool) error
- func (ma *Application) SetMemory(to float64, force bool) error
- func (ma *Application) SetRole(to string, force bool) error
- func (ma *Application) SetTag(tag string, force bool) error
- func (ma *Application) Start(instances int, force bool) error
- func (ma *Application) Stop(force bool) error
- func (ma *Application) Suspend(force bool) error
- func (ma *Application) Update(app AppDefinition) error
- type Fetch
- type Network
- type TaskConstraints
- type UnreachableStrategy
- type UpgradeStrategy
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
App AppDefinition `json:"app"`
}
App wraps an AppDefinition element returned by the Marathon API
type AppDefinition ¶
type AppDefinition struct {
ID string `json:"id"`
AcceptedResourceRoles []string `json:"acceptedResourceRoles,omitempty"`
BackoffFactor float64 `json:"backoffFactor,omitempty"`
BackoffSeconds int `json:"backoffSeconds,omitempty"`
Container marathon.Container `json:"container"`
Constraints []TaskConstraints `json:"constraints,omitempty"`
Cpus float64 `json:"cpus"`
Disk float64 `json:"disk,omitempty"`
Env map[string]string `json:"env,omitempty"`
Executor string `json:"executor,omitempty"`
Fetch []Fetch `json:"fetch,omitempty"`
HealthChecks []marathon.Healthcheck `json:"healthChecks,omitempty"`
Instances int `json:"instances"`
Labels map[string]string `json:"labels,omitempty"`
MaxLaunchDelaySeconds int `json:"maxLaunchDelaySeconds,omitempty"`
Mem float64 `json:"mem"`
Gpus int `json:"gpus,omitempty"`
Networks []Network `json:"networks,omitempty"`
RequirePorts bool `json:"requirePorts,omitempty"`
UpgradeStrategy UpgradeStrategy `json:"upgradeStrategy,omitempty"`
KillSelection string `json:"killSelection,omitempty"`
UnreachableStrategy UnreachableStrategy `json:"unreachableStrategy,omitempty"`
Role string `json:"role,omitempty"`
}
AppDefinition encapsulates the data definitions of a Marathon App
type AppVersions ¶
AppVersions reflects the data used by the sub-element appVersions on a Marathon App
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is a Marathon Application implementation
func New ¶
func New(client *marathon.Client) *Application
NewApplication returns a new instance of Marathon application implementation
func (*Application) AddParameter ¶
func (ma *Application) AddParameter(key, value string, force bool) error
AddParameter sets the key, value into parameters of a Marathon application
func (*Application) Apply ¶
func (ma *Application) Apply(force bool) error
Apply internal func, allows send all changes of a Marathon application to Marathon server
func (*Application) AsRaw ¶
func (ma *Application) AsRaw() AppDefinition
AsRaw returns AppDefinition content of current Application
func (*Application) Container ¶
func (ma *Application) Container() *marathon.Container
Container returns the Container information of a Marathon application
func (*Application) Cpus ¶
func (ma *Application) Cpus() float64
Cpus returns the amount of cpus from a Marathon application
func (*Application) Create ¶
func (ma *Application) Create(app AppDefinition) *Application
Create allows create a Marathon application into server
func (*Application) DelEnv ¶
func (ma *Application) DelEnv(name string, force bool) error
DelEnv deletes an environment variable from a Marathon application
func (*Application) DelParameter ¶
func (ma *Application) DelParameter(key string, force bool) error
DelParameter erase the parameter referenced by key
func (*Application) Destroy ¶
func (ma *Application) Destroy() error
Destroy erase a Marathon application from server
func (*Application) Dump ¶
func (ma *Application) Dump(fileName string) (err error)
Dump allows to create a .json file with the configuration of a Marathon application
func (*Application) Env ¶
func (ma *Application) Env() map[string]string
Env returns the Environment Variables of a Marathon application
func (*Application) Get ¶
func (ma *Application) Get(id string) *Application
Get allows to establish the internal structures to referenced id
func (*Application) GetTag ¶
func (ma *Application) GetTag() (string, error)
GetTag allows you to change the version of Docker image
func (*Application) Instances ¶
func (ma *Application) Instances() int
Instances return actual instances of a Marathon application
func (*Application) Load ¶
func (ma *Application) Load(fileName string) *Application
Load allows create or update a Marathon application from file
func (*Application) Memory ¶
func (ma *Application) Memory() float64
Memory returns the amount of memory from a Marathon application
func (*Application) Parameters ¶
func (ma *Application) Parameters() (map[string]string, error)
Parameters returns all Docker parameters of a Marathon application
func (*Application) Restart ¶
func (ma *Application) Restart(force bool) error
Restart use an endpoint to trigger a Marathon application restart
func (*Application) Role ¶
func (ma *Application) Role() string
Role returns task role of a Marathon application
func (*Application) Scale ¶
func (ma *Application) Scale(instances int, force bool) error
Scale allows change instances numbers of a Marathon application
func (*Application) Set ¶
func (ma *Application) Set(app AppDefinition) *Application
Set allows to establish the internal structures from a given app
func (*Application) SetContainer ¶
func (ma *Application) SetContainer(to *marathon.Container, force bool) error
SetContainer sets the Container information of a Marathon application
func (*Application) SetCpus ¶
func (ma *Application) SetCpus(to float64, force bool) error
SetCpus sets the amount of cpus of a Marathon application
func (*Application) SetEnv ¶
func (ma *Application) SetEnv(name, value string, force bool) error
SetEnv allows set an environment variable into a Marathon application
func (*Application) SetMemory ¶
func (ma *Application) SetMemory(to float64, force bool) error
SetMemory sets the amount of memory of a Marathon application
func (*Application) SetRole ¶
func (ma *Application) SetRole(to string, force bool) error
SetRole sets role of a Marathon application
func (*Application) SetTag ¶
func (ma *Application) SetTag(tag string, force bool) error
SetTag allows you to change the version of Docker image
func (*Application) Start ¶
func (ma *Application) Start(instances int, force bool) error
Start sets instances of a Marathon application to a number provided
func (*Application) Stop ¶
func (ma *Application) Stop(force bool) error
Stop sets instances of a Marathon application to 0
func (*Application) Suspend ¶
func (ma *Application) Suspend(force bool) error
Suspend is an alias to Stop
func (*Application) Update ¶
func (ma *Application) Update(app AppDefinition) error
Update allows change values into Marathon application
type Fetch ¶
type Fetch struct {
URI string `json:"uri"`
Extract bool `json:"extract"`
Executable bool `json:"executable"`
Cache bool `json:"cache"`
}
Fetch reflects the data used by the sub-element fetch on a Marathon App
type Network ¶
type Network struct {
Mode string `json:"mode"`
}
Network reflects the data used by the sub-element network on a Marathon App
type UnreachableStrategy ¶
type UnreachableStrategy struct {
InactiveAfterSeconds int `json:"inactiveAfterSeconds"`
ExpungeAfterSeconds int `json:"expungeAfterSeconds"`
}
UnreachableStrategy reflects the data used by the sub-element unreachableStrategy on a Marathon App
type UpgradeStrategy ¶
type UpgradeStrategy struct {
MaximumOverCapacity float64 `json:"maximumOverCapacity"`
MinimumHealthCapacity float64 `json:"minimumHealthCapacity"`
}
UpgradeStrategy reflects the data used by the sub-element ppgradeStrategy on a Marathon App