Documentation
¶
Overview ¶
Package cloudwatch implements cloudwatch plugin and its configuration
Package cloudwatch implements cloudwatch plugin and its configuration ¶
Package cloudwatch implements cloudwatch plugin and its configuration ¶
Package cloudwatch implements cloudwatch plugin and its configuration
Index ¶
- Constants
- type CloudWatchConfig
- type CloudWatchConfigImpl
- func (cwcInstance *CloudWatchConfigImpl) Disable() error
- func (cwcInstance *CloudWatchConfigImpl) Enable(engineConfiguration interface{}) error
- func (cwcInstance *CloudWatchConfigImpl) GetIsEnabled() bool
- func (cwcInstance *CloudWatchConfigImpl) ParseEngineConfiguration() (config string, err error)
- func (cwcInstance *CloudWatchConfigImpl) Update(log log.T) error
- func (cwcInstance *CloudWatchConfigImpl) Write() error
- type Ec2ConfigXmlParser
- type Ec2ConfigXmlParserImpl
- type EngineConfigurationParser
- type Mock
- func (m *Mock) GetPidOfCloudWatchExe(log log.T, orchestrationDir, workingDirectory string, ...) (int, error)
- func (m *Mock) IsCloudWatchExeRunning(log log.T, workingDirectory, orchestrationDir string, ...) (err error)
- func (m *Mock) IsRunning(context context.T) bool
- func (m *Mock) Start(context context.T, configuration string, orchestrationDir string, ...) (err error)
- func (m *Mock) Stop(context context.T, cancelFlag task.CancelFlag) (err error)
- type PluginInfo
- type PluginState
- type Query
Constants ¶
const ( ConfigFileName = "AWS.EC2.Windows.CloudWatch.json" ConfigFileFolderName = "awsCloudWatch" )
ConfigFileName represents the name of the configuration file for cloud watch plugin
const ( EC2ServiceConfigFileName = "config.xml" PluginName = "AWS.EC2.Windows.CloudWatch.PlugIn" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudWatchConfig ¶
type CloudWatchConfig interface { GetIsEnabled() bool Enable(engineConfiguration interface{}) error Disable() error ParseEngineConfiguration() (config string, err error) Update(log log.T) error Write() error }
func Instance ¶
func Instance() CloudWatchConfig
Instance returns a singleton of CloudWatchConfig instance
type CloudWatchConfigImpl ¶
type CloudWatchConfigImpl struct { IsEnabled bool `json:"IsEnabled"` EngineConfiguration interface{} `json:"EngineConfiguration"` }
CloudWatchConfigImpl represents the data structure of cloudwatch configuration singleton, which contains the essential information to configure cloudwatch plugin
func (*CloudWatchConfigImpl) Disable ¶
func (cwcInstance *CloudWatchConfigImpl) Disable() error
Disable changes the IsEnabled property in cloud watch config from true to false
func (*CloudWatchConfigImpl) Enable ¶
func (cwcInstance *CloudWatchConfigImpl) Enable(engineConfiguration interface{}) error
Enable changes the IsEnabled property in cloud watch config from false to true
func (*CloudWatchConfigImpl) GetIsEnabled ¶
func (cwcInstance *CloudWatchConfigImpl) GetIsEnabled() bool
GetIsEnabled returns true if configuration is enabled. Otherwise, it returns false.
func (*CloudWatchConfigImpl) ParseEngineConfiguration ¶
func (cwcInstance *CloudWatchConfigImpl) ParseEngineConfiguration() (config string, err error)
ParseEngineConfiguration marshals the EngineConfiguration from interface{} to string
func (*CloudWatchConfigImpl) Update ¶
func (cwcInstance *CloudWatchConfigImpl) Update(log log.T) error
Update updates configuration from file system
func (*CloudWatchConfigImpl) Write ¶
func (cwcInstance *CloudWatchConfigImpl) Write() error
Write writes the updated configuration of cloud watch to file system
type Ec2ConfigXmlParser ¶
Ec2ConfigXmlParser is an interface for Ec2Config's configuration xml parser
type Ec2ConfigXmlParserImpl ¶
type Ec2ConfigXmlParserImpl struct {
FileSysUtil longrunning.FileSysUtil
}
Ec2ConfigXmlParserImpl provides functionality to parse the cloudwatch config state from Ec2Config's configuration xml
func (*Ec2ConfigXmlParserImpl) IsCloudWatchEnabled ¶
func (e *Ec2ConfigXmlParserImpl) IsCloudWatchEnabled() (bool, error)
IsCloudWatchEnabled returns true if the CloudWatch is enabled in Ec2Config xml file.
type EngineConfigurationParser ¶
type EngineConfigurationParser struct {
EngineConfiguration interface{} `json:"EngineConfiguration"`
}
type Mock ¶
Mock stands for a mocked cloudwatch.
func NewMockDefault ¶
func NewMockDefault() *Mock
NewMockDefault returns an instance of Mock with default expectations set.
func (*Mock) GetPidOfCloudWatchExe ¶
func (m *Mock) GetPidOfCloudWatchExe(log log.T, orchestrationDir, workingDirectory string, cancelFlag task.CancelFlag) (int, error)
IsCloudWatchExeRunning runs a powershell script to determine if the given process is running - returns nil for testing
func (*Mock) IsCloudWatchExeRunning ¶
func (m *Mock) IsCloudWatchExeRunning(log log.T, workingDirectory, orchestrationDir string, cancelFlag task.CancelFlag) (err error)
IsCloudWatchExeRunning runs a powershell script to determine if the given process is running - returns nil for testing
func (*Mock) IsRunning ¶
IsRunning returns if the said plugin is running or not - returns true for testing
type PluginInfo ¶
type PluginState ¶
type PluginState struct {
PluginList []PluginInfo `xml:"Plugin"`
}
type Query ¶
type Query struct {
Plugins PluginState `xml:"Plugins"`
}