cloudwatch

package
v0.0.0-...-d0813e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cloudwatch provides a client for Amazon CloudWatch.

Index

Constants

View Source
const (
	ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold"
	ComparisonOperatorGreaterThanThreshold          = "GreaterThanThreshold"
	ComparisonOperatorLessThanOrEqualToThreshold    = "LessThanOrEqualToThreshold"
	ComparisonOperatorLessThanThreshold             = "LessThanThreshold"
)

Possible values for CloudWatch.

View Source
const (
	HistoryItemTypeAction              = "Action"
	HistoryItemTypeConfigurationUpdate = "ConfigurationUpdate"
	HistoryItemTypeStateUpdate         = "StateUpdate"
)

Possible values for CloudWatch.

View Source
const (
	StandardUnitBits            = "Bits"
	StandardUnitBitsSecond      = "Bits/Second"
	StandardUnitBytes           = "Bytes"
	StandardUnitBytesSecond     = "Bytes/Second"
	StandardUnitCount           = "Count"
	StandardUnitCountSecond     = "Count/Second"
	StandardUnitGigabits        = "Gigabits"
	StandardUnitGigabitsSecond  = "Gigabits/Second"
	StandardUnitGigabytes       = "Gigabytes"
	StandardUnitGigabytesSecond = "Gigabytes/Second"
	StandardUnitKilobits        = "Kilobits"
	StandardUnitKilobitsSecond  = "Kilobits/Second"
	StandardUnitKilobytes       = "Kilobytes"
	StandardUnitKilobytesSecond = "Kilobytes/Second"
	StandardUnitMegabits        = "Megabits"
	StandardUnitMegabitsSecond  = "Megabits/Second"
	StandardUnitMegabytes       = "Megabytes"
	StandardUnitMegabytesSecond = "Megabytes/Second"
	StandardUnitMicroseconds    = "Microseconds"
	StandardUnitMilliseconds    = "Milliseconds"
	StandardUnitNone            = "None"
	StandardUnitPercent         = "Percent"
	StandardUnitSeconds         = "Seconds"
	StandardUnitTerabits        = "Terabits"
	StandardUnitTerabitsSecond  = "Terabits/Second"
	StandardUnitTerabytes       = "Terabytes"
	StandardUnitTerabytesSecond = "Terabytes/Second"
)

Possible values for CloudWatch.

View Source
const (
	StateValueAlarm            = "ALARM"
	StateValueInsufficientData = "INSUFFICIENT_DATA"
	StateValueOK               = "OK"
)

Possible values for CloudWatch.

View Source
const (
	StatisticAverage     = "Average"
	StatisticMaximum     = "Maximum"
	StatisticMinimum     = "Minimum"
	StatisticSampleCount = "SampleCount"
	StatisticSum         = "Sum"
)

Possible values for CloudWatch.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmHistoryItem

type AlarmHistoryItem struct {
	AlarmName       aws.StringValue `query:"AlarmName" xml:"AlarmName"`
	HistoryData     aws.StringValue `query:"HistoryData" xml:"HistoryData"`
	HistoryItemType aws.StringValue `query:"HistoryItemType" xml:"HistoryItemType"`
	HistorySummary  aws.StringValue `query:"HistorySummary" xml:"HistorySummary"`
	Timestamp       time.Time       `query:"Timestamp" xml:"Timestamp"`
}

AlarmHistoryItem is undocumented.

type CloudWatch

type CloudWatch struct {
	// contains filtered or unexported fields
}

CloudWatch is a client for Amazon CloudWatch.

func New

func New(creds aws.CredentialsProvider, region string, client *http.Client) *CloudWatch

New returns a new CloudWatch client.

func (*CloudWatch) DeleteAlarms

func (c *CloudWatch) DeleteAlarms(req *DeleteAlarmsInput) (err error)

DeleteAlarms deletes all specified alarms. In the event of an error, no alarms are deleted.

func (*CloudWatch) DescribeAlarmHistory

func (c *CloudWatch) DescribeAlarmHistory(req *DescribeAlarmHistoryInput) (resp *DescribeAlarmHistoryResult, err error)

DescribeAlarmHistory retrieves history for the specified alarm. Filter alarms by date range or item type. If an alarm name is not specified, Amazon CloudWatch returns histories for all of the owner's alarms.

func (*CloudWatch) DescribeAlarms

func (c *CloudWatch) DescribeAlarms(req *DescribeAlarmsInput) (resp *DescribeAlarmsResult, err error)

DescribeAlarms retrieves alarms with the specified names. If no name is specified, all alarms for the user are returned. Alarms can be retrieved by using only a prefix for the alarm name, the alarm state, or a prefix for any action.

func (*CloudWatch) DescribeAlarmsForMetric

func (c *CloudWatch) DescribeAlarmsForMetric(req *DescribeAlarmsForMetricInput) (resp *DescribeAlarmsForMetricResult, err error)

DescribeAlarmsForMetric retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further.

func (*CloudWatch) DisableAlarmActions

func (c *CloudWatch) DisableAlarmActions(req *DisableAlarmActionsInput) (err error)

DisableAlarmActions disables actions for the specified alarms. When an alarm's actions are disabled the alarm's state may change, but none of the alarm's actions will execute.

func (*CloudWatch) EnableAlarmActions

func (c *CloudWatch) EnableAlarmActions(req *EnableAlarmActionsInput) (err error)

EnableAlarmActions is undocumented.

func (*CloudWatch) GetMetricStatistics

func (c *CloudWatch) GetMetricStatistics(req *GetMetricStatisticsInput) (resp *GetMetricStatisticsResult, err error)

GetMetricStatistics gets statistics for the specified metric. The maximum number of data points returned from a single GetMetricStatistics request is 1,440, wereas the maximum number of data points that can be queried is 50,850. If you make a request that generates more than 1,440 data points, Amazon CloudWatch returns an error. In such a case, you can alter the request by narrowing the specified time range or increasing the specified period. Alternatively, you can make multiple requests across adjacent time ranges. Amazon CloudWatch aggregates data points based on the length of the period that you specify. For example, if you request statistics with a one-minute granularity, Amazon CloudWatch aggregates data points with time stamps that fall within the same one-minute period. In such a case, the data points queried can greatly outnumber the data points returned. The following examples show various statistics allowed by the data point query maximum of 50,850 when you call GetMetricStatistics on Amazon EC2 instances with detailed (one-minute) monitoring enabled: Statistics for up to 400 instances for a span of one hour Statistics for up to 35 instances over a span of 24 hours Statistics for up to 2 instances over a span of 2 weeks For information about the namespace, metric names, and dimensions that other Amazon Web Services products use to send metrics to Cloudwatch, go to Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference in the Amazon CloudWatch Developer Guide .

func (*CloudWatch) ListMetrics

func (c *CloudWatch) ListMetrics(req *ListMetricsInput) (resp *ListMetricsResult, err error)

ListMetrics returns a list of valid metrics stored for the AWS account owner. Returned metrics can be used with GetMetricStatistics to obtain statistical data for a given metric.

func (*CloudWatch) PutMetricAlarm

func (c *CloudWatch) PutMetricAlarm(req *PutMetricAlarmInput) (err error)

PutMetricAlarm creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate one or more Amazon Simple Notification Service resources with the alarm. When this operation creates an alarm, the alarm state is immediately set to . The alarm is evaluated and its StateValue is set appropriately. Any actions associated with the StateValue is then executed.

func (*CloudWatch) PutMetricData

func (c *CloudWatch) PutMetricData(req *PutMetricDataInput) (err error)

PutMetricData publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the data points with the specified metric. If the specified metric does not exist, Amazon CloudWatch creates the metric. It can take up to fifteen minutes for a new metric to appear in calls to the ListMetrics action. request is limited to 8 KB for GET requests and 40 KB for requests. Although the Value parameter accepts numbers of type Double , Amazon CloudWatch truncates values with very large exponents. Values with base-10 exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with base-10 exponents less than -130 (1 x 10^-130) are also truncated. Data that is timestamped 24 hours or more in the past may take in excess of 48 hours to become available from submission time using GetMetricStatistics

func (*CloudWatch) SetAlarmState

func (c *CloudWatch) SetAlarmState(req *SetAlarmStateInput) (err error)

SetAlarmState temporarily sets the state of an alarm. When the updated StateValue differs from the previous value, the action configured for the appropriate state is invoked. This is not a permanent change. The next periodic alarm check (in about a minute) will set the alarm to its actual state.

type CloudWatchAPI

type CloudWatchAPI interface {
	DeleteAlarms(req *DeleteAlarmsInput) (err error)
	DescribeAlarmHistory(req *DescribeAlarmHistoryInput) (resp *DescribeAlarmHistoryOutput, err error)
	DescribeAlarms(req *DescribeAlarmsInput) (resp *DescribeAlarmsOutput, err error)
	DescribeAlarmsForMetric(req *DescribeAlarmsForMetricInput) (resp *DescribeAlarmsForMetricOutput, err error)
	DisableAlarmActions(req *DisableAlarmActionsInput) (err error)
	EnableAlarmActions(req *EnableAlarmActionsInput) (err error)
	GetMetricStatistics(req *GetMetricStatisticsInput) (resp *GetMetricStatisticsOutput, err error)
	ListMetrics(req *ListMetricsInput) (resp *ListMetricsOutput, err error)
	PutMetricAlarm(req *PutMetricAlarmInput) (err error)
	PutMetricData(req *PutMetricDataInput) (err error)
	SetAlarmState(req *SetAlarmStateInput) (err error)
}

type Datapoint

type Datapoint struct {
	Average     aws.DoubleValue `query:"Average" xml:"Average"`
	Maximum     aws.DoubleValue `query:"Maximum" xml:"Maximum"`
	Minimum     aws.DoubleValue `query:"Minimum" xml:"Minimum"`
	SampleCount aws.DoubleValue `query:"SampleCount" xml:"SampleCount"`
	Sum         aws.DoubleValue `query:"Sum" xml:"Sum"`
	Timestamp   time.Time       `query:"Timestamp" xml:"Timestamp"`
	Unit        aws.StringValue `query:"Unit" xml:"Unit"`
}

Datapoint is undocumented.

type DeleteAlarmsInput

type DeleteAlarmsInput struct {
	AlarmNames []string `query:"AlarmNames.member" xml:"AlarmNames>member"`
}

DeleteAlarmsInput is undocumented.

type DescribeAlarmHistoryInput

type DescribeAlarmHistoryInput struct {
	AlarmName       aws.StringValue  `query:"AlarmName" xml:"AlarmName"`
	EndDate         time.Time        `query:"EndDate" xml:"EndDate"`
	HistoryItemType aws.StringValue  `query:"HistoryItemType" xml:"HistoryItemType"`
	MaxRecords      aws.IntegerValue `query:"MaxRecords" xml:"MaxRecords"`
	NextToken       aws.StringValue  `query:"NextToken" xml:"NextToken"`
	StartDate       time.Time        `query:"StartDate" xml:"StartDate"`
}

DescribeAlarmHistoryInput is undocumented.

type DescribeAlarmHistoryOutput

type DescribeAlarmHistoryOutput struct {
	AlarmHistoryItems []AlarmHistoryItem `query:"AlarmHistoryItems.member" xml:"DescribeAlarmHistoryResult>AlarmHistoryItems>member"`
	NextToken         aws.StringValue    `query:"NextToken" xml:"DescribeAlarmHistoryResult>NextToken"`
}

DescribeAlarmHistoryOutput is undocumented.

type DescribeAlarmHistoryResult

type DescribeAlarmHistoryResult struct {
	AlarmHistoryItems []AlarmHistoryItem `query:"AlarmHistoryItems.member" xml:"DescribeAlarmHistoryResult>AlarmHistoryItems>member"`
	NextToken         aws.StringValue    `query:"NextToken" xml:"DescribeAlarmHistoryResult>NextToken"`
}

DescribeAlarmHistoryResult is a wrapper for DescribeAlarmHistoryOutput.

type DescribeAlarmsForMetricInput

type DescribeAlarmsForMetricInput struct {
	Dimensions []Dimension      `query:"Dimensions.member" xml:"Dimensions>member"`
	MetricName aws.StringValue  `query:"MetricName" xml:"MetricName"`
	Namespace  aws.StringValue  `query:"Namespace" xml:"Namespace"`
	Period     aws.IntegerValue `query:"Period" xml:"Period"`
	Statistic  aws.StringValue  `query:"Statistic" xml:"Statistic"`
	Unit       aws.StringValue  `query:"Unit" xml:"Unit"`
}

DescribeAlarmsForMetricInput is undocumented.

type DescribeAlarmsForMetricOutput

type DescribeAlarmsForMetricOutput struct {
	MetricAlarms []MetricAlarm `query:"MetricAlarms.member" xml:"DescribeAlarmsForMetricResult>MetricAlarms>member"`
}

DescribeAlarmsForMetricOutput is undocumented.

type DescribeAlarmsForMetricResult

type DescribeAlarmsForMetricResult struct {
	MetricAlarms []MetricAlarm `query:"MetricAlarms.member" xml:"DescribeAlarmsForMetricResult>MetricAlarms>member"`
}

DescribeAlarmsForMetricResult is a wrapper for DescribeAlarmsForMetricOutput.

type DescribeAlarmsInput

type DescribeAlarmsInput struct {
	ActionPrefix    aws.StringValue  `query:"ActionPrefix" xml:"ActionPrefix"`
	AlarmNamePrefix aws.StringValue  `query:"AlarmNamePrefix" xml:"AlarmNamePrefix"`
	AlarmNames      []string         `query:"AlarmNames.member" xml:"AlarmNames>member"`
	MaxRecords      aws.IntegerValue `query:"MaxRecords" xml:"MaxRecords"`
	NextToken       aws.StringValue  `query:"NextToken" xml:"NextToken"`
	StateValue      aws.StringValue  `query:"StateValue" xml:"StateValue"`
}

DescribeAlarmsInput is undocumented.

type DescribeAlarmsOutput

type DescribeAlarmsOutput struct {
	MetricAlarms []MetricAlarm   `query:"MetricAlarms.member" xml:"DescribeAlarmsResult>MetricAlarms>member"`
	NextToken    aws.StringValue `query:"NextToken" xml:"DescribeAlarmsResult>NextToken"`
}

DescribeAlarmsOutput is undocumented.

type DescribeAlarmsResult

type DescribeAlarmsResult struct {
	MetricAlarms []MetricAlarm   `query:"MetricAlarms.member" xml:"DescribeAlarmsResult>MetricAlarms>member"`
	NextToken    aws.StringValue `query:"NextToken" xml:"DescribeAlarmsResult>NextToken"`
}

DescribeAlarmsResult is a wrapper for DescribeAlarmsOutput.

type Dimension

type Dimension struct {
	Name  aws.StringValue `query:"Name" xml:"Name"`
	Value aws.StringValue `query:"Value" xml:"Value"`
}

Dimension is undocumented.

type DimensionFilter

type DimensionFilter struct {
	Name  aws.StringValue `query:"Name" xml:"Name"`
	Value aws.StringValue `query:"Value" xml:"Value"`
}

DimensionFilter is undocumented.

type DisableAlarmActionsInput

type DisableAlarmActionsInput struct {
	AlarmNames []string `query:"AlarmNames.member" xml:"AlarmNames>member"`
}

DisableAlarmActionsInput is undocumented.

type EnableAlarmActionsInput

type EnableAlarmActionsInput struct {
	AlarmNames []string `query:"AlarmNames.member" xml:"AlarmNames>member"`
}

EnableAlarmActionsInput is undocumented.

type GetMetricStatisticsInput

type GetMetricStatisticsInput struct {
	Dimensions []Dimension      `query:"Dimensions.member" xml:"Dimensions>member"`
	EndTime    time.Time        `query:"EndTime" xml:"EndTime"`
	MetricName aws.StringValue  `query:"MetricName" xml:"MetricName"`
	Namespace  aws.StringValue  `query:"Namespace" xml:"Namespace"`
	Period     aws.IntegerValue `query:"Period" xml:"Period"`
	StartTime  time.Time        `query:"StartTime" xml:"StartTime"`
	Statistics []string         `query:"Statistics.member" xml:"Statistics>member"`
	Unit       aws.StringValue  `query:"Unit" xml:"Unit"`
}

GetMetricStatisticsInput is undocumented.

type GetMetricStatisticsOutput

type GetMetricStatisticsOutput struct {
	Datapoints []Datapoint     `query:"Datapoints.member" xml:"GetMetricStatisticsResult>Datapoints>member"`
	Label      aws.StringValue `query:"Label" xml:"GetMetricStatisticsResult>Label"`
}

GetMetricStatisticsOutput is undocumented.

type GetMetricStatisticsResult

type GetMetricStatisticsResult struct {
	Datapoints []Datapoint     `query:"Datapoints.member" xml:"GetMetricStatisticsResult>Datapoints>member"`
	Label      aws.StringValue `query:"Label" xml:"GetMetricStatisticsResult>Label"`
}

GetMetricStatisticsResult is a wrapper for GetMetricStatisticsOutput.

type ListMetricsInput

type ListMetricsInput struct {
	Dimensions []DimensionFilter `query:"Dimensions.member" xml:"Dimensions>member"`
	MetricName aws.StringValue   `query:"MetricName" xml:"MetricName"`
	Namespace  aws.StringValue   `query:"Namespace" xml:"Namespace"`
	NextToken  aws.StringValue   `query:"NextToken" xml:"NextToken"`
}

ListMetricsInput is undocumented.

type ListMetricsOutput

type ListMetricsOutput struct {
	Metrics   []Metric        `query:"Metrics.member" xml:"ListMetricsResult>Metrics>member"`
	NextToken aws.StringValue `query:"NextToken" xml:"ListMetricsResult>NextToken"`
}

ListMetricsOutput is undocumented.

type ListMetricsResult

type ListMetricsResult struct {
	Metrics   []Metric        `query:"Metrics.member" xml:"ListMetricsResult>Metrics>member"`
	NextToken aws.StringValue `query:"NextToken" xml:"ListMetricsResult>NextToken"`
}

ListMetricsResult is a wrapper for ListMetricsOutput.

type Metric

type Metric struct {
	Dimensions []Dimension     `query:"Dimensions.member" xml:"Dimensions>member"`
	MetricName aws.StringValue `query:"MetricName" xml:"MetricName"`
	Namespace  aws.StringValue `query:"Namespace" xml:"Namespace"`
}

Metric is undocumented.

type MetricAlarm

type MetricAlarm struct {
	ActionsEnabled                     aws.BooleanValue `query:"ActionsEnabled" xml:"ActionsEnabled"`
	AlarmActions                       []string         `query:"AlarmActions.member" xml:"AlarmActions>member"`
	AlarmARN                           aws.StringValue  `query:"AlarmArn" xml:"AlarmArn"`
	AlarmConfigurationUpdatedTimestamp time.Time        `query:"AlarmConfigurationUpdatedTimestamp" xml:"AlarmConfigurationUpdatedTimestamp"`
	AlarmDescription                   aws.StringValue  `query:"AlarmDescription" xml:"AlarmDescription"`
	AlarmName                          aws.StringValue  `query:"AlarmName" xml:"AlarmName"`
	ComparisonOperator                 aws.StringValue  `query:"ComparisonOperator" xml:"ComparisonOperator"`
	Dimensions                         []Dimension      `query:"Dimensions.member" xml:"Dimensions>member"`
	EvaluationPeriods                  aws.IntegerValue `query:"EvaluationPeriods" xml:"EvaluationPeriods"`
	InsufficientDataActions            []string         `query:"InsufficientDataActions.member" xml:"InsufficientDataActions>member"`
	MetricName                         aws.StringValue  `query:"MetricName" xml:"MetricName"`
	Namespace                          aws.StringValue  `query:"Namespace" xml:"Namespace"`
	OKActions                          []string         `query:"OKActions.member" xml:"OKActions>member"`
	Period                             aws.IntegerValue `query:"Period" xml:"Period"`
	StateReason                        aws.StringValue  `query:"StateReason" xml:"StateReason"`
	StateReasonData                    aws.StringValue  `query:"StateReasonData" xml:"StateReasonData"`
	StateUpdatedTimestamp              time.Time        `query:"StateUpdatedTimestamp" xml:"StateUpdatedTimestamp"`
	StateValue                         aws.StringValue  `query:"StateValue" xml:"StateValue"`
	Statistic                          aws.StringValue  `query:"Statistic" xml:"Statistic"`
	Threshold                          aws.DoubleValue  `query:"Threshold" xml:"Threshold"`
	Unit                               aws.StringValue  `query:"Unit" xml:"Unit"`
}

MetricAlarm is undocumented.

type MetricDatum

type MetricDatum struct {
	Dimensions      []Dimension     `query:"Dimensions.member" xml:"Dimensions>member"`
	MetricName      aws.StringValue `query:"MetricName" xml:"MetricName"`
	StatisticValues *StatisticSet   `query:"StatisticValues" xml:"StatisticValues"`
	Timestamp       time.Time       `query:"Timestamp" xml:"Timestamp"`
	Unit            aws.StringValue `query:"Unit" xml:"Unit"`
	Value           aws.DoubleValue `query:"Value" xml:"Value"`
}

MetricDatum is undocumented.

type PutMetricAlarmInput

type PutMetricAlarmInput struct {
	ActionsEnabled          aws.BooleanValue `query:"ActionsEnabled" xml:"ActionsEnabled"`
	AlarmActions            []string         `query:"AlarmActions.member" xml:"AlarmActions>member"`
	AlarmDescription        aws.StringValue  `query:"AlarmDescription" xml:"AlarmDescription"`
	AlarmName               aws.StringValue  `query:"AlarmName" xml:"AlarmName"`
	ComparisonOperator      aws.StringValue  `query:"ComparisonOperator" xml:"ComparisonOperator"`
	Dimensions              []Dimension      `query:"Dimensions.member" xml:"Dimensions>member"`
	EvaluationPeriods       aws.IntegerValue `query:"EvaluationPeriods" xml:"EvaluationPeriods"`
	InsufficientDataActions []string         `query:"InsufficientDataActions.member" xml:"InsufficientDataActions>member"`
	MetricName              aws.StringValue  `query:"MetricName" xml:"MetricName"`
	Namespace               aws.StringValue  `query:"Namespace" xml:"Namespace"`
	OKActions               []string         `query:"OKActions.member" xml:"OKActions>member"`
	Period                  aws.IntegerValue `query:"Period" xml:"Period"`
	Statistic               aws.StringValue  `query:"Statistic" xml:"Statistic"`
	Threshold               aws.DoubleValue  `query:"Threshold" xml:"Threshold"`
	Unit                    aws.StringValue  `query:"Unit" xml:"Unit"`
}

PutMetricAlarmInput is undocumented.

type PutMetricDataInput

type PutMetricDataInput struct {
	MetricData []MetricDatum   `query:"MetricData.member" xml:"MetricData>member"`
	Namespace  aws.StringValue `query:"Namespace" xml:"Namespace"`
}

PutMetricDataInput is undocumented.

type SetAlarmStateInput

type SetAlarmStateInput struct {
	AlarmName       aws.StringValue `query:"AlarmName" xml:"AlarmName"`
	StateReason     aws.StringValue `query:"StateReason" xml:"StateReason"`
	StateReasonData aws.StringValue `query:"StateReasonData" xml:"StateReasonData"`
	StateValue      aws.StringValue `query:"StateValue" xml:"StateValue"`
}

SetAlarmStateInput is undocumented.

type StatisticSet

type StatisticSet struct {
	Maximum     aws.DoubleValue `query:"Maximum" xml:"Maximum"`
	Minimum     aws.DoubleValue `query:"Minimum" xml:"Minimum"`
	SampleCount aws.DoubleValue `query:"SampleCount" xml:"SampleCount"`
	Sum         aws.DoubleValue `query:"Sum" xml:"Sum"`
}

StatisticSet is undocumented.

Jump to

Keyboard shortcuts

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