:doc:`Kafka <../../kafka>` / Client / list_topics

***********
list_topics
***********



.. py:method:: Kafka.Client.list_topics(**kwargs)

  

  List topics in a MSK cluster.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListTopics>`_  


  **Request Syntax**
  ::

    response = client.list_topics(
        ClusterArn='string',
        MaxResults=123,
        NextToken='string',
        TopicNameFilter='string'
    )
    
  :type ClusterArn: string
  :param ClusterArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) that uniquely identifies the cluster.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.

    

  
  :type NextToken: string
  :param NextToken: 

    The paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request.

    

  
  :type TopicNameFilter: string
  :param TopicNameFilter: 

    Returns topics starting with given name.

    

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

    
    ::

      {
          'Topics': [
              {
                  'TopicArn': 'string',
                  'TopicName': 'string',
                  'ReplicationFactor': 123,
                  'PartitionCount': 123,
                  'OutOfSyncReplicaCount': 123
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      200 response

      
      

      - **Topics** *(list) --* 

        List containing topics info.

        
        

        - *(dict) --* 

          Includes identification info about the topic.

          
          

          - **TopicArn** *(string) --* 

            The Amazon Resource Name (ARN) of the topic.

            
          

          - **TopicName** *(string) --* 

            Name for a topic.

            
          

          - **ReplicationFactor** *(integer) --* 

            Replication factor for a topic.

            
          

          - **PartitionCount** *(integer) --* 

            Partition count for a topic.

            
          

          - **OutOfSyncReplicaCount** *(integer) --* 

            Number of out-of-sync replicas for a topic.

            
      
    
      

      - **NextToken** *(string) --* 

        The paginated results marker. When the result of a ListTopics operation is truncated, the call returns NextToken in the response. To get another batch of configurations, provide this token in your next request.

        
  
  **Exceptions**
  
  *   :py:class:`Kafka.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`Kafka.Client.exceptions.BadRequestException`

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

  
  *   :py:class:`Kafka.Client.exceptions.InternalServerErrorException`

  
  *   :py:class:`Kafka.Client.exceptions.ForbiddenException`

  