cloudwatch

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

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

Package cloudwatch implements cloudwatch plugin and its configuration

Index

Constants

View Source
const (
	ConfigFileName       = "AWS.EC2.Windows.CloudWatch.json"
	ConfigFileFolderName = "awsCloudWatch"
)

ConfigFileName represents the name of the configuration file for cloud watch plugin

View Source
const (
	EC2SeriveceConfigFileName = "config.xml"
	PluginName                = "AWS.EC2.Windows.CloudWatch.PlugIn"
)

Variables

This section is empty.

Functions

func Disable

func Disable() error

Disable changes the IsEnabled property in cloud watch config from true to false

func Enable

func Enable(config *CloudWatchConfig) error

Enable changes the IsEnabled property in cloud watch config from false to true

func Initialze

func Initialze()

Initialze ensures the instance has been initialized

func ParseEngineConfiguration

func ParseEngineConfiguration() (config string, err error)

ParseEngineConfiguration marshals the EngineConfiguration from interface{} to string

func ParseXml

func ParseXml() (bool, error)

ParseXml parses the ec2config xml file and check if the aws:cloudWatch plugin is enabled or not.

func Update

func Update(log log.T) error

Update updates configuration from file system

func Write

func Write() error

Write writes the updated configuration of cloud watch to file system

Types

type CloudWatchConfig

type CloudWatchConfig struct {
	IsEnabled           bool        `json:"IsEnabled"`
	EngineConfiguration interface{} `json:"EngineConfiguration"`
}

cloudWatchConfig represents the data structure of cloudwatch configuration singleton, which contains the essential information to configure cloudwatch plugin

func Instance

func Instance() *CloudWatchConfig

Instance returns a singleton of CloudWatchConfig instance

type Mock

type Mock struct {
	mock.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

func (m *Mock) IsRunning(context context.T) bool

IsRunning returns if the said plugin is running or not - returns true for testing

func (*Mock) Start

func (m *Mock) Start(context context.T, configuration string, orchestrationDir string, cancelFlag task.CancelFlag) (err error)

Start starts the executable file and returns encountered errors - returns nil for testing

func (*Mock) Stop

func (m *Mock) Stop(context context.T, cancelFlag task.CancelFlag) (err error)

StopCloudWatchExe returns true if it successfully killed the cloudwatch exe or else it returns false - returns nil for testing

type PluginInfo

type PluginInfo struct {
	Name  string `xml:"Name"`
	State string `xml:"State"`
}

type PluginState

type PluginState struct {
	PluginList []PluginInfo `xml:"Plugin"`
}

type Query

type Query struct {
	Plugins PluginState `xml:"Plugins"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL