updatessmagent

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: 21 Imported by: 0

Documentation

Overview

Package updatessmagent implements the UpdateSsmAgent plugin.

Package updatessmagent implements the UpdateSsmAgent plugin.

Index

Constants

View Source
const (

	// CommonManifestURL is the Manifest URL for regular regions
	CommonManifestURL = "https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent-manifest.json"

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

Variables

This section is empty.

Functions

func Name

func Name() string

Name returns the plugin name

Types

type FileContent

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

FileContent holds the file name and available versions

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,
	context *updateutil.InstanceContext,
	packageName 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) (result string, hash string, err error)

DownloadURLAndHash returns download source url and hash value

func (*Manifest) HasVersion

func (m *Manifest) HasVersion(context *updateutil.InstanceContext, packageName string, 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, packageName string) (result string, err error)

LatestVersion returns latest version for specific package

type PackageContent

type PackageContent struct {
	Name  string         `json:"Name"`
	Files []*FileContent `json:"Files"`
}

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)

Execute runs multiple sets of commands and returns their outputs. res.Output will contain a slice of RunCommandPluginOutput.

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