cloudwatchevents

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cloudwatchevents provides a client for Amazon CloudWatch Events.

Index

Examples

Constants

View Source
const (
	// RuleStateEnabled is a RuleState enum value
	RuleStateEnabled = "ENABLED"

	// RuleStateDisabled is a RuleState enum value
	RuleStateDisabled = "DISABLED"
)
View Source
const (

	// ErrCodeConcurrentModificationException for service response error code
	// "ConcurrentModificationException".
	//
	// This exception occurs if there is concurrent modification on rule or target.
	ErrCodeConcurrentModificationException = "ConcurrentModificationException"

	// ErrCodeInternalException for service response error code
	// "InternalException".
	//
	// This exception occurs due to unexpected causes.
	ErrCodeInternalException = "InternalException"

	// ErrCodeInvalidEventPatternException for service response error code
	// "InvalidEventPatternException".
	//
	// The event pattern is invalid.
	ErrCodeInvalidEventPatternException = "InvalidEventPatternException"

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// This exception occurs if you try to create more rules or add more targets
	// to a rule than allowed by default.
	ErrCodeLimitExceededException = "LimitExceededException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// The rule does not exist.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"
)
View Source
const (
	ServiceName = "events"    // Service endpoint prefix API calls made to.
	EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchEvents

type CloudWatchEvents struct {
	*client.Client
}

Amazon CloudWatch Events helps you to respond to state changes in your AWS resources. When your resources change state they automatically send events into an event stream. You can create rules that match selected events in the stream and route them to targets to take action. You can also use rules to take action on a pre-determined schedule. For example, you can configure rules to:

  • Automatically invoke an AWS Lambda function to update DNS entries when an event notifies you that Amazon EC2 instance enters the running state.

  • Direct specific API records from CloudTrail to an Amazon Kinesis stream for detailed analysis of potential security or availability risks.

  • Periodically invoke a built-in target to create a snapshot of an Amazon EBS volume.

For more information about Amazon CloudWatch Events features, see the Amazon CloudWatch Developer Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide). The service client's operations are safe to be used concurrently. It is not safe to mutate any of the client's properties though. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07

func New

New creates a new instance of the CloudWatchEvents client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

// Create a CloudWatchEvents client from just a session.
svc := cloudwatchevents.New(mySession)

// Create a CloudWatchEvents client with additional configuration
svc := cloudwatchevents.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*CloudWatchEvents) DeleteRule

func (c *CloudWatchEvents) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error)

DeleteRule API operation for Amazon CloudWatch Events.

Deletes a rule. You must remove all targets from a rule using RemoveTargets before you can delete the rule.

Note: When you delete a rule, incoming events might still continue to match to the deleted rule. Please allow a short period of time for changes to take effect.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation DeleteRule for usage and error information.

Returned Error Codes:

  • ErrCodeConcurrentModificationException "ConcurrentModificationException" This exception occurs if there is concurrent modification on rule or target.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.DeleteRuleInput{
		Name: aws.String("RuleName"), // Required
	}
	resp, err := svc.DeleteRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) DeleteRuleRequest

func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput)

DeleteRuleRequest generates a "aws/request.Request" representing the client's request for the DeleteRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DeleteRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteRuleRequest method.
req, resp := client.DeleteRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule

func (*CloudWatchEvents) DescribeRule

func (c *CloudWatchEvents) DescribeRule(input *DescribeRuleInput) (*DescribeRuleOutput, error)

DescribeRule API operation for Amazon CloudWatch Events.

Describes the details of the specified rule.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation DescribeRule for usage and error information.

Returned Error Codes:

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" The rule does not exist.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.DescribeRuleInput{
		Name: aws.String("RuleName"), // Required
	}
	resp, err := svc.DescribeRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) DescribeRuleRequest

func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *request.Request, output *DescribeRuleOutput)

DescribeRuleRequest generates a "aws/request.Request" representing the client's request for the DescribeRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DescribeRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DescribeRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DescribeRuleRequest method.
req, resp := client.DescribeRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule

func (*CloudWatchEvents) DisableRule

func (c *CloudWatchEvents) DisableRule(input *DisableRuleInput) (*DisableRuleOutput, error)

DisableRule API operation for Amazon CloudWatch Events.

Disables a rule. A disabled rule won't match any events, and won't self-trigger if it has a schedule expression.

Note: When you disable a rule, incoming events might still continue to match to the disabled rule. Please allow a short period of time for changes to take effect.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation DisableRule for usage and error information.

Returned Error Codes:

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" The rule does not exist.

  • ErrCodeConcurrentModificationException "ConcurrentModificationException" This exception occurs if there is concurrent modification on rule or target.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.DisableRuleInput{
		Name: aws.String("RuleName"), // Required
	}
	resp, err := svc.DisableRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) DisableRuleRequest

func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *request.Request, output *DisableRuleOutput)

DisableRuleRequest generates a "aws/request.Request" representing the client's request for the DisableRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See DisableRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DisableRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DisableRuleRequest method.
req, resp := client.DisableRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule

func (*CloudWatchEvents) EnableRule

func (c *CloudWatchEvents) EnableRule(input *EnableRuleInput) (*EnableRuleOutput, error)

EnableRule API operation for Amazon CloudWatch Events.

Enables a rule. If the rule does not exist, the operation fails.

Note: When you enable a rule, incoming events might not immediately start matching to a newly enabled rule. Please allow a short period of time for changes to take effect.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation EnableRule for usage and error information.

Returned Error Codes:

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" The rule does not exist.

  • ErrCodeConcurrentModificationException "ConcurrentModificationException" This exception occurs if there is concurrent modification on rule or target.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.EnableRuleInput{
		Name: aws.String("RuleName"), // Required
	}
	resp, err := svc.EnableRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) EnableRuleRequest

func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *request.Request, output *EnableRuleOutput)

EnableRuleRequest generates a "aws/request.Request" representing the client's request for the EnableRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See EnableRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the EnableRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the EnableRuleRequest method.
req, resp := client.EnableRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule

func (*CloudWatchEvents) ListRuleNamesByTarget

ListRuleNamesByTarget API operation for Amazon CloudWatch Events.

Lists the names of the rules that the given target is put to. You can see which of the rules in Amazon CloudWatch Events can invoke a specific target in your account. If you have more rules in your account than the given limit, the results will be paginated. In that case, use the next token returned in the response and repeat ListRulesByTarget until the NextToken in the response is returned as null.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation ListRuleNamesByTarget for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.ListRuleNamesByTargetInput{
		TargetArn: aws.String("TargetArn"), // Required
		Limit:     aws.Int64(1),
		NextToken: aws.String("NextToken"),
	}
	resp, err := svc.ListRuleNamesByTarget(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) ListRuleNamesByTargetRequest

func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTargetInput) (req *request.Request, output *ListRuleNamesByTargetOutput)

ListRuleNamesByTargetRequest generates a "aws/request.Request" representing the client's request for the ListRuleNamesByTarget operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListRuleNamesByTarget for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListRuleNamesByTarget method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListRuleNamesByTargetRequest method.
req, resp := client.ListRuleNamesByTargetRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget

func (*CloudWatchEvents) ListRules

func (c *CloudWatchEvents) ListRules(input *ListRulesInput) (*ListRulesOutput, error)

ListRules API operation for Amazon CloudWatch Events.

Lists the Amazon CloudWatch Events rules in your account. You can either list all the rules or you can provide a prefix to match to the rule names. If you have more rules in your account than the given limit, the results will be paginated. In that case, use the next token returned in the response and repeat ListRules until the NextToken in the response is returned as null.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation ListRules for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.ListRulesInput{
		Limit:      aws.Int64(1),
		NamePrefix: aws.String("RuleName"),
		NextToken:  aws.String("NextToken"),
	}
	resp, err := svc.ListRules(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) ListRulesRequest

func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput)

ListRulesRequest generates a "aws/request.Request" representing the client's request for the ListRules operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListRules for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListRules method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListRulesRequest method.
req, resp := client.ListRulesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules

func (*CloudWatchEvents) ListTargetsByRule

func (c *CloudWatchEvents) ListTargetsByRule(input *ListTargetsByRuleInput) (*ListTargetsByRuleOutput, error)

ListTargetsByRule API operation for Amazon CloudWatch Events.

Lists of targets assigned to the rule.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation ListTargetsByRule for usage and error information.

Returned Error Codes:

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" The rule does not exist.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.ListTargetsByRuleInput{
		Rule:      aws.String("RuleName"), // Required
		Limit:     aws.Int64(1),
		NextToken: aws.String("NextToken"),
	}
	resp, err := svc.ListTargetsByRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) ListTargetsByRuleRequest

func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInput) (req *request.Request, output *ListTargetsByRuleOutput)

ListTargetsByRuleRequest generates a "aws/request.Request" representing the client's request for the ListTargetsByRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See ListTargetsByRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListTargetsByRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListTargetsByRuleRequest method.
req, resp := client.ListTargetsByRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule

func (*CloudWatchEvents) PutEvents

func (c *CloudWatchEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error)

PutEvents API operation for Amazon CloudWatch Events.

Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation PutEvents for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents

Example
package main

import (
	"fmt"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.PutEventsInput{
		Entries: []*cloudwatchevents.PutEventsRequestEntry{ // Required
			{ // Required
				Detail:     aws.String("String"),
				DetailType: aws.String("String"),
				Resources: []*string{
					aws.String("EventResource"), // Required
					// More values...
				},
				Source: aws.String("String"),
				Time:   aws.Time(time.Now()),
			},
			// More values...
		},
	}
	resp, err := svc.PutEvents(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) PutEventsRequest

func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput)

PutEventsRequest generates a "aws/request.Request" representing the client's request for the PutEvents operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See PutEvents for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the PutEvents method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the PutEventsRequest method.
req, resp := client.PutEventsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents

func (*CloudWatchEvents) PutRule

func (c *CloudWatchEvents) PutRule(input *PutRuleInput) (*PutRuleOutput, error)

PutRule API operation for Amazon CloudWatch Events.

Creates or updates a rule. Rules are enabled by default, or based on value of the State parameter. You can disable a rule using DisableRule.

Note: When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Please allow a short period of time for changes to take effect.

A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule will trigger on matching events as well as on a schedule.

Note: Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation PutRule for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidEventPatternException "InvalidEventPatternException" The event pattern is invalid.

  • ErrCodeLimitExceededException "LimitExceededException" This exception occurs if you try to create more rules or add more targets to a rule than allowed by default.

  • ErrCodeConcurrentModificationException "ConcurrentModificationException" This exception occurs if there is concurrent modification on rule or target.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.PutRuleInput{
		Name:               aws.String("RuleName"), // Required
		Description:        aws.String("RuleDescription"),
		EventPattern:       aws.String("EventPattern"),
		RoleArn:            aws.String("RoleArn"),
		ScheduleExpression: aws.String("ScheduleExpression"),
		State:              aws.String("RuleState"),
	}
	resp, err := svc.PutRule(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) PutRuleRequest

func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Request, output *PutRuleOutput)

PutRuleRequest generates a "aws/request.Request" representing the client's request for the PutRule operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See PutRule for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the PutRule method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the PutRuleRequest method.
req, resp := client.PutRuleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule

func (*CloudWatchEvents) PutTargets

func (c *CloudWatchEvents) PutTargets(input *PutTargetsInput) (*PutTargetsOutput, error)

PutTargets API operation for Amazon CloudWatch Events.

Adds target(s) to a rule. Targets are the resources that can be invoked when a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets. Updates the target(s) if they are already associated with the role. In other words, if there is already a target with the given target ID, then the target associated with that ID is updated.

In order to be able to make API calls against the resources you own, Amazon CloudWatch Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, CloudWatch Events relies on resource-based policies. For Amazon Kinesis streams, CloudWatch Events relies on IAM roles. For more information, see Permissions for Sending Events to Targets (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/EventsTargetPermissions.html) in the Amazon CloudWatch Developer Guide.

Input and InputPath are mutually-exclusive and optional parameters of a target. When a rule is triggered due to a matched event, if for a target:

  • Neither Input nor InputPath is specified, then the entire event is passed to the target in JSON form.
  • InputPath is specified in the form of JSONPath (e.g. $.detail), then only the part of the event specified in the path is passed to the target (e.g. only the detail part of the event is passed).
  • Input is specified in the form of a valid JSON, then the matched event is overridden with this constant.

Note: When you add targets to a rule, when the associated rule triggers, new or updated targets might not be immediately invoked. Please allow a short period of time for changes to take effect.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation PutTargets for usage and error information.

Returned Error Codes:

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" The rule does not exist.

  • ErrCodeConcurrentModificationException "ConcurrentModificationException" This exception occurs if there is concurrent modification on rule or target.

  • ErrCodeLimitExceededException "LimitExceededException" This exception occurs if you try to create more rules or add more targets to a rule than allowed by default.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.PutTargetsInput{
		Rule: aws.String("RuleName"), // Required
		Targets: []*cloudwatchevents.Target{ // Required
			{ // Required
				Arn:       aws.String("TargetArn"), // Required
				Id:        aws.String("TargetId"),  // Required
				Input:     aws.String("TargetInput"),
				InputPath: aws.String("TargetInputPath"),
			},
			// More values...
		},
	}
	resp, err := svc.PutTargets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) PutTargetsRequest

func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *request.Request, output *PutTargetsOutput)

PutTargetsRequest generates a "aws/request.Request" representing the client's request for the PutTargets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See PutTargets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the PutTargets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the PutTargetsRequest method.
req, resp := client.PutTargetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets

func (*CloudWatchEvents) RemoveTargets

func (c *CloudWatchEvents) RemoveTargets(input *RemoveTargetsInput) (*RemoveTargetsOutput, error)

RemoveTargets API operation for Amazon CloudWatch Events.

Removes target(s) from a rule so that when the rule is triggered, those targets will no longer be invoked.

Note: When you remove a target, when the associated rule triggers, removed targets might still continue to be invoked. Please allow a short period of time for changes to take effect.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation RemoveTargets for usage and error information.

Returned Error Codes:

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" The rule does not exist.

  • ErrCodeConcurrentModificationException "ConcurrentModificationException" This exception occurs if there is concurrent modification on rule or target.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.RemoveTargetsInput{
		Ids: []*string{ // Required
			aws.String("TargetId"), // Required
			// More values...
		},
		Rule: aws.String("RuleName"), // Required
	}
	resp, err := svc.RemoveTargets(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) RemoveTargetsRequest

func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req *request.Request, output *RemoveTargetsOutput)

RemoveTargetsRequest generates a "aws/request.Request" representing the client's request for the RemoveTargets operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See RemoveTargets for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the RemoveTargets method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the RemoveTargetsRequest method.
req, resp := client.RemoveTargetsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets

func (*CloudWatchEvents) TestEventPattern

func (c *CloudWatchEvents) TestEventPattern(input *TestEventPatternInput) (*TestEventPatternOutput, error)

TestEventPattern API operation for Amazon CloudWatch Events.

Tests whether an event pattern matches the provided event.

Note: Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon CloudWatch Events's API operation TestEventPattern for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidEventPatternException "InvalidEventPatternException" The event pattern is invalid.

  • ErrCodeInternalException "InternalException" This exception occurs due to unexpected causes.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)

func main() {
	sess := session.Must(session.NewSession())

	svc := cloudwatchevents.New(sess)

	params := &cloudwatchevents.TestEventPatternInput{
		Event:        aws.String("String"),       // Required
		EventPattern: aws.String("EventPattern"), // Required
	}
	resp, err := svc.TestEventPattern(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudWatchEvents) TestEventPatternRequest

func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) (req *request.Request, output *TestEventPatternOutput)

TestEventPatternRequest generates a "aws/request.Request" representing the client's request for the TestEventPattern operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

See TestEventPattern for usage and error information.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the TestEventPattern method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the TestEventPatternRequest method.
req, resp := client.TestEventPatternRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern

type DeleteRuleInput

type DeleteRuleInput struct {

	// The name of the rule to be deleted.
	//
	// Name is a required field
	Name *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the DeleteRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRuleRequest

func (DeleteRuleInput) GoString

func (s DeleteRuleInput) GoString() string

GoString returns the string representation

func (*DeleteRuleInput) SetName added in v1.5.0

func (s *DeleteRuleInput) SetName(v string) *DeleteRuleInput

SetName sets the Name field's value.

func (DeleteRuleInput) String

func (s DeleteRuleInput) String() string

String returns the string representation

func (*DeleteRuleInput) Validate added in v1.1.21

func (s *DeleteRuleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DeleteRuleOutput

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

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRuleOutput

func (DeleteRuleOutput) GoString

func (s DeleteRuleOutput) GoString() string

GoString returns the string representation

func (DeleteRuleOutput) String

func (s DeleteRuleOutput) String() string

String returns the string representation

type DescribeRuleInput

type DescribeRuleInput struct {

	// The name of the rule you want to describe details for.
	//
	// Name is a required field
	Name *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the DescribeRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRuleRequest

func (DescribeRuleInput) GoString

func (s DescribeRuleInput) GoString() string

GoString returns the string representation

func (*DescribeRuleInput) SetName added in v1.5.0

SetName sets the Name field's value.

func (DescribeRuleInput) String

func (s DescribeRuleInput) String() string

String returns the string representation

func (*DescribeRuleInput) Validate added in v1.1.21

func (s *DescribeRuleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DescribeRuleOutput

type DescribeRuleOutput struct {

	// The Amazon Resource Name (ARN) associated with the rule.
	Arn *string `min:"1" type:"string"`

	// The rule's description.
	Description *string `type:"string"`

	// The event pattern.
	EventPattern *string `type:"string"`

	// The rule's name.
	Name *string `min:"1" type:"string"`

	// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
	RoleArn *string `min:"1" type:"string"`

	// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
	ScheduleExpression *string `type:"string"`

	// Specifies whether the rule is enabled or disabled.
	State *string `type:"string" enum:"RuleState"`
	// contains filtered or unexported fields
}

The result of the DescribeRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRuleResponse

func (DescribeRuleOutput) GoString

func (s DescribeRuleOutput) GoString() string

GoString returns the string representation

func (*DescribeRuleOutput) SetArn added in v1.5.0

SetArn sets the Arn field's value.

func (*DescribeRuleOutput) SetDescription added in v1.5.0

func (s *DescribeRuleOutput) SetDescription(v string) *DescribeRuleOutput

SetDescription sets the Description field's value.

func (*DescribeRuleOutput) SetEventPattern added in v1.5.0

func (s *DescribeRuleOutput) SetEventPattern(v string) *DescribeRuleOutput

SetEventPattern sets the EventPattern field's value.

func (*DescribeRuleOutput) SetName added in v1.5.0

SetName sets the Name field's value.

func (*DescribeRuleOutput) SetRoleArn added in v1.5.0

func (s *DescribeRuleOutput) SetRoleArn(v string) *DescribeRuleOutput

SetRoleArn sets the RoleArn field's value.

func (*DescribeRuleOutput) SetScheduleExpression added in v1.5.0

func (s *DescribeRuleOutput) SetScheduleExpression(v string) *DescribeRuleOutput

SetScheduleExpression sets the ScheduleExpression field's value.

func (*DescribeRuleOutput) SetState added in v1.5.0

SetState sets the State field's value.

func (DescribeRuleOutput) String

func (s DescribeRuleOutput) String() string

String returns the string representation

type DisableRuleInput

type DisableRuleInput struct {

	// The name of the rule you want to disable.
	//
	// Name is a required field
	Name *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the DisableRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRuleRequest

func (DisableRuleInput) GoString

func (s DisableRuleInput) GoString() string

GoString returns the string representation

func (*DisableRuleInput) SetName added in v1.5.0

func (s *DisableRuleInput) SetName(v string) *DisableRuleInput

SetName sets the Name field's value.

func (DisableRuleInput) String

func (s DisableRuleInput) String() string

String returns the string representation

func (*DisableRuleInput) Validate added in v1.1.21

func (s *DisableRuleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DisableRuleOutput

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

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRuleOutput

func (DisableRuleOutput) GoString

func (s DisableRuleOutput) GoString() string

GoString returns the string representation

func (DisableRuleOutput) String

func (s DisableRuleOutput) String() string

String returns the string representation

type EnableRuleInput

type EnableRuleInput struct {

	// The name of the rule that you want to enable.
	//
	// Name is a required field
	Name *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the EnableRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRuleRequest

func (EnableRuleInput) GoString

func (s EnableRuleInput) GoString() string

GoString returns the string representation

func (*EnableRuleInput) SetName added in v1.5.0

func (s *EnableRuleInput) SetName(v string) *EnableRuleInput

SetName sets the Name field's value.

func (EnableRuleInput) String

func (s EnableRuleInput) String() string

String returns the string representation

func (*EnableRuleInput) Validate added in v1.1.21

func (s *EnableRuleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type EnableRuleOutput

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

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRuleOutput

func (EnableRuleOutput) GoString

func (s EnableRuleOutput) GoString() string

GoString returns the string representation

func (EnableRuleOutput) String

func (s EnableRuleOutput) String() string

String returns the string representation

type ListRuleNamesByTargetInput

type ListRuleNamesByTargetInput struct {

	// The maximum number of results to return.
	Limit *int64 `min:"1" type:"integer"`

	// The token returned by a previous call to indicate that there is more data
	// available.
	NextToken *string `min:"1" type:"string"`

	// The Amazon Resource Name (ARN) of the target resource that you want to list
	// the rules for.
	//
	// TargetArn is a required field
	TargetArn *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the ListRuleNamesByTarget operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTargetRequest

func (ListRuleNamesByTargetInput) GoString

func (s ListRuleNamesByTargetInput) GoString() string

GoString returns the string representation

func (*ListRuleNamesByTargetInput) SetLimit added in v1.5.0

SetLimit sets the Limit field's value.

func (*ListRuleNamesByTargetInput) SetNextToken added in v1.5.0

SetNextToken sets the NextToken field's value.

func (*ListRuleNamesByTargetInput) SetTargetArn added in v1.5.0

SetTargetArn sets the TargetArn field's value.

func (ListRuleNamesByTargetInput) String

String returns the string representation

func (*ListRuleNamesByTargetInput) Validate added in v1.1.21

func (s *ListRuleNamesByTargetInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListRuleNamesByTargetOutput

type ListRuleNamesByTargetOutput struct {

	// Indicates that there are additional results to retrieve.
	NextToken *string `min:"1" type:"string"`

	// List of rules names that can invoke the given target.
	RuleNames []*string `type:"list"`
	// contains filtered or unexported fields
}

The result of the ListRuleNamesByTarget operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTargetResponse

func (ListRuleNamesByTargetOutput) GoString

func (s ListRuleNamesByTargetOutput) GoString() string

GoString returns the string representation

func (*ListRuleNamesByTargetOutput) SetNextToken added in v1.5.0

SetNextToken sets the NextToken field's value.

func (*ListRuleNamesByTargetOutput) SetRuleNames added in v1.5.0

SetRuleNames sets the RuleNames field's value.

func (ListRuleNamesByTargetOutput) String

String returns the string representation

type ListRulesInput

type ListRulesInput struct {

	// The maximum number of results to return.
	Limit *int64 `min:"1" type:"integer"`

	// The prefix matching the rule name.
	NamePrefix *string `min:"1" type:"string"`

	// The token returned by a previous call to indicate that there is more data
	// available.
	NextToken *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

Container for the parameters to the ListRules operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRulesRequest

func (ListRulesInput) GoString

func (s ListRulesInput) GoString() string

GoString returns the string representation

func (*ListRulesInput) SetLimit added in v1.5.0

func (s *ListRulesInput) SetLimit(v int64) *ListRulesInput

SetLimit sets the Limit field's value.

func (*ListRulesInput) SetNamePrefix added in v1.5.0

func (s *ListRulesInput) SetNamePrefix(v string) *ListRulesInput

SetNamePrefix sets the NamePrefix field's value.

func (*ListRulesInput) SetNextToken added in v1.5.0

func (s *ListRulesInput) SetNextToken(v string) *ListRulesInput

SetNextToken sets the NextToken field's value.

func (ListRulesInput) String

func (s ListRulesInput) String() string

String returns the string representation

func (*ListRulesInput) Validate added in v1.1.21

func (s *ListRulesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListRulesOutput

type ListRulesOutput struct {

	// Indicates that there are additional results to retrieve.
	NextToken *string `min:"1" type:"string"`

	// List of rules matching the specified criteria.
	Rules []*Rule `type:"list"`
	// contains filtered or unexported fields
}

The result of the ListRules operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRulesResponse

func (ListRulesOutput) GoString

func (s ListRulesOutput) GoString() string

GoString returns the string representation

func (*ListRulesOutput) SetNextToken added in v1.5.0

func (s *ListRulesOutput) SetNextToken(v string) *ListRulesOutput

SetNextToken sets the NextToken field's value.

func (*ListRulesOutput) SetRules added in v1.5.0

func (s *ListRulesOutput) SetRules(v []*Rule) *ListRulesOutput

SetRules sets the Rules field's value.

func (ListRulesOutput) String

func (s ListRulesOutput) String() string

String returns the string representation

type ListTargetsByRuleInput

type ListTargetsByRuleInput struct {

	// The maximum number of results to return.
	Limit *int64 `min:"1" type:"integer"`

	// The token returned by a previous call to indicate that there is more data
	// available.
	NextToken *string `min:"1" type:"string"`

	// The name of the rule whose targets you want to list.
	//
	// Rule is a required field
	Rule *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the ListTargetsByRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRuleRequest

func (ListTargetsByRuleInput) GoString

func (s ListTargetsByRuleInput) GoString() string

GoString returns the string representation

func (*ListTargetsByRuleInput) SetLimit added in v1.5.0

SetLimit sets the Limit field's value.

func (*ListTargetsByRuleInput) SetNextToken added in v1.5.0

SetNextToken sets the NextToken field's value.

func (*ListTargetsByRuleInput) SetRule added in v1.5.0

SetRule sets the Rule field's value.

func (ListTargetsByRuleInput) String

func (s ListTargetsByRuleInput) String() string

String returns the string representation

func (*ListTargetsByRuleInput) Validate added in v1.1.21

func (s *ListTargetsByRuleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListTargetsByRuleOutput

type ListTargetsByRuleOutput struct {

	// Indicates that there are additional results to retrieve.
	NextToken *string `min:"1" type:"string"`

	// Lists the targets assigned to the rule.
	Targets []*Target `type:"list"`
	// contains filtered or unexported fields
}

The result of the ListTargetsByRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRuleResponse

func (ListTargetsByRuleOutput) GoString

func (s ListTargetsByRuleOutput) GoString() string

GoString returns the string representation

func (*ListTargetsByRuleOutput) SetNextToken added in v1.5.0

SetNextToken sets the NextToken field's value.

func (*ListTargetsByRuleOutput) SetTargets added in v1.5.0

SetTargets sets the Targets field's value.

func (ListTargetsByRuleOutput) String

func (s ListTargetsByRuleOutput) String() string

String returns the string representation

type PutEventsInput

type PutEventsInput struct {

	// The entry that defines an event in your system. You can specify several parameters
	// for the entry such as the source and type of the event, resources associated
	// with the event, and so on.
	//
	// Entries is a required field
	Entries []*PutEventsRequestEntry `min:"1" type:"list" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the PutEvents operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsRequest

func (PutEventsInput) GoString

func (s PutEventsInput) GoString() string

GoString returns the string representation

func (*PutEventsInput) SetEntries added in v1.5.0

SetEntries sets the Entries field's value.

func (PutEventsInput) String

func (s PutEventsInput) String() string

String returns the string representation

func (*PutEventsInput) Validate added in v1.1.21

func (s *PutEventsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type PutEventsOutput

type PutEventsOutput struct {

	// A list of successfully and unsuccessfully ingested events results. If the
	// ingestion was successful, the entry will have the event ID in it. If not,
	// then the ErrorCode and ErrorMessage can be used to identify the problem with
	// the entry.
	Entries []*PutEventsResultEntry `type:"list"`

	// The number of failed entries.
	FailedEntryCount *int64 `type:"integer"`
	// contains filtered or unexported fields
}

The result of the PutEvents operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsResponse

func (PutEventsOutput) GoString

func (s PutEventsOutput) GoString() string

GoString returns the string representation

func (*PutEventsOutput) SetEntries added in v1.5.0

SetEntries sets the Entries field's value.

func (*PutEventsOutput) SetFailedEntryCount added in v1.5.0

func (s *PutEventsOutput) SetFailedEntryCount(v int64) *PutEventsOutput

SetFailedEntryCount sets the FailedEntryCount field's value.

func (PutEventsOutput) String

func (s PutEventsOutput) String() string

String returns the string representation

type PutEventsRequestEntry

type PutEventsRequestEntry struct {

	// In the JSON sense, an object containing fields, which may also contain nested
	// sub-objects. No constraints are imposed on its contents.
	Detail *string `type:"string"`

	// Free-form string used to decide what fields to expect in the event detail.
	DetailType *string `type:"string"`

	// AWS resources, identified by Amazon Resource Name (ARN), which the event
	// primarily concerns. Any number, including zero, may be present.
	Resources []*string `type:"list"`

	// The source of the event.
	Source *string `type:"string"`

	// Timestamp of event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt).
	// If no timestamp is provided, the timestamp of the PutEvents call will be
	// used.
	Time *time.Time `type:"timestamp" timestampFormat:"unix"`
	// contains filtered or unexported fields
}

Contains information about the event to be used in PutEvents. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsRequestEntry

func (PutEventsRequestEntry) GoString

func (s PutEventsRequestEntry) GoString() string

GoString returns the string representation

func (*PutEventsRequestEntry) SetDetail added in v1.5.0

SetDetail sets the Detail field's value.

func (*PutEventsRequestEntry) SetDetailType added in v1.5.0

func (s *PutEventsRequestEntry) SetDetailType(v string) *PutEventsRequestEntry

SetDetailType sets the DetailType field's value.

func (*PutEventsRequestEntry) SetResources added in v1.5.0

func (s *PutEventsRequestEntry) SetResources(v []*string) *PutEventsRequestEntry

SetResources sets the Resources field's value.

func (*PutEventsRequestEntry) SetSource added in v1.5.0

SetSource sets the Source field's value.

func (*PutEventsRequestEntry) SetTime added in v1.5.0

SetTime sets the Time field's value.

func (PutEventsRequestEntry) String

func (s PutEventsRequestEntry) String() string

String returns the string representation

type PutEventsResultEntry

type PutEventsResultEntry struct {

	// The error code representing why the event submission failed on this entry.
	ErrorCode *string `type:"string"`

	// The error message explaining why the event submission failed on this entry.
	ErrorMessage *string `type:"string"`

	// The ID of the event submitted to Amazon CloudWatch Events.
	EventId *string `type:"string"`
	// contains filtered or unexported fields
}

A PutEventsResult contains a list of PutEventsResultEntry. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEventsResultEntry

func (PutEventsResultEntry) GoString

func (s PutEventsResultEntry) GoString() string

GoString returns the string representation

func (*PutEventsResultEntry) SetErrorCode added in v1.5.0

func (s *PutEventsResultEntry) SetErrorCode(v string) *PutEventsResultEntry

SetErrorCode sets the ErrorCode field's value.

func (*PutEventsResultEntry) SetErrorMessage added in v1.5.0

func (s *PutEventsResultEntry) SetErrorMessage(v string) *PutEventsResultEntry

SetErrorMessage sets the ErrorMessage field's value.

func (*PutEventsResultEntry) SetEventId added in v1.5.0

SetEventId sets the EventId field's value.

func (PutEventsResultEntry) String

func (s PutEventsResultEntry) String() string

String returns the string representation

type PutRuleInput

type PutRuleInput struct {

	// A description of the rule.
	Description *string `type:"string"`

	// The event pattern.
	EventPattern *string `type:"string"`

	// The name of the rule that you are creating or updating.
	//
	// Name is a required field
	Name *string `min:"1" type:"string" required:"true"`

	// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
	RoleArn *string `min:"1" type:"string"`

	// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
	ScheduleExpression *string `type:"string"`

	// Indicates whether the rule is enabled or disabled.
	State *string `type:"string" enum:"RuleState"`
	// contains filtered or unexported fields
}

Container for the parameters to the PutRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRuleRequest

func (PutRuleInput) GoString

func (s PutRuleInput) GoString() string

GoString returns the string representation

func (*PutRuleInput) SetDescription added in v1.5.0

func (s *PutRuleInput) SetDescription(v string) *PutRuleInput

SetDescription sets the Description field's value.

func (*PutRuleInput) SetEventPattern added in v1.5.0

func (s *PutRuleInput) SetEventPattern(v string) *PutRuleInput

SetEventPattern sets the EventPattern field's value.

func (*PutRuleInput) SetName added in v1.5.0

func (s *PutRuleInput) SetName(v string) *PutRuleInput

SetName sets the Name field's value.

func (*PutRuleInput) SetRoleArn added in v1.5.0

func (s *PutRuleInput) SetRoleArn(v string) *PutRuleInput

SetRoleArn sets the RoleArn field's value.

func (*PutRuleInput) SetScheduleExpression added in v1.5.0

func (s *PutRuleInput) SetScheduleExpression(v string) *PutRuleInput

SetScheduleExpression sets the ScheduleExpression field's value.

func (*PutRuleInput) SetState added in v1.5.0

func (s *PutRuleInput) SetState(v string) *PutRuleInput

SetState sets the State field's value.

func (PutRuleInput) String

func (s PutRuleInput) String() string

String returns the string representation

func (*PutRuleInput) Validate added in v1.1.21

func (s *PutRuleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type PutRuleOutput

type PutRuleOutput struct {

	// The Amazon Resource Name (ARN) that identifies the rule.
	RuleArn *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

The result of the PutRule operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRuleResponse

func (PutRuleOutput) GoString

func (s PutRuleOutput) GoString() string

GoString returns the string representation

func (*PutRuleOutput) SetRuleArn added in v1.5.0

func (s *PutRuleOutput) SetRuleArn(v string) *PutRuleOutput

SetRuleArn sets the RuleArn field's value.

func (PutRuleOutput) String

func (s PutRuleOutput) String() string

String returns the string representation

type PutTargetsInput

type PutTargetsInput struct {

	// The name of the rule you want to add targets to.
	//
	// Rule is a required field
	Rule *string `min:"1" type:"string" required:"true"`

	// List of targets you want to update or add to the rule.
	//
	// Targets is a required field
	Targets []*Target `type:"list" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the PutTargets operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargetsRequest

func (PutTargetsInput) GoString

func (s PutTargetsInput) GoString() string

GoString returns the string representation

func (*PutTargetsInput) SetRule added in v1.5.0

func (s *PutTargetsInput) SetRule(v string) *PutTargetsInput

SetRule sets the Rule field's value.

func (*PutTargetsInput) SetTargets added in v1.5.0

func (s *PutTargetsInput) SetTargets(v []*Target) *PutTargetsInput

SetTargets sets the Targets field's value.

func (PutTargetsInput) String

func (s PutTargetsInput) String() string

String returns the string representation

func (*PutTargetsInput) Validate added in v1.1.21

func (s *PutTargetsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type PutTargetsOutput

type PutTargetsOutput struct {

	// An array of failed target entries.
	FailedEntries []*PutTargetsResultEntry `type:"list"`

	// The number of failed entries.
	FailedEntryCount *int64 `type:"integer"`
	// contains filtered or unexported fields
}

The result of the PutTargets operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargetsResponse

func (PutTargetsOutput) GoString

func (s PutTargetsOutput) GoString() string

GoString returns the string representation

func (*PutTargetsOutput) SetFailedEntries added in v1.5.0

func (s *PutTargetsOutput) SetFailedEntries(v []*PutTargetsResultEntry) *PutTargetsOutput

SetFailedEntries sets the FailedEntries field's value.

func (*PutTargetsOutput) SetFailedEntryCount added in v1.5.0

func (s *PutTargetsOutput) SetFailedEntryCount(v int64) *PutTargetsOutput

SetFailedEntryCount sets the FailedEntryCount field's value.

func (PutTargetsOutput) String

func (s PutTargetsOutput) String() string

String returns the string representation

type PutTargetsResultEntry

type PutTargetsResultEntry struct {

	// The error code representing why the target submission failed on this entry.
	ErrorCode *string `type:"string"`

	// The error message explaining why the target submission failed on this entry.
	ErrorMessage *string `type:"string"`

	// The ID of the target submitted to Amazon CloudWatch Events.
	TargetId *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

A PutTargetsResult contains a list of PutTargetsResultEntry. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargetsResultEntry

func (PutTargetsResultEntry) GoString

func (s PutTargetsResultEntry) GoString() string

GoString returns the string representation

func (*PutTargetsResultEntry) SetErrorCode added in v1.5.0

SetErrorCode sets the ErrorCode field's value.

func (*PutTargetsResultEntry) SetErrorMessage added in v1.5.0

func (s *PutTargetsResultEntry) SetErrorMessage(v string) *PutTargetsResultEntry

SetErrorMessage sets the ErrorMessage field's value.

func (*PutTargetsResultEntry) SetTargetId added in v1.5.0

SetTargetId sets the TargetId field's value.

func (PutTargetsResultEntry) String

func (s PutTargetsResultEntry) String() string

String returns the string representation

type RemoveTargetsInput

type RemoveTargetsInput struct {

	// The list of target IDs to remove from the rule.
	//
	// Ids is a required field
	Ids []*string `min:"1" type:"list" required:"true"`

	// The name of the rule you want to remove targets from.
	//
	// Rule is a required field
	Rule *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the RemoveTargets operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsRequest

func (RemoveTargetsInput) GoString

func (s RemoveTargetsInput) GoString() string

GoString returns the string representation

func (*RemoveTargetsInput) SetIds added in v1.5.0

func (s *RemoveTargetsInput) SetIds(v []*string) *RemoveTargetsInput

SetIds sets the Ids field's value.

func (*RemoveTargetsInput) SetRule added in v1.5.0

SetRule sets the Rule field's value.

func (RemoveTargetsInput) String

func (s RemoveTargetsInput) String() string

String returns the string representation

func (*RemoveTargetsInput) Validate added in v1.1.21

func (s *RemoveTargetsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type RemoveTargetsOutput

type RemoveTargetsOutput struct {

	// An array of failed target entries.
	FailedEntries []*RemoveTargetsResultEntry `type:"list"`

	// The number of failed entries.
	FailedEntryCount *int64 `type:"integer"`
	// contains filtered or unexported fields
}

The result of the RemoveTargets operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsResponse

func (RemoveTargetsOutput) GoString

func (s RemoveTargetsOutput) GoString() string

GoString returns the string representation

func (*RemoveTargetsOutput) SetFailedEntries added in v1.5.0

SetFailedEntries sets the FailedEntries field's value.

func (*RemoveTargetsOutput) SetFailedEntryCount added in v1.5.0

func (s *RemoveTargetsOutput) SetFailedEntryCount(v int64) *RemoveTargetsOutput

SetFailedEntryCount sets the FailedEntryCount field's value.

func (RemoveTargetsOutput) String

func (s RemoveTargetsOutput) String() string

String returns the string representation

type RemoveTargetsResultEntry

type RemoveTargetsResultEntry struct {

	// The error code representing why the target removal failed on this entry.
	ErrorCode *string `type:"string"`

	// The error message explaining why the target removal failed on this entry.
	ErrorMessage *string `type:"string"`

	// The ID of the target requested to be removed by Amazon CloudWatch Events.
	TargetId *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

The ID of the target requested to be removed from the rule by Amazon CloudWatch Events. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargetsResultEntry

func (RemoveTargetsResultEntry) GoString

func (s RemoveTargetsResultEntry) GoString() string

GoString returns the string representation

func (*RemoveTargetsResultEntry) SetErrorCode added in v1.5.0

SetErrorCode sets the ErrorCode field's value.

func (*RemoveTargetsResultEntry) SetErrorMessage added in v1.5.0

SetErrorMessage sets the ErrorMessage field's value.

func (*RemoveTargetsResultEntry) SetTargetId added in v1.5.0

SetTargetId sets the TargetId field's value.

func (RemoveTargetsResultEntry) String

func (s RemoveTargetsResultEntry) String() string

String returns the string representation

type Rule

type Rule struct {

	// The Amazon Resource Name (ARN) of the rule.
	Arn *string `min:"1" type:"string"`

	// The description of the rule.
	Description *string `type:"string"`

	// The event pattern of the rule.
	EventPattern *string `type:"string"`

	// The rule's name.
	Name *string `min:"1" type:"string"`

	// The Amazon Resource Name (ARN) associated with the role that is used for
	// target invocation.
	RoleArn *string `min:"1" type:"string"`

	// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
	ScheduleExpression *string `type:"string"`

	// The rule's state.
	State *string `type:"string" enum:"RuleState"`
	// contains filtered or unexported fields
}

Contains information about a rule in Amazon CloudWatch Events. A ListRulesResult contains a list of Rules. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/Rule

func (Rule) GoString

func (s Rule) GoString() string

GoString returns the string representation

func (*Rule) SetArn added in v1.5.0

func (s *Rule) SetArn(v string) *Rule

SetArn sets the Arn field's value.

func (*Rule) SetDescription added in v1.5.0

func (s *Rule) SetDescription(v string) *Rule

SetDescription sets the Description field's value.

func (*Rule) SetEventPattern added in v1.5.0

func (s *Rule) SetEventPattern(v string) *Rule

SetEventPattern sets the EventPattern field's value.

func (*Rule) SetName added in v1.5.0

func (s *Rule) SetName(v string) *Rule

SetName sets the Name field's value.

func (*Rule) SetRoleArn added in v1.5.0

func (s *Rule) SetRoleArn(v string) *Rule

SetRoleArn sets the RoleArn field's value.

func (*Rule) SetScheduleExpression added in v1.5.0

func (s *Rule) SetScheduleExpression(v string) *Rule

SetScheduleExpression sets the ScheduleExpression field's value.

func (*Rule) SetState added in v1.5.0

func (s *Rule) SetState(v string) *Rule

SetState sets the State field's value.

func (Rule) String

func (s Rule) String() string

String returns the string representation

type Target

type Target struct {

	// The Amazon Resource Name (ARN) associated of the target.
	//
	// Arn is a required field
	Arn *string `min:"1" type:"string" required:"true"`

	// The unique target assignment ID.
	//
	// Id is a required field
	Id *string `min:"1" type:"string" required:"true"`

	// Valid JSON text passed to the target. For more information about JSON text,
	// see The JavaScript Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt).
	Input *string `type:"string"`

	// The value of the JSONPath that is used for extracting part of the matched
	// event when passing it to the target. For more information about JSON paths,
	// see JSONPath (http://goessner.net/articles/JsonPath/).
	InputPath *string `type:"string"`
	// contains filtered or unexported fields
}

Targets are the resources that can be invoked when a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets.

Input and InputPath are mutually-exclusive and optional parameters of a target. When a rule is triggered due to a matched event, if for a target:

  • Neither Input nor InputPath is specified, then the entire event is passed to the target in JSON form.
  • InputPath is specified in the form of JSONPath (e.g. $.detail), then only the part of the event specified in the path is passed to the target (e.g. only the detail part of the event is passed).
  • Input is specified in the form of a valid JSON, then the matched event is overridden with this constant.

Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/Target

func (Target) GoString

func (s Target) GoString() string

GoString returns the string representation

func (*Target) SetArn added in v1.5.0

func (s *Target) SetArn(v string) *Target

SetArn sets the Arn field's value.

func (*Target) SetId added in v1.5.0

func (s *Target) SetId(v string) *Target

SetId sets the Id field's value.

func (*Target) SetInput added in v1.5.0

func (s *Target) SetInput(v string) *Target

SetInput sets the Input field's value.

func (*Target) SetInputPath added in v1.5.0

func (s *Target) SetInputPath(v string) *Target

SetInputPath sets the InputPath field's value.

func (Target) String

func (s Target) String() string

String returns the string representation

func (*Target) Validate added in v1.1.21

func (s *Target) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type TestEventPatternInput

type TestEventPatternInput struct {

	// The event in the JSON format to test against the event pattern.
	//
	// Event is a required field
	Event *string `type:"string" required:"true"`

	// The event pattern you want to test.
	//
	// EventPattern is a required field
	EventPattern *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

Container for the parameters to the TestEventPattern operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPatternRequest

func (TestEventPatternInput) GoString

func (s TestEventPatternInput) GoString() string

GoString returns the string representation

func (*TestEventPatternInput) SetEvent added in v1.5.0

SetEvent sets the Event field's value.

func (*TestEventPatternInput) SetEventPattern added in v1.5.0

func (s *TestEventPatternInput) SetEventPattern(v string) *TestEventPatternInput

SetEventPattern sets the EventPattern field's value.

func (TestEventPatternInput) String

func (s TestEventPatternInput) String() string

String returns the string representation

func (*TestEventPatternInput) Validate added in v1.1.21

func (s *TestEventPatternInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type TestEventPatternOutput

type TestEventPatternOutput struct {

	// Indicates whether the event matches the event pattern.
	Result *bool `type:"boolean"`
	// contains filtered or unexported fields
}

The result of the TestEventPattern operation. Please also see https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPatternResponse

func (TestEventPatternOutput) GoString

func (s TestEventPatternOutput) GoString() string

GoString returns the string representation

func (*TestEventPatternOutput) SetResult added in v1.5.0

SetResult sets the Result field's value.

func (TestEventPatternOutput) String

func (s TestEventPatternOutput) String() string

String returns the string representation

Directories

Path Synopsis
Package cloudwatcheventsiface provides an interface to enable mocking the Amazon CloudWatch Events service client for testing your code.
Package cloudwatcheventsiface provides an interface to enable mocking the Amazon CloudWatch Events service client for testing your code.

Jump to

Keyboard shortcuts

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