updateec2config

package
v0.0.0-...-84afe80 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package updateec2config implements the UpdateEC2Config plugin.

Package updateec2config implements the UpdateEC2Config plugin.

Package updateec2config implements the UpdateEC2Config plugin.

Package updateec2config implements the UpdateEC2Config plugin.

Index

Constants

View Source
const (

	// PipelineTestVersion represents fake version for pipeline tests
	PipelineTestVersion = "9999.0.0.0"

	//EC2 config agent constants
	EC2UpdaterPackageName = "aws-ec2windows-ec2configupdater"
	EC2ConfigAgentName    = "aws-ec2windows-ec2config"
	EC2UpdaterFileName    = "EC2ConfigUpdater.zip"
	EC2SetupFileName      = "EC2ConfigSetup.zip"
	Updater               = "EC2ConfigUpdater"

	//redefined here because manifest file has a spelling error which will need to be continued
	PackageVersionHolder = "{PacakgeVersion}"

	//update command arguments
	SetupInstallCmd   = " --setup-installation"
	SourceVersionCmd  = "-current-version"
	SourceLocationCmd = "-current-source"
	SourceHashCmd     = "-current-hash"
	TargetVersionCmd  = "-target-version"
	TargetLocationCmd = "-target-source"
	TargetHashCmd     = "-target-hash"
	MessageIDCmd      = "-message-id"
	HistoryCmd        = "-history"
	InstanceID        = "-instance-id"
	DocumentIDCmd     = "-document-id"
	RegionIDCmd       = "-instance-region"
	UserAgentCmd      = "-user-agent"
	MdsEndpointCmd    = "-mds-endpoint"
	UpdateHealthCmd   = " --health-update"
	UpdateCmd         = " --update"

	//HTTP format for ssmagent
	HTTPFormat = "https://aws-ssm-{Region}.s3.amazonaws.com"

	//S3 format for updater
	S3Format = "https://s3.amazonaws.com/aws-ssm-{Region}"

	// CommonManifestURL is the URL for the manifest file in regular regions
	CommonManifestURL = "https://s3.{Region}.amazonaws.com/aws-ssm-{Region}/manifest.json"

	// ChinaManifestURL is the URL for the manifest in regions in China
	ChinaManifestURL = "https://s3.{Region}.amazonaws.com.cn/aws-ssm-{Region}/manifest.json"
)

Variables

This section is empty.

Functions

func Name

func Name() string

Name returns the plugin name

func UpdaterFilePath

func UpdaterFilePath(updateRoot string, updaterPackageName string, version string) string

UpdaterFilePath returns updater file path

Types

type Manifest

type Manifest struct {
	SchemaVersion string            `json:"SchemaVersion"`
	URIFormat     string            `json:"UriFormat"`
	Packages      []*PackageContent `json:"Packages"`
}

Manifest represents the json structure of online manifest file.

func ParseManifest

func ParseManifest(log log.T,
	fileName string) (parsedManifest *Manifest, err error)

ParseManifest parses the public manifest file to provide agent update information.

func (*Manifest) DownloadURLAndHash

func (m *Manifest) DownloadURLAndHash(
	context *updateutil.InstanceContext,
	packageName string,
	version string, filename string, toformat string, fromformat string) (result string, hash string, err error)

DownloadURLAndHash returns download source url and hash value

func (*Manifest) HasVersion

func (m *Manifest) HasVersion(context *updateutil.InstanceContext, version string) bool

HasVersion returns if manifest file has particular version for package

func (*Manifest) LatestVersion

func (m *Manifest) LatestVersion(log log.T, context *updateutil.InstanceContext) (result string, err error)

LatestVersion returns latest version for specific package

type PackageContent

type PackageContent struct {
	Name              string            `json:"Name"`
	FileName          string            `json:"FileName"`
	AvailableVersions []*PackageVersion `json:"AvailableVersions"`
}

PackageContent section in the Manifest json.

type PackageVersion

type PackageVersion struct {
	Version  string `json:"Version"`
	Checksum string `json:"Checksum"`
}

PackageVersion section in the PackageContent

type Plugin

type Plugin struct {
	pluginutil.DefaultPlugin

	// Manifest location
	ManifestLocation string
}

Plugin is the type for the RunCommand plugin.

func NewPlugin

func NewPlugin(updatePluginConfig UpdatePluginConfig) (*Plugin, error)

NewPlugin returns a new instance of the plugin.

func (*Plugin) Execute

func (p *Plugin) Execute(context context.T, config contracts.Configuration, cancelFlag task.CancelFlag, subDocumentRunner runpluginutil.PluginRunner) (res contracts.PluginResult)

TODO Make common methods go into utility/helper/common package. Check if Execute can be added to that package Execute runs multiple sets of commands and returns their outputs. res.Output will contain a slice of RunCommandPluginOutput.

type UpdateContextFile

type UpdateContextFile struct {
	UpdateState  string `json:"updateState"`
	UpdateResult string `json:"updateResult"`
	UpdateStdOut string `json:"UpdateStandardOut"`
}

UpdateContextFile represents the json structure of the UpdateContext.json file

type UpdatePluginConfig

type UpdatePluginConfig struct {
	ManifestLocation      string
	StdoutFileName        string
	StderrFileName        string
	MaxStdoutLength       int
	MaxStderrLength       int
	OutputTruncatedSuffix string
}

UpdatePluginConfig is used for initializing update agent plugin with default values

func GetUpdatePluginConfig

func GetUpdatePluginConfig(context context.T) UpdatePluginConfig

GetUpdatePluginConfig returns the default values for the update plugin

type UpdatePluginInput

type UpdatePluginInput struct {
	contracts.PluginInput
	AgentName      string `json:"agentName"`
	AllowDowngrade string `json:"allowDowngrade"`
	TargetVersion  string `json:"targetVersion"`
	Source         string `json:"source"`
	UpdaterName    string `json:"-"`
}

UpdatePluginInput represents one set of commands executed by the UpdateAgent plugin.

Jump to

Keyboard shortcuts

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