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) CreateGroup(group *Group) (*Response, error)
- func (c *Client) DeleteApp(appID string) (*Response, error)
- func (c *Client) DeleteCallbackURL(uri string) (*Response, error)
- func (c *Client) DeleteGroup(groupID 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) GetGroup(groupID string) (*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) ListGroups() (*Response, error)
- func (c *Client) ListGroupsByCmd(filter string) (*Response, error)
- func (c *Client) ListTasks() (*Response, error)
- func (c *Client) RegisterCallbackURL(uri string) (*Response, error)
- func (c *Client) UpdateApp(appID string, app *Application) (*Response, error)
- func (c *Client) UpdateGroup(groupID string, group *Group) (*Response, error)
- type Container
- type Docker
- type EventSubscription
- type Group
- type HealthCheck
- type Parameters
- type PortMapping
- type RequestOptions
- type Response
- type Task
- 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"` 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"` BackoffFactor float32 `json:"backoffFactor,omitempty"` TasksRunning int `json:"tasksRunning,omitempty"` TasksStaged int `json:"tasksStaged,omitempty"` Uris []string `json:"uris,omitempty"` Version string `json:"version,omitempty"` Dependencies []string `json:"dependencies,omitempty"` }
Application marathon application see : https://mesosphere.github.io/marathon/docs/rest-api.html#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) CreateGroup ¶
CreateGroup Create a new Application
func (*Client) DeleteCallbackURL ¶
DeleteCallbackURL delete a particular callback url
func (*Client) DeleteGroup ¶
DeleteGroup delete this group from the cluster. Returns with version but when completed will respond with an event because this operation can take a long time.
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) ListGroups ¶
ListGroups is listing all groups
func (*Client) ListGroupsByCmd ¶
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"` Docker *Docker `json:"docker"` Volumes []*Volume `json:"volumes,omitempty"` Options []string `json:"options,omitempty"` }
Container is docker parameters options are passed to container, if you want your options to be passed at the end of your docker run add // in front of the parameters you want to pass Example: docker run -ti -p 4343:4343 mysql --listen 0.0.0.0:4343 options := [ "-p", "4343", "//", "--listen", "0.0.0.0:4343" ]
type Docker ¶
type Docker struct { Image string `json:"image,omitempty"` Network string `json:"network"` PortMappings []*PortMapping `json:"portMappings,omitempty"` Privileged bool `json:"privileged"` Parameters map[string]string `json:"parameters,omitempty"` }
Docker
type EventSubscription ¶
type EventSubscription struct { CallbackURL string `json:"CallbackUrl"` ClientIP string `json:"ClientIp"` EventType string `json:"eventType"` CallbackURLs []string `json:"CallbackUrls"` }
EventSubscription are described here : https://mesosphere.github.io/marathon/docs/rest-api.html#event-subscriptions
type Group ¶
type Group struct { ID string `json:"id"` Groups []*Group `json:"groups,omitempty"` Apps []*Application `json:"apps,omitempty"` Dependencies []string `json:"dependencies,omitempty"` Version string `json:"version,omitempty"` }
Group marathon group see: https://mesosphere.github.io/marathon/docs/rest-api.html#groups
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://mesosphere.github.io/marathon/docs/health-checks.html
type Parameters ¶
Parameters to build url query
type PortMapping ¶
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"` Dependencies []string `json:"dependencies,omitempty"` Groups []*Group `json:"groups,omitempty"` ID string `json:"id,omitempty"` Version string `json:"version,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://mesosphere.github.io/marathon/docs/rest-api.html#tasks