Documentation ¶
Overview ¶
Package gomarathon provIDes a client to interact with a marathon api. on http or https
Index ¶
- Constants
- type Application
- type Client
- func (c *Client) CreateApp(app *Application) (*Response, error)
- func (c *Client) DeleteApp(appID string) (*Response, error)
- func (c *Client) DeleteCallbackURL(uri string) (*Response, error)
- func (c *Client) GetApp(appID string) (*Response, error)
- func (c *Client) GetAppTasks(appID string) (*Response, error)
- func (c *Client) GetAppVersion(appID string, version string) (*Response, error)
- func (c *Client) GetEventSubscriptions() (*Response, error)
- func (c *Client) KillTask(appID string, taskID string, scale bool) (*Response, error)
- func (c *Client) KillTasks(appID string, host string, scale bool) (*Response, error)
- func (c *Client) ListAppVersions(appID string) (*Response, error)
- func (c *Client) ListApps() (*Response, error)
- func (c *Client) ListAppsByCmd(filter string) (*Response, error)
- func (c *Client) ListTasks() (*Response, error)
- func (c *Client) RegisterCallbackURL(uri string) (*Response, error)
- func (c *Client) RestartApp(appID string) (*Response, error)
- func (c *Client) UpdateApp(appID string, app *Application) (*Response, error)
- type Container
- type Deployment
- type DeploymentStep
- type Docker
- type EventSubscription
- type HealthCheck
- type Parameters
- type PortMapping
- type RequestOptions
- type Response
- type Task
- type UpgradeStrategy
- type Volume
Constants ¶
const (
APIVersion = "/v2"
)
Actual version of the marathon api
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { ID string `json:"id"` Cmd string `json:"cmd,omitempty"` Constraints [][]string `json:"constraints,omitempty"` Container *Container `json:"container,omitempty"` CPUs float32 `json:"cpus,omitempty"` Deployments []*Deployment `json:"deployments,omitempty"` Env map[string]string `json:"env,omitempty"` Executor string `json:"executor,omitempty"` HealthChecks []*HealthCheck `json:"healthChecks,omitempty"` Instances int `json:"instances,omitemptys"` Mem float32 `json:"mem,omitempty"` Tasks []*Task `json:"tasks,omitempty"` Ports []int `json:"ports,omitempty"` RequirePorts bool `json:"requirePorts,omitempty"` BackoffSeconds float64 `json:"backoffSeconds,omitempty"` BackoffFactor float32 `json:"backoffFactor,omitempty"` MaxLaunchDelaySeconds float64 `json:"maxLaunchDelaySeconds,omitempty"` TasksRunning int `json:"tasksRunning,omitempty"` TasksStaged int `json:"tasksStaged,omitempty"` UpgradeStrategy *UpgradeStrategy `json:"upgradeStrategy,omitempty"` Uris []string `json:"uris,omitempty"` Version string `json:"version,omitempty"` }
Application marathon application see : https://github.com/mesosphere/marathon/blob/master/REST.md#apps
type Client ¶
Client is containing the configured http.Client and the host url
func (*Client) CreateApp ¶
func (c *Client) CreateApp(app *Application) (*Response, error)
CreateApp Create a new Application
func (*Client) DeleteCallbackURL ¶
DeleteCallbackURL delete a particular callback url
func (*Client) GetAppTasks ¶
GetAppTasks get the tasks across the cluster from the appid
func (*Client) GetAppVersion ¶
GetAppVersion get a single version from a single app
func (*Client) GetEventSubscriptions ¶
GetEventSubscriptions gets all registered callback url
func (*Client) ListAppVersions ¶
ListAppVersions list app versions from a define appid
func (*Client) ListAppsByCmd ¶
ListAppsByCmd list all apps by cmd filter
func (*Client) RegisterCallbackURL ¶
RegisterCallbackURL register a new callback url
type Container ¶
type Container struct { Type string `json:"type,omitempty"` Docker *Docker `json:"docker,omitempty"` Volumes []*Volume `json:"volumes,omitempty"` }
Container is docker parameters
type Deployment ¶
type Deployment struct { AffectedApps []string `json:"affectedApps"` ID string `json:"id"` Steps []*DeploymentStep `json:"steps"` CurrentActions []*DeploymentStep `json:"currentActions"` CurrentStep int `json:"currentStep"` TotalSteps int `json:"totalSteps"` Version string `json:"version"` }
Deployment is described here: https://mesosphere.github.io/marathon/docs/rest-api.html#get-/v2/deployments
type DeploymentStep ¶
Deployment steps
type Docker ¶
type Docker struct { Image string `json:"image,omitempty"` Network string `json:"network,omitempty"` PortMappings []*PortMapping `json:"portMappings,omitempty"` }
Docker options
type EventSubscription ¶
type EventSubscription struct { CallbackURL string `json:"CallbackUrl"` ClientIP string `json:"ClientIp"` EventType string `json:"eventType"` CallbackURLs []string `json:"CallbackUrls"` }
EventSubscription is described here: https://github.com/mesosphere/marathon/blob/master/REST.md#event-subscriptions
type HealthCheck ¶
type HealthCheck struct { Protocol string `json:"protocol,omitempty"` Path string `json:"path,omitempty"` GracePeriodSeconds int `json:"gracePeriodSeconds,omitempty"` IntervalSeconds int `json:"intervalSeconds,omitempty"` PortIndex int `json:"portIndex,omitempty"` TimeoutSeconds int `json:"timeoutSeconds,omitempty"` }
HealthCheck is described here: https://github.com/mesosphere/marathon/blob/master/REST.md#healthchecks
type Parameters ¶
Parameters to build url query
type PortMapping ¶
type PortMapping struct { ContainerPort int `json:"containerPort,omitempty"` HostPort int `json:"hostPort,omitempty"` ServicePort int `json:"servicePort,omitempty"` Protocol string `json:"protocol,omitempty"` }
Container PortMappings
type RequestOptions ¶
type RequestOptions struct { Method string Path string Datas interface{} Params *Parameters }
RequestOptions passed for query api
type Response ¶
type Response struct { Code int Apps []*Application `json:"apps,omitempty"` App *Application `json:"app,omitempty"` Versions []string `json:",omitempty"` Tasks []*Task `json:"tasks,omitempty"` }
Response representation of a full marathon response
type Task ¶
type Task struct { AppID string `json:"appId"` Host string `json:"host"` ID string `json:"id"` Ports []int `json:"ports"` StagedAt string `json:"stagedAt"` StartedAt string `json:"startedAt"` Version string `json:"version"` }
Task is described here: https://github.com/mesosphere/marathon/blob/master/REST.md#tasks
type UpgradeStrategy ¶
type UpgradeStrategy struct {
MinimumHealthCapacity float32 `json:"minimumHealthCapacity,omitempty"`
}
UpgradeStrategy has a minimumHealthCapacity which defines the minimum number of healty nodes