Documentation ¶
Overview ¶
Package updatessmagent implements the UpdateSsmAgent plugin.
Package updatessmagent implements the UpdateSsmAgent plugin.
Index ¶
- Constants
- func Name() string
- type FileContent
- 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, packageName string, version string) bool
- func (m *Manifest) LatestVersion(log log.T, context *updateutil.InstanceContext, packageName string) (result string, err error)
- type PackageContent
- type PackageVersion
- type Plugin
- type UpdatePluginConfig
- type UpdatePluginInput
Constants ¶
const ( // CommonManifestURL is the Manifest URL for regular regions CommonManifestURL = "https://amazon-ssm-{Region}.s3.amazonaws.com/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 ¶
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 ¶
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.