Documentation
¶
Index ¶
- Constants
- type APIBuild
- type APITask
- type CreateHost
- type EbsDevice
- type EndTaskResponse
- type ExpansionVars
- type GetNextTaskDetails
- type HeartbeatResponse
- type LogMessage
- type NextTaskResponse
- type ProcessTimeoutResponse
- type S3CopyRequest
- type TaskEndDetail
- type TaskEndDetails
- type TaskLog
- type TaskStartRequest
Constants ¶
const ( ProviderEC2 = "ec2" ScopeTask = "task" ScopeBuild = "build" DefaultSetupTimeoutSecs = 600 DefaultTeardownTimeoutSecs = 21600 )
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 CreateHost ¶
type CreateHost struct {
// EC2-related settings
AMI string `mapstructure:"ami" json:"ami" plugin:"expand"`
Distro string `mapstructure:"distro" json:"distro" plugin:"expand"`
EBSDevices []EbsDevice `mapstructure:"ebs_block_device" json:"ebs_block_device" plugin:"expand"`
InstanceType string `mapstructure:"instance_type" json:"instance_type" plugin:"expand"`
Region string `mapstructure:"region" json:"region" plugin:"expand"`
SecurityGroups []string `mapstructure:"security_group_ids" json:"security_group_ids" plugin:"expand"`
Spot bool `mapstructure:"spot" json:"spot" plugin:"expand"`
Subnet string `mapstructure:"subnet_id" json:"subnet_id" plugin:"expand"`
UserdataFile string `mapstructure:"userdata_file" json:"-" plugin:"expand"`
UserdataCommand string `json:"userdata_command" plugin:"expand"`
VPC string `mapstructure:"vpc_id" json:"vpc_id" plugin:"expand"`
// authentication settings
AWSKeyID string `mapstructure:"aws_access_key_id" json:"aws_access_key_id" plugin:"expand"`
AWSSecret string `mapstructure:"aws_secret_access_key" json:"aws_secret_access_key" plugin:"expand"`
KeyName string `mapstructure:"key_name" json:"key_name" plugin:"expand"`
// agent-controlled settings
CloudProvider string `mapstructure:"provider" json:"provider" plugin:"expand"`
NumHosts int `mapstructure:"num_hosts" json:"num_hosts"`
Scope string `mapstructure:"scope" json:"scope" plugin:"expand"`
SetupTimeoutSecs int `mapstructure:"timeout_setup_secs" json:"timeout_setup_secs"`
TeardownTimeoutSecs int `mapstructure:"timeout_teardown_secs" json:"timeout_teardown_secs"`
Retries int `mapstructure:"retries" json:"retries"`
}
func (*CreateHost) Validate ¶
func (ch *CreateHost) Validate() error
type EndTaskResponse ¶
type EndTaskResponse struct {
ShouldExit bool `json:"should_exit,omitempty"`
}
EndTaskResponse is what is returned when the task ends
type ExpansionVars ¶
type ExpansionVars struct {
Vars map[string]string `json:"vars"`
PrivateVars map[string]bool `json:"private_vars"`
}
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"`
Build string `json:"build,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 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.