github.com/justinjmoses/evergreen@v0.0.0-20170530173719-1d50e381ff0d/apimodels/agent_models.go (about)

     1  package apimodels
     2  
     3  // TaskStartRequest holds information sent by the agent to the
     4  // API server at the beginning of each task run.
     5  type TaskStartRequest struct {
     6  	Pid string `json:"pid"`
     7  }
     8  
     9  // HeartbeatResponse is sent by the API server in response to
    10  // the agent's heartbeat message.
    11  type HeartbeatResponse struct {
    12  	Abort bool `json:"abort,omitempty"`
    13  }
    14  
    15  // TaskEndDetail contains data sent from the agent to the
    16  // API server after each task run.
    17  type TaskEndDetail struct {
    18  	Status      string `bson:"status,omitempty" json:"status,omitempty"`
    19  	Type        string `bson:"type,omitempty" json:"type,omitempty"`
    20  	Description string `bson:"desc,omitempty" json:"desc,omitempty"`
    21  	TimedOut    bool   `bson:"timed_out,omitempty" json:"timed_out,omitempty"`
    22  }
    23  
    24  type TaskEndDetails struct {
    25  	TimeoutStage string `bson:"timeout_stage,omitempty" json:"timeout_stage,omitempty"`
    26  	TimedOut     bool   `bson:"timed_out,omitempty" json:"timed_out,omitempty"`
    27  }
    28  
    29  // TaskEndResponse contains data sent by the API server to the agent - in
    30  // response to a request with TaskEndDetail.
    31  // TODO: This should be taken out when we transition to the new api route
    32  type TaskEndResponse struct {
    33  	TaskId     string `json:"task_id,omitempty"`
    34  	TaskSecret string `json:"task_secret,omitempty"`
    35  	Message    string `json:"message,omitempty"`
    36  	RunNext    bool   `json:"run_next,omitempty"`
    37  }
    38  
    39  // ExpansionVars is a map of expansion variables for a project.
    40  type ExpansionVars map[string]string
    41  
    42  // NextTaskResponse represents the response sent back when an agent asks for a next task
    43  type NextTaskResponse struct {
    44  	TaskId     string `json:"task_id,omitempty"`
    45  	TaskSecret string `json:"task_secret,omitempty"`
    46  	ShouldExit bool   `json:"should_exit,omitempty"`
    47  	Message    string `json:"message,omitempty"`
    48  }
    49  
    50  // EndTaskResponse is what is returned when the task ends
    51  type EndTaskResponse struct {
    52  	ShouldExit bool   `json:"should_exit,omitempty"`
    53  	Message    string `json:"message,omitempty"`
    54  }