Documentation ¶
Overview ¶
Example ¶
var ( check = func(err error) { if err != nil { panic(err) } } swallow = func(_ mesos.Response, err error) { check(err) } ctx = context.Background() sender = SenderFunc(func(_ context.Context, _ Request) (_ mesos.Response, _ error) { return }) blackhole = func(c *master.Call) { swallow(sender.Send(ctx, NonStreaming(c))) } d = time.Duration(0) ) blackhole(GetHealth()) blackhole(GetFlags()) blackhole(GetVersion()) blackhole(GetMetrics(nil)) blackhole(GetMetrics(&d)) blackhole(GetLoggingLevel()) blackhole(ListFiles("")) blackhole(ReadFile("", 0)) blackhole(ReadFileWithLength("", 0, 0)) blackhole(GetState()) blackhole(GetAgents()) blackhole(GetFrameworks()) blackhole(GetExecutors()) blackhole(GetTasks()) blackhole(GetRoles()) blackhole(GetWeights()) blackhole(GetMaster()) blackhole(GetMaintenanceStatus()) blackhole(GetMaintenanceSchedule()) blackhole(GetQuota()) blackhole(Subscribe()) blackhole = func(c *master.Call) { check(SendNoData(ctx, sender, NonStreaming(c))) } blackhole(SetLoggingLevel(0, 0)) blackhole(UpdateWeights()) blackhole(ReserveResources(mesos.AgentID{})) blackhole(UnreserveResources(mesos.AgentID{})) blackhole(CreateVolumes(mesos.AgentID{})) blackhole(DestroyVolumes(mesos.AgentID{})) blackhole(UpdateMaintenanceSchedule(maintenance.Schedule{})) blackhole(StartMaintenance()) blackhole(StopMaintenance()) blackhole(SetQuota(quota.QuotaRequest{})) blackhole(RemoveQuota("")) blackhole(MarkAgentGone(mesos.AgentID{})) blackhole(Teardown(mesos.FrameworkID{}))
Output:
Index ¶
- func CreateVolumes(a mesos.AgentID, v ...mesos.Resource) *master.Call
- func DestroyVolumes(a mesos.AgentID, v ...mesos.Resource) *master.Call
- func GetAgents() *master.Call
- func GetExecutors() *master.Call
- func GetFlags() *master.Call
- func GetFrameworks() *master.Call
- func GetHealth() *master.Call
- func GetLoggingLevel() *master.Call
- func GetMaintenanceSchedule() *master.Call
- func GetMaintenanceStatus() *master.Call
- func GetMaster() *master.Call
- func GetMetrics(d *time.Duration) (call *master.Call)
- func GetQuota() *master.Call
- func GetRoles() *master.Call
- func GetState() *master.Call
- func GetTasks() *master.Call
- func GetVersion() *master.Call
- func GetWeights() *master.Call
- func ListFiles(path string) *master.Call
- func MarkAgentGone(id mesos.AgentID) *master.Call
- func ReadFile(path string, offset uint64) *master.Call
- func ReadFileWithLength(path string, offset, length uint64) *master.Call
- func RemoveQuota(role string) *master.Call
- func ReserveResources(a mesos.AgentID, r ...mesos.Resource) *master.Call
- func SendNoData(ctx context.Context, sender Sender, r Request) (err error)
- func SetLoggingLevel(level uint32, d time.Duration) *master.Call
- func SetQuota(qr quota.QuotaRequest) *master.Call
- func StartMaintenance(m ...mesos.MachineID) *master.Call
- func StopMaintenance(m ...mesos.MachineID) *master.Call
- func Subscribe() *master.Call
- func Teardown(id mesos.FrameworkID) *master.Call
- func UnreserveResources(a mesos.AgentID, r ...mesos.Resource) *master.Call
- func UpdateMaintenanceSchedule(s maintenance.Schedule) *master.Call
- func UpdateWeights(weights ...mesos.WeightInfo) *master.Call
- type Request
- type RequestFunc
- type RequestStreaming
- type RequestStreamingFunc
- type Sender
- type SenderFunc
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateVolumes ¶
CreateVolumes creates persistent volumes on reserved resources. The request is forwarded asynchronously to the Mesos agent where the reserved resources are located. That asynchronous message may not be delivered or creating the volumes at the agent might fail.
func DestroyVolumes ¶
DestroyVolumes destroys persistent volumes. The request is forwarded asynchronously to the Mesos agent where the reserved resources are located.
func GetExecutors ¶
GetExecutors retrieves information about all the executors known to the master.
func GetFrameworks ¶
GetFrameworks retrieves information about all the frameworks known to the master.
func GetLoggingLevel ¶
GetLoggingLevel retrieves the master's logging level.
func GetMaintenanceSchedule ¶
GetMaintenanceSchedule retrieves the cluster's maintenance schedule.
func GetMaintenanceStatus ¶
GetMaintenanceStatus retrieves the cluster's maintenance status.
func GetMetrics ¶
GetMetrics gives the snapshot of current metrics to the end user. If timeout is set in the call, it will be used to determine the maximum amount of time the API will take to respond. If the timeout is exceeded, some metrics may not be included in the response.
func GetVersion ¶
GetVersion retrieves the master's version information.
func GetWeights ¶
GetWeights retrieves the information about role weights.
func MarkAgentGone ¶ added in v0.0.7
MarkAgentGone removes the quota for a particular role.
func ReadFile ¶
ReadFile reads data from a file on the master. This call takes the path of the file to be read and the offset to start reading.
func ReadFileWithLength ¶
ReadFileWithLength is similar to ReadFile but species the maximum number of bytes to read from the file.
func RemoveQuota ¶
RemoveQuota removes the quota for a particular role.
func ReserveResources ¶
ReserveResources reserves resources dynamically on a specific agent.
func SendNoData ¶
SendNoData is a convenience func that executes the given Call using the provided Sender and always drops the response data.
func SetLoggingLevel ¶
SetLoggingLevel sets the logging verbosity level for a specified duration for master. Mesos uses glog for logging. The library only uses verbose logging which means nothing will be output unless the verbosity level is set (by default it's 0, libprocess uses levels 1, 2, and 3).
func SetQuota ¶
func SetQuota(qr quota.QuotaRequest) *master.Call
SetQuota sets the quota for resources to be used by a particular role.
func StartMaintenance ¶
StartMaintenance starts the maintenance of the cluster, this would bring a set of machines down.
func StopMaintenance ¶
StopMaintenance stops the maintenance of the cluster, this would bring a set of machines back up.
func Subscribe ¶
Subscribe results in a streaming response. The client is expected to keep a persistent connection open to the endpoint even after getting a SUBSCRIBED HTTP Response event. This is indicated by "Connection: keep-alive" and "Transfer-Encoding: chunked" headers with no "Content-Length" header set. All subsequent events generated by Mesos are streamed on this connection. The master encodes each Event in RecordIO format, i.e., string representation of length of the event in bytes followed by JSON or binary Protobuf encoded event.
func UnreserveResources ¶
UnreserveResources unreserves resources dynamically on a specific agent.
func UpdateMaintenanceSchedule ¶
func UpdateMaintenanceSchedule(s maintenance.Schedule) *master.Call
UpdateMaintenanceSchedule updates the cluster's maintenance schedule.
func UpdateWeights ¶
UpdateWeights updates weights for specific roles.
Types ¶
type Request ¶
Request generates a Call that's sent to a Mesos agent. Subsequent invocations are expected to yield equivalent calls. Intended for use w/ non-streaming requests to an agent.
type RequestFunc ¶
RequestFunc is the functional adaptation of Request.
func NonStreaming ¶
func NonStreaming(c *master.Call) RequestFunc
NonStreaming returns a RequestFunc that always generates the same Call.
func (RequestFunc) Call ¶
func (f RequestFunc) Call() *master.Call
func (RequestFunc) Marshaler ¶
func (f RequestFunc) Marshaler() encoding.Marshaler
type RequestStreaming ¶
type RequestStreaming interface { Request IsStreaming() }
RequestStreaming generates a Call that's send to a Mesos agent. Subsequent invocations MAY generate different Call objects. No more Call objects are expected once a nil is returned to signal the end of of the request stream.
type RequestStreamingFunc ¶
RequestStreamingFunc is the functional adaptation of RequestStreaming.
func FromChan ¶
func FromChan(ch <-chan *master.Call) RequestStreamingFunc
FromChan returns a streaming request that fetches calls from the given channel until it closes. If a nil chan is specified then the returned func will always generate nil.
func Push ¶
func Push(r RequestStreaming, c ...*master.Call) RequestStreamingFunc
Push prepends one or more calls onto a request stream. If no calls are given then the original stream is returned.
func (RequestStreamingFunc) Call ¶
func (f RequestStreamingFunc) Call() *master.Call
func (RequestStreamingFunc) IsStreaming ¶
func (f RequestStreamingFunc) IsStreaming()
func (RequestStreamingFunc) Marshaler ¶
func (f RequestStreamingFunc) Marshaler() encoding.Marshaler
func (RequestStreamingFunc) Push ¶
func (f RequestStreamingFunc) Push(c ...*master.Call) RequestStreamingFunc
type SenderFunc ¶
SenderFunc is the functional adaptation of the Sender interface
func IgnoreResponse ¶
func IgnoreResponse(s Sender) SenderFunc
IgnoreResponse generates a sender that closes any non-nil response received by Mesos.