processor

package
v0.0.0-...-3f59448 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package processor contains the methods for update ssm agent. It also provides methods for sendReply and updateInstanceInfo

Package processor contains the methods for update ssm agent. It also provides methods for sendReply and updateInstanceInfo

Package processor contains the methods for update ssm agent. It also provides methods for sendReply and updateInstanceInfo

Package processor contains the methods for update ssm agent. It also provides methods for sendReply and updateInstanceInfo

Package processor contains the methods for update ssm agent. It also provides methods for sendReply and updateInstanceInfo

Package processor contains the methods for update ssm agent. It also provides methods for sendReply and updateInstanceInfo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextMgr

type ContextMgr interface {
	// contains filtered or unexported methods
}

ContextMgr reprents context management logics

type Service

type Service interface {
	SendReply(log log.T, update *UpdateDetail) error
	DeleteMessage(log log.T, update *UpdateDetail) error
	UpdateHealthCheck(log log.T, update *UpdateDetail, errorCode string) error
}

Service is an interface represents for SendReply, UpdateInstanceInfo

type T

type T interface {
	// StartOrResumeUpdate starts/resumes update.
	StartOrResumeUpdate(log log.T, context *UpdateContext) (err error)

	// InitializeUpdate initializes update, creates update context
	InitializeUpdate(log log.T, detail *UpdateDetail) (context *UpdateContext, err error)

	// Failed sets update to failed with error messages
	Failed(context *UpdateContext, log log.T, code updateutil.ErrorCode, errMessage string, noRollbackMessage bool) (err error)
}

T represents the interface for agent update

type UpdateContext

type UpdateContext struct {
	Current   *UpdateDetail   `json:"Current"`
	Histories []*UpdateDetail `json:"Histories"`
}

UpdateContext holds the book keeping details for Update context It contains current update detail and all the update histories

func LoadUpdateContext

func LoadUpdateContext(log log.T, source string) (context *UpdateContext, err error)

LoadUpdateContext loads update context info from local storage, set current update with new update detail

func (*UpdateContext) IsUpdateInProgress

func (context *UpdateContext) IsUpdateInProgress(log log.T) bool

IsUpdateInProgress represents if the another update is running

type UpdateDetail

type UpdateDetail struct {
	State              UpdateState            `json:"State"`
	Result             contracts.ResultStatus `json:"Result"`
	StandardOut        string                 `json:"StandardOut"`
	StandardError      string                 `json:"StandardError"`
	OutputS3KeyPrefix  string                 `json:"OutputS3KeyPrefix"`
	OutputS3BucketName string                 `json:"OutputS3BucketName"`
	StdoutFileName     string                 `json:"StdoutFileName"`
	StderrFileName     string                 `json:"StderrFileName"`
	SourceVersion      string                 `json:"SourceVersion"`
	SourceLocation     string                 `json:"SourceLocation"`
	SourceHash         string                 `json:"SourceHash"`
	TargetVersion      string                 `json:"TargetVersion"`
	TargetLocation     string                 `json:"TargetLocation"`
	TargetHash         string                 `json:"TargetLocation"`
	PackageName        string                 `json:"PackageName"`
	StartDateTime      time.Time              `json:"StartDateTime"`
	EndDateTime        time.Time              `json:"EndDateTime"`
	MessageID          string                 `json:"MessageId"`
	UpdateRoot         string                 `json:"UpdateRoot"`
	RequiresUninstall  bool                   `json:"RequiresUninstall"`
}

UpdateDetail Book keeping detail for Agent Update

func (*UpdateDetail) AppendError

func (update *UpdateDetail) AppendError(log log.T, format string, params ...interface{})

AppendError appends messages to UpdateContext StandardError and StandardOut

func (*UpdateDetail) AppendInfo

func (update *UpdateDetail) AppendInfo(log log.T, format string, params ...interface{})

AppendInfo appends messages to UpdateContext StandardOut

func (*UpdateDetail) HasMessageID

func (update *UpdateDetail) HasMessageID() bool

HasMessageID represents if update is triggered by run command

type UpdateState

type UpdateState string

UpdateState represents the state of update process

const (
	// NotStarted represents the state value not started for agent update
	NotStarted UpdateState = "NotStarted"

	// Initialized represents the state value initialized for agent update
	Initialized UpdateState = "Initialized"

	// Staged represents the state value staged for agent update
	Staged UpdateState = "Staged"

	// Installed represents the state value installed for agent update
	Installed UpdateState = "Installed"

	// Rollback represents the state value rollback for agent update
	Rollback UpdateState = "Rollback"

	// RolledBack represents the state value rolledBack for agent update
	RolledBack UpdateState = "RolledBack"

	// Completed represents the state value completed for agent update
	Completed UpdateState = "Completed"
)

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

Updater contains logic for performing agent update

func NewUpdater

func NewUpdater() *Updater

NewUpdater creates an instance of Updater and other services it requires

func (*Updater) Failed

func (u *Updater) Failed(context *UpdateContext, log log.T, code updateutil.ErrorCode, errMessage string, noRollbackMessage bool) (err error)

Failed sets update to failed with error messages

func (*Updater) InitializeUpdate

func (u *Updater) InitializeUpdate(log log.T, detail *UpdateDetail) (context *UpdateContext, err error)

InitializeUpdate initializes update, creates update context

func (*Updater) StartOrResumeUpdate

func (u *Updater) StartOrResumeUpdate(log log.T, context *UpdateContext) (err error)

StartOrResumeUpdate starts/resume update.

Jump to

Keyboard shortcuts

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