:doc:`CloudDirectory <../../clouddirectory>` / Client / list_directories

****************
list_directories
****************



.. py:method:: CloudDirectory.Client.list_directories(**kwargs)

  

  Lists directories created within an account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/clouddirectory-2017-01-11/ListDirectories>`_  


  **Request Syntax**
  ::

    response = client.list_directories(
        NextToken='string',
        MaxResults=123,
        state='ENABLED'|'DISABLED'|'DELETED'
    )
    
  :type NextToken: string
  :param NextToken: 

    The pagination token.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to retrieve.

    

  
  :type state: string
  :param state: 

    The state of the directories in the list. Can be either Enabled, Disabled, or Deleted.

    

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

    
    ::

      {
          'Directories': [
              {
                  'Name': 'string',
                  'DirectoryArn': 'string',
                  'State': 'ENABLED'|'DISABLED'|'DELETED',
                  'CreationDateTime': datetime(2015, 1, 1)
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Directories** *(list) --* 

        Lists all directories that are associated with your account in pagination fashion.

        
        

        - *(dict) --* 

          Directory structure that includes the directory name and directory ARN.

          
          

          - **Name** *(string) --* 

            The name of the directory.

            
          

          - **DirectoryArn** *(string) --* 

            The Amazon Resource Name (ARN) that is associated with the directory. For more information, see  arns.

            
          

          - **State** *(string) --* 

            The state of the directory. Can be either ``Enabled``, ``Disabled``, or ``Deleted``.

            
          

          - **CreationDateTime** *(datetime) --* 

            The date and time when the directory was created.

            
      
    
      

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

        The pagination token.

        
  
  **Exceptions**
  
  *   :py:class:`CloudDirectory.Client.exceptions.InternalServiceException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.InvalidArnException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.RetryableConflictException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.ValidationException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.LimitExceededException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CloudDirectory.Client.exceptions.InvalidNextTokenException`

  