Documentation ¶
Overview ¶
Package contracts contains all necessary interface and models necessary for communication and sharing within the agent.
Package contracts contains objects for parsing and encoding MDS/SSM messages.
Index ¶
- Constants
- func TruncateOutput(stdout string, stderr string, capacity int) (response string)
- type AdditionalInfo
- type AgentConfiguration
- type AgentInfo
- type Configuration
- type DocumentContent
- type ICorePlugin
- type IPlugin
- type IWorkerPlugin
- type Parameter
- type Plugin
- type PluginConfig
- type PluginInput
- type PluginOutput
- type PluginResult
- type PluginRuntimeStatus
- type ResultStatus
- type StopType
Constants ¶
const (
//MaximumPluginOutputSize represents the maximum output size that agent supports
MaximumPluginOutputSize = 2400
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdditionalInfo ¶
type AdditionalInfo struct { Agent AgentInfo `json:"agent"` DateTime string `json:"dateTime"` RunID string `json:"runId"` RuntimeStatusCounts map[string]int `json:"runtimeStatusCounts"` }
AdditionalInfo section in agent response
type AgentConfiguration ¶
AgentConfiguration is a struct that stores information about the agent and instance.
type AgentInfo ¶
type AgentInfo struct { Lang string `json:"lang"` Name string `json:"name"` Os string `json:"os"` OsVersion string `json:"osver"` Version string `json:"ver"` }
AgentInfo represents the agent response
type Configuration ¶
type Configuration struct { Properties interface{} OutputS3KeyPrefix string OutputS3BucketName string OrchestrationDirectory string MessageId string BookKeepingFileName string }
Configuration represents a plugin configuration as in the json format.
type DocumentContent ¶
type DocumentContent struct { SchemaVersion string `json:"schemaVersion"` Description string `json:"description"` RuntimeConfig map[string]*PluginConfig `json:"runtimeConfig"` Parameters map[string]*Parameter `json:"parameters"` }
DocumentContent object which represents ssm document content.
type ICorePlugin ¶
type ICorePlugin interface { Name() string Execute(context context.T) (err error) RequestStop(stopType StopType) (err error) }
ICorePlugin is the very much of core itself will be implemented as plugins that are simply hardcoded to run with agent framework. The hardcoded plugins will implement the ICorePlugin
type IPlugin ¶
type IPlugin interface { Name() string Execute(context context.T, input PluginConfig) (output PluginResult, err error) RequestStop(stopType StopType) (err error) }
IPlugin is interface for authoring a functionality of work. Every functionality of work is implemented as a plugin.
type IWorkerPlugin ¶
type IWorkerPlugin IPlugin
IWorkerPlugin is the plugins which do not form part of core These plugins are invoked on demand.
type Parameter ¶
type Parameter struct { DefaultVal interface{} `json:"default"` Description string `json:"description"` ParamType string `json:"type"` }
A Parameter in the DocumentContent of an MDS message.
type Plugin ¶
type Plugin struct { Configuration PluginResult }
Plugin wraps the plugin configuration and plugin result.
type PluginConfig ¶
type PluginConfig struct { Properties interface{} `json:"properties"` Description string `json:"description"` }
PluginConfig stores plugin configuration
type PluginOutput ¶
type PluginOutput struct { ExitCode int Status ResultStatus Stdout string Stderr string Errors []string }
PluginOutput represents the output of the plugin.
func (*PluginOutput) String ¶
func (p *PluginOutput) String() (response string)
type PluginResult ¶
type PluginResult struct { Status ResultStatus `json:"status"` Code int `json:"code"` Output interface{} `json:"output"` StartDateTime time.Time `json:"startDateTime"` EndDateTime time.Time `json:"endDateTime"` OutputS3BucketName string `json:"outputS3BucketName"` OutputS3KeyPrefix string `json:"outputS3KeyPrefix"` Error error `json:"-"` }
PluginResult represents a plugin execution result.
type PluginRuntimeStatus ¶
type PluginRuntimeStatus struct { Status ResultStatus `json:"status"` Code int `json:"code"` Output string `json:"output"` StartDateTime string `json:"startDateTime"` EndDateTime string `json:"endDateTime"` OutputS3BucketName string `json:"outputS3BucketName"` OutputS3KeyPrefix string `json:"outputS3KeyPrefix"` }
PluginRuntimeStatus represents plugin runtime status section in agent response
type ResultStatus ¶
type ResultStatus string
ResultStatus provides the granular status of a plugin. These are internal states maintained by agent during the execution of a command/config
const ( ResultStatusUnknown ResultStatus = "Unknown" ResultStatusNotStarted ResultStatus = "NotStarted" ResultStatusInProgress ResultStatus = "InProgress" ResultStatusSuccess ResultStatus = "Success" ResultStatusSuccessAndReboot ResultStatus = "SuccessAndReboot" ResultStatusFailed ResultStatus = "Failed" ResultStatusCancelled ResultStatus = "Cancelled" ResultStatusTimedOut ResultStatus = "TimedOut" )