Documentation ¶
Index ¶
- func Accept(ops ...AcceptOpt) *scheduler.Call
- func AcceptInverseOffers(offerIDs ...mesos.OfferID) *scheduler.Call
- func Acknowledge(agentID, taskID string, uuid []byte) *scheduler.Call
- func AcknowledgeOperationStatus(agentID, resourceProviderID string, uuid []byte, operationID string) *scheduler.Call
- func CallNoData(ctx context.Context, caller Caller, call *scheduler.Call) error
- func Decline(offerIDs ...mesos.OfferID) *scheduler.Call
- func DeclineInverseOffers(offerIDs ...mesos.OfferID) *scheduler.Call
- func Filters(fo ...mesos.FilterOpt) scheduler.CallOpt
- func Framework(id string) scheduler.CallOpt
- func Kill(taskID, agentID string) *scheduler.Call
- func Message(agentID, executorID string, data []byte) *scheduler.Call
- func OpCreate(rs ...mesos.Resource) mesos.Offer_Operation
- func OpCreateDisk(src mesos.Resource, t mesos.Resource_DiskInfo_Source_Type) mesos.Offer_Operation
- func OpDestroy(rs ...mesos.Resource) mesos.Offer_Operation
- func OpDestroyDisk(src mesos.Resource) mesos.Offer_Operation
- func OpGrowVolume(v mesos.Resource, a mesos.Resource) mesos.Offer_Operation
- func OpLaunch(ti ...mesos.TaskInfo) mesos.Offer_Operation
- func OpLaunchGroup(ei mesos.ExecutorInfo, ti ...mesos.TaskInfo) mesos.Offer_Operation
- func OpReserve(rs ...mesos.Resource) mesos.Offer_Operation
- func OpShrinkVolume(v mesos.Resource, s mesos.Value_Scalar) mesos.Offer_Operation
- func OpUnreserve(rs ...mesos.Resource) mesos.Offer_Operation
- func Reconcile(opts ...scheduler.ReconcileOpt) *scheduler.Call
- func ReconcileOperations(req []ReconcileOperationRequest) *scheduler.Call
- func ReconcileTasks(tasks map[string]string) scheduler.ReconcileOpt
- func RefuseSeconds(d time.Duration) scheduler.CallOpt
- func RefuseSecondsWithJitter(r *rand.Rand, d time.Duration) scheduler.CallOpt
- func Request(requests ...mesos.Request) *scheduler.Call
- func Revive() *scheduler.Call
- func ReviveWith(roles []string) *scheduler.Call
- func Shutdown(executorID, agentID string) *scheduler.Call
- func Subscribe(info *mesos.FrameworkInfo) *scheduler.Call
- func SubscribeTo(frameworkID string) scheduler.CallOpt
- func Suppress() *scheduler.Call
- func SuppressWith(roles []string) *scheduler.Call
- func UpdateFramework(fi mesos.FrameworkInfo, options ...func(*scheduler.Call_UpdateFramework)) *scheduler.Call
- type AcceptOpt
- type AckError
- type Caller
- type CallerFunc
- type OfferOperations
- type ReconcileOperationRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Accept ¶
Accept returns an accept call with the given parameters. Callers are expected to fill in the FrameworkID and Filters.
func AcceptInverseOffers ¶
AcceptInverseOffers returns an accept-inverse-offers call for the given offer IDs. Callers are expected to fill in the FrameworkID and Filters.
func Acknowledge ¶
Acknowledge returns an acknowledge call with the given parameters. Callers are expected to fill in the FrameworkID.
func AcknowledgeOperationStatus ¶ added in v0.0.7
func AcknowledgeOperationStatus(agentID, resourceProviderID string, uuid []byte, operationID string) *scheduler.Call
AcknowledgeOperationStatus acks the receipt of an operation status update. Schedulers are responsible for explicitly acknowledging the receipt of updates which have the 'OperationStatusUpdate.status().uuid()' field set. Such status updates are retried by the agent or resource provider until they are acknowledged by the scheduler. agentID and resourceProviderID are optional, the remaining fields are required.
func CallNoData ¶
CallNoData is a convenience func that executes the given Call using the provided Caller and always drops the response data.
func Decline ¶
Decline returns a decline call with the given parameters. Callers are expected to fill in the FrameworkID and Filters.
func DeclineInverseOffers ¶
DeclineInverseOffers returns a decline-inverse-offers call for the given offer IDs. Callers are expected to fill in the FrameworkID and Filters.
func Filters ¶
Filters sets a scheduler.Call's internal Filters, required for Accept and Decline calls.
func Kill ¶
Kill returns a kill call with the given parameters. Callers are expected to fill in the FrameworkID.
func Message ¶
Message returns a message call with the given parameters. Callers are expected to fill in the FrameworkID.
func OpCreateDisk ¶ added in v0.0.9
func OpCreateDisk(src mesos.Resource, t mesos.Resource_DiskInfo_Source_Type) mesos.Offer_Operation
func OpDestroyDisk ¶ added in v0.0.9
func OpDestroyDisk(src mesos.Resource) mesos.Offer_Operation
func OpGrowVolume ¶ added in v0.0.8
func OpGrowVolume(v mesos.Resource, a mesos.Resource) mesos.Offer_Operation
func OpLaunch ¶
func OpLaunch(ti ...mesos.TaskInfo) mesos.Offer_Operation
OpLaunch returns a launch operation builder for the given tasks
func OpLaunchGroup ¶
func OpLaunchGroup(ei mesos.ExecutorInfo, ti ...mesos.TaskInfo) mesos.Offer_Operation
func OpShrinkVolume ¶ added in v0.0.8
func OpShrinkVolume(v mesos.Resource, s mesos.Value_Scalar) mesos.Offer_Operation
func OpUnreserve ¶
func OpUnreserve(rs ...mesos.Resource) mesos.Offer_Operation
func Reconcile ¶
func Reconcile(opts ...scheduler.ReconcileOpt) *scheduler.Call
Reconcile returns a reconcile call with the given parameters. See ReconcileTask. Callers are expected to fill in the FrameworkID.
func ReconcileOperations ¶ added in v0.0.7
func ReconcileOperations(req []ReconcileOperationRequest) *scheduler.Call
ReconcileOperations allows the scheduler to query the status of operations. This causes the master to send back the latest status for each operation in 'req', if possible. If 'req' is empty, then the master will send the latest status for each operation currently known.
func ReconcileTasks ¶
func ReconcileTasks(tasks map[string]string) scheduler.ReconcileOpt
ReconcileTasks constructs a []Call_Reconcile_Task from the given mappings:
map[string]string{taskID:agentID}
Map keys (taskID's) are required to be non-empty, but values (agentID's) *may* be empty.
func RefuseSeconds ¶ added in v0.0.4
RefuseSeconds returns a calls.Filters option that sets RefuseSeconds to the given duration
func RefuseSecondsWithJitter ¶
RefuseSecondsWithJitter returns a calls.Filters option that sets RefuseSeconds to a random number of seconds between 0 and the given duration.
func Request ¶
Request returns a resource request call with the given parameters. Callers are expected to fill in the FrameworkID.
func ReviveWith ¶ added in v0.0.5
Revive returns a revive call with the given filters. Callers are expected to fill in the FrameworkID.
func Shutdown ¶
Shutdown returns a shutdown call with the given parameters. Callers are expected to fill in the FrameworkID.
func Subscribe ¶
Subscribe returns a subscribe call with the given parameters. The call's FrameworkID is automatically filled in from the info specification.
func SubscribeTo ¶
SubscribeTo returns an option that configures a SUBSCRIBE call w/ a framework ID. If frameworkID is "" then the SUBSCRIBE call is cleared of all framework ID references. Panics if the call does not contain a non-nil Subscribe reference.
func SuppressWith ¶ added in v0.0.5
Suppress returns a suppress call with the given filters. Callers are expected to fill in the FrameworkID.
func UpdateFramework ¶ added in v0.0.11
func UpdateFramework(fi mesos.FrameworkInfo, options ...func(*scheduler.Call_UpdateFramework)) *scheduler.Call
UpdateFramework updates the FrameworkInfo. All fields can be updated except for:
* FrameworkInfo.checkpoint * FrameworkInfo.principal * FrameworkInfo.user
The call returns after the update is either applied completely or not applied at all. No incomplete updates occur.
The HTTP response codes specific to this call are:
- 200 OK: update operation was successfully completed.
- 400 Bad Request: the requested update is not valid.
- 403 Forbidden: framework is not authorized to use some entities requested by the update (e.g. not authorized to use some of the supplied roles).
- 409 Conflict: framework disappeared while this call was being processed (example: the framework was removed by a concurrent TEARDOWN call).
Types ¶
type AckError ¶ added in v0.0.4
AckError wraps a caller-generated error and tracks the call that failed. It may be reported for either a task status ACK error, or an offer operation status ACK error.
type Caller ¶
type Caller interface { // Call issues a call to Mesos and properly manages call-specific HTTP response headers & data. Call(context.Context, *scheduler.Call) (mesos.Response, error) }
Caller is the public interface this framework scheduler's should consume
type CallerFunc ¶
CallerFunc is the functional adaptation of the Caller interface
type OfferOperations ¶
type OfferOperations []mesos.Offer_Operation
func (OfferOperations) WithOffers ¶
func (ob OfferOperations) WithOffers(ids ...mesos.OfferID) AcceptOpt
WithOffers allows a client to pair some set of OfferOperations with multiple resource offers. Example: calls.Accept(calls.OfferOperations{calls.OpLaunch(tasks...)}.WithOffers(offers...))
type ReconcileOperationRequest ¶ added in v0.0.7
type ReconcileOperationRequest struct { OperationID string // OperationID is required AgentID string // AgentID is optional ResourceProviderID string // ResourceProviderID is optional }
ReconcileOperationRequest is a convenience type for which each instance maps to an instance of scheduler.Call_ReconcileOfferOperations_Operation.