Documentation ¶
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
- func Name() string
- func UpdaterFilePath(updateRoot string, updaterPackageName string, version string) string
- type Manifest
- func (m *Manifest) DownloadURLAndHash(context *updateutil.InstanceContext, packageName string, version string, ...) (result string, hash string, err error)
- func (m *Manifest) HasVersion(context *updateutil.InstanceContext, version string) bool
- func (m *Manifest) LatestVersion(log log.T, context *updateutil.InstanceContext) (result string, err error)
- type PackageContent
- type PackageVersion
- type Plugin
- type UpdateContextFile
- type UpdatePluginConfig
- type UpdatePluginInput
Constants ¶
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://aws-ssm-{Region}.s3.amazonaws.com/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 ¶
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 ¶
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 ¶
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.