Menu
AWS IoT
Developer Guide

ListTopicRules

Lists the rules for the specific topic.

Request syntax:

GET /rules?topic=topic&maxResults=maxResults&nextToken=nextToken&ruleDisabled=ruleDisabled

URI Request Parameters:

Name

Type

Req?

Description

topic

Topic

no

The topic.

maxResults

GEMaxResults

no

The maximum number of results to return.

nextToken

NextToken

no

A token used to retrieve the next value.

ruleDisabled

IsDisabled

no

Specifies whether the rule is disabled.

Response syntax:

Content-type: application/json { "rules": [ { "ruleArn": "string", "ruleName": "string", "topicPattern": "string", "createdAt": "timestamp", "ruleDisabled": "boolean" } ], "nextToken": "string" }

Response Body Parameters:

Name

Type

Req?

Description

rules

TopicRuleList

no

The rules.

nextToken

NextToken

no

A token used to retrieve the next value.

Errors:

InternalException

An unexpected error has occurred.

HTTP response code: 500

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

CLI

Synopsis:

aws iot list-topic-rules \ [--topic <value>] \ [--max-results <value>] \ [--next-token <value>] \ [--rule-disabled | --no-rule-disabled] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "topic": "string", "maxResults": "integer", "nextToken": "string", "ruleDisabled": "boolean" }

cli-input-json fields:

Name

Type

Description

topic

string

The topic.

maxResults

integer

java class: java.lang.Integer

range- max:10000 min:1

The maximum number of results to return.

nextToken

string

A token used to retrieve the next value.

ruleDisabled

boolean

java class: java.lang.Boolean

Specifies whether the rule is disabled.

Output:

{ "rules": [ { "ruleArn": "string", "ruleName": "string", "topicPattern": "string", "createdAt": "timestamp", "ruleDisabled": "boolean" } ], "nextToken": "string" }

cli output fields:

Name

Type

Description

rules

list

member: TopicRuleListItem

The rules.

TopicRuleListItem

TopicRuleListItem

ruleArn

string

The rule ARN.

ruleName

string

length max:128 min:1

pattern: ^[a-zA-Z0-9_]+$

The name of the rule.

topicPattern

string

The pattern for the topic names that apply.

createdAt

timestamp

The date and time the rule was created.

ruleDisabled

boolean

java class: java.lang.Boolean

Specifies whether the rule is disabled.

nextToken

string

A token used to retrieve the next value.

On this page: