apimodels

package
v0.0.0-...-ee3d319 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemLogPrefix = "S"
	AgentLogPrefix  = "E"
	TaskLogPrefix   = "T"

	LogErrorPrefix = "E"
	LogWarnPrefix  = "W"
	LogDebugPrefix = "D"
	LogInfoPrefix  = "I"
)

for the different types of remote logging

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBuild

type APIBuild struct {
	Tasks []string `json:"tasks"`
}

APIBuild represents part of a build from the REST API for use in the smoke test.

type APITask

type APITask struct {
	Status string            `json:"status"`
	Logs   map[string]string `json:"logs"`
}

APITask represents part of a task from the REST API for use in the smoke test.

type EndTaskResponse

type EndTaskResponse struct {
	ShouldExit bool `json:"should_exit,omitempty"`
}

EndTaskResponse is what is returned when the task ends

type ExpansionVars

type ExpansionVars map[string]string

ExpansionVars is a map of expansion variables for a project.

type GetNextTaskDetails

type GetNextTaskDetails struct {
	TaskGroup string `json:"task_group"`
}

type HeartbeatResponse

type HeartbeatResponse struct {
	Abort bool `json:"abort,omitempty"`
}

HeartbeatResponse is sent by the API server in response to the agent's heartbeat message.

type LogMessage

type LogMessage struct {
	Type      string    `bson:"t" json:"t"`
	Severity  string    `bson:"s" json:"s"`
	Message   string    `bson:"m" json:"m"`
	Timestamp time.Time `bson:"ts" json:"ts"`
	Version   int       `bson:"v" json:"v"`
}

Also used in the task_logg collection in the database. The LogMessage type is used by the models package and is stored in the database (inside in the model.TaskLog structure.)

type NextTaskResponse

type NextTaskResponse struct {
	TaskId     string `json:"task_id,omitempty"`
	TaskSecret string `json:"task_secret,omitempty"`
	TaskGroup  string `json:"task_group,omitempty"`
	Version    string `json:"version,omitempty"`
	// ShouldExit indicates that something has gone wrong, so the agent
	// should exit immediately when it receives this message. ShouldExit can
	// interrupt a task group.
	ShouldExit bool `json:"should_exit,omitempty"`
	// NewAgent indicates a new agent available, so the agent should exit
	// gracefully. Practically speaking, this means that if the agent is
	// currently in a task group, it should only exit when it has finished
	// the task group.
	NewAgent bool `json:"new_agent,omitempty`
}

NextTaskResponse represents the response sent back when an agent asks for a next task

type ProcessTimeoutResponse

type ProcessTimeoutResponse struct {
	Status        string      `json:"status"`
	LateProcesses interface{} `json:"late_mci_processes,omitempty"`
}

Struct for reporting process timeouts

type S3CopyRequest

type S3CopyRequest struct {
	AwsKey              string `json:"aws_key"`
	AwsSecret           string `json:"aws_secret"`
	S3SourceBucket      string `json:"s3_source_bucket"`
	S3SourcePath        string `json:"s3_source_path"`
	S3DestinationBucket string `json:"s3_destination_bucket"`
	S3DestinationPath   string `json:"s3_destination_path"`
	S3DisplayName       string `json:"display_name"`
}

S3CopyRequest holds information necessary for the API server to complete an S3 copy request; namely, an S3 key/secret, a source and a destination path

type TaskEndDetail

type TaskEndDetail struct {
	Status      string `bson:"status,omitempty" json:"status,omitempty"`
	Type        string `bson:"type,omitempty" json:"type,omitempty"`
	Description string `bson:"desc,omitempty" json:"desc,omitempty"`
	TimedOut    bool   `bson:"timed_out,omitempty" json:"timed_out,omitempty"`
}

TaskEndDetail contains data sent from the agent to the API server after each task run.

type TaskEndDetails

type TaskEndDetails struct {
	TimeoutStage string `bson:"timeout_stage,omitempty" json:"timeout_stage,omitempty"`
	TimedOut     bool   `bson:"timed_out,omitempty" json:"timed_out,omitempty"`
}

type TaskLog

type TaskLog struct {
	TaskId       string       `json:"t_id"`
	Execution    int          `json:"e"`
	Timestamp    time.Time    `json:"ts"`
	MessageCount int          `json:"c"`
	Messages     []LogMessage `json:"m"`
}

TaskLog is a group of LogMessages, and mirrors the model.TaskLog type, sans the ObjectID field.

type TaskStartRequest

type TaskStartRequest struct {
	Pid string `json:"pid"`
}

TaskStartRequest holds information sent by the agent to the API server at the beginning of each task run.

Jump to

Keyboard shortcuts

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