mesos

package
v0.0.0-...-d6eb901 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	MasterURL string
}

Client implements a client for mesos api

func (*Client) GetMesosAgents

func (c *Client) GetMesosAgents() (*SlavesResponse, error)

GetMesosAgents returns the Mesos Agents registered in the Mesos cluster

func (*Client) GetMesosFrameworks

func (c *Client) GetMesosFrameworks() (*FrameworksResponse, error)

GetMesosFrameworks returns the registered frameworks in Mesos

func (*Client) GetMesosTasks

func (c *Client) GetMesosTasks() (*TasksResponse, error)

GetMesosTasks return the running tasks on the Mesos cluster

func (*Client) SetHostsInMaintenance

func (c *Client) SetHostsInMaintenance(hosts map[string]string) error

SetHostsInMaintenance configures nodes in maintenance for Mesos cluster

type ClientInterface

type ClientInterface interface {
	GetMesosTasks() (*TasksResponse, error)
	GetMesosFrameworks() (*FrameworksResponse, error)
	GetMesosAgents() (*SlavesResponse, error)
	SetHostsInMaintenance(map[string]string) error
}

ClientInterface is an interface for mesos api clients

type ClientMock

type ClientMock struct {
	Records  map[string]*[]string
	Requests map[string]*[]string
}

ClientMock implements mesos.ClientInterface for testing purposes

func (*ClientMock) GenMaintenanceCallPayload

func (c *ClientMock) GenMaintenanceCallPayload(hosts map[string]string) []byte

GenMaintenanceCallPayload mocked for testing purposes

func (*ClientMock) GetMesosAgents

func (c *ClientMock) GetMesosAgents() (*SlavesResponse, error)

GetMesosAgents mocked for testing purposes

func (*ClientMock) GetMesosFrameworks

func (c *ClientMock) GetMesosFrameworks() (*FrameworksResponse, error)

GetMesosFrameworks mocked for testing purposes

func (*ClientMock) GetMesosTasks

func (c *ClientMock) GetMesosTasks() (*TasksResponse, error)

GetMesosTasks mocked for testing purposes

func (*ClientMock) SetHostsInMaintenance

func (c *ClientMock) SetHostsInMaintenance(hosts map[string]string) error

SetHostsInMaintenance mocked for testing purposes

type Framework

type Framework struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Active bool   `json:"active"`
}

Framework is part of the mesos frameworks response API endpoint

type FrameworksResponse

type FrameworksResponse struct {
	Frameworks []Framework `json:"frameworks"`
}

FrameworksResponse is part of the mesos frameworks response API endpoint

type MaintenanceMachinesID

type MaintenanceMachinesID struct {
	Hostname string `json:"hostname"`
	IP       string `json:"ip"`
}

MaintenanceMachinesID implements the payload for set mesos instances in maintenance API call

type MaintenanceRequest

type MaintenanceRequest struct {
	Windows []MaintenanceWindow `json:"windows"`
}

MaintenanceRequest implements the payload for set mesos instances in maintenance API call

type MaintenanceStart

type MaintenanceStart struct {
	Nanoseconds int32 `json:"nanoseconds"`
}

MaintenanceStart implements the payload for set mesos instances in maintenance API call

type MaintenanceUnavailability

type MaintenanceUnavailability struct {
	Start MaintenanceStart `json:"start"`
}

MaintenanceUnavailability implements the payload for set mesos instances in maintenance API call

type MaintenanceWindow

type MaintenanceWindow struct {
	MachinesIds    []MaintenanceMachinesID   `json:"machine_ids"`
	Unavailability MaintenanceUnavailability `json:"unavailability"`
}

MaintenanceWindow implements the payload for set mesos instances in maintenance API call

type Slave

type Slave struct {
	ID       string `json:"id"`
	Pid      string `json:"pid"`
	Hostname string `json:"hostname"`
}

Slave is part of the mesos slaves response API endpoint

type SlavesResponse

type SlavesResponse struct {
	Slaves []Slave `json:"slaves"`
}

SlavesResponse is part of the mesos slaves response API endpoint

type Status

type Status struct {
	State     string  `json:"state"`
	Timestamp float64 `json:"timestamp"`
}

Status is part of the mesos tasks response API endpoint

type Task

type Task struct {
	Name        string   `json:"name"`
	State       string   `json:"state"`
	SlaveID     string   `json:"slave_id"`
	FrameworkID string   `json:"framework_id"`
	Statuses    []Status `json:"statuses"`
}

Task is part of the mesos tasks response API endpoint

type TasksResponse

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

TasksResponse is part of the mesos tasks response API endpoint

Jump to

Keyboard shortcuts

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