:doc:`IoT <../../iot>` / Client / list_topic_rules

****************
list_topic_rules
****************



.. py:method:: IoT.Client.list_topic_rules(**kwargs)

  

  Lists the rules for the specific topic.

   

  Requires permission to access the `ListTopicRules <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRules>`_  


  **Request Syntax**
  ::

    response = client.list_topic_rules(
        topic='string',
        maxResults=123,
        nextToken='string',
        ruleDisabled=True|False
    )
    
  :type topic: string
  :param topic: 

    The topic.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return.

    

  
  :type nextToken: string
  :param nextToken: 

    To retrieve the next set of results, the ``nextToken`` value from a previous response; otherwise **null** to receive the first set of results.

    

  
  :type ruleDisabled: boolean
  :param ruleDisabled: 

    Specifies whether the rule is disabled.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'rules': [
              {
                  'ruleArn': 'string',
                  'ruleName': 'string',
                  'topicPattern': 'string',
                  'createdAt': datetime(2015, 1, 1),
                  'ruleDisabled': True|False
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output from the ListTopicRules operation.

      
      

      - **rules** *(list) --* 

        The rules.

        
        

        - *(dict) --* 

          Describes a rule.

          
          

          - **ruleArn** *(string) --* 

            The rule ARN.

            
          

          - **ruleName** *(string) --* 

            The name of the rule.

            
          

          - **topicPattern** *(string) --* 

            The pattern for the topic names that apply.

            
          

          - **createdAt** *(datetime) --* 

            The date and time the rule was created.

            
          

          - **ruleDisabled** *(boolean) --* 

            Specifies whether the rule is disabled.

            
      
    
      

      - **nextToken** *(string) --* 

        The token to use to get the next set of results, or **null** if there are no additional results.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InternalException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  