Menu
Amazon CloudWatch Events
API Reference (API Version 2015-10-07)

DescribeRule

Describes the specified rule.

Request Syntax

{
   "Name": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Name

The name of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\.\-_A-Za-z0-9]+

Required: Yes

Response Syntax

{
   "Arn": "string",
   "Description": "string",
   "EventPattern": "string",
   "Name": "string",
   "RoleArn": "string",
   "ScheduleExpression": "string",
   "State": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Arn

The Amazon Resource Name (ARN) of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Description

The description of the rule.

Type: String

Length Constraints: Maximum length of 512.

EventPattern

The event pattern.

Type: String

Length Constraints: Maximum length of 2048.

Name

The name of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\.\-_A-Za-z0-9]+

RoleArn

The Amazon Resource Name (ARN) of the IAM role associated with the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

ScheduleExpression

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".

Type: String

Length Constraints: Maximum length of 256.

State

Specifies whether the rule is enabled or disabled.

Type: String

Valid Values: ENABLED | DISABLED

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalException

This exception occurs due to unexpected causes.

HTTP Status Code: 500

ResourceNotFoundException

The rule does not exist.

HTTP Status Code: 400

Example

Describes a rule named "test"

The following is an example of a DescribeRule request and response.

Sample Request

POST / HTTP/1.1
Host: events.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive 
X-Amz-Target: AWSEvents.DescribeRule

{
    "Name": "test"
}

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>

{
    "Name": "test", 
    "EventPattern": "{\"source\":[\"aws.autoscaling\"],\"detail-type\":[\"EC2 Instance Launch Successful\",\"EC2 Instance Terminate Successful\",\"EC2 Instance Launch Unsuccessful\",\"EC2 Instance Terminate Unsuccessful\"]}", 
    "State": "ENABLED", 
    "Arn": "arn:aws:events:us-east-1:123456789012:rule/test", 
    "Description": "Test rule for Auto Scaling events"
}