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

*************
list_commands
*************



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

  

  List all commands in your account.

  

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


  **Request Syntax**
  ::

    response = client.list_commands(
        maxResults=123,
        nextToken='string',
        namespace='AWS-IoT'|'AWS-IoT-FleetWise',
        commandParameterName='string',
        sortOrder='ASCENDING'|'DESCENDING'
    )
    
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return in this operation. By default, the API returns up to a maximum of 25 results. You can override this default value to return up to a maximum of 100 results for this operation.

    

  
  :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 namespace: string
  :param namespace: 

    The namespace of the command. By default, the API returns all commands that have been created for both ``AWS-IoT`` and ``AWS-IoT-FleetWise`` namespaces. You can override this default value if you want to return all commands that have been created only for a specific namespace.

    

  
  :type commandParameterName: string
  :param commandParameterName: 

    A filter that can be used to display the list of commands that have a specific command parameter name.

    

  
  :type sortOrder: string
  :param sortOrder: 

    Specify whether to list the commands that you have created in the ascending or descending order. By default, the API returns all commands in the descending order based on the time that they were created.

    

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

    
    ::

      {
          'commands': [
              {
                  'commandArn': 'string',
                  'commandId': 'string',
                  'displayName': 'string',
                  'deprecated': True|False,
                  'createdAt': datetime(2015, 1, 1),
                  'lastUpdatedAt': datetime(2015, 1, 1),
                  'pendingDeletion': True|False
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **commands** *(list) --* 

        The list of commands.

        
        

        - *(dict) --* 

          Summary information about a particular command resource.

          
          

          - **commandArn** *(string) --* 

            The Amazon Resource Name (ARN) of the command.

            
          

          - **commandId** *(string) --* 

            The unique identifier of the command.

            
          

          - **displayName** *(string) --* 

            The display name of the command.

            
          

          - **deprecated** *(boolean) --* 

            Indicates whether the command has been deprecated.

            
          

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

            The timestamp, when the command was created.

            
          

          - **lastUpdatedAt** *(datetime) --* 

            The timestamp, when the command was last updated.

            
          

          - **pendingDeletion** *(boolean) --* 

            Indicates whether the command is pending deletion.

            
      
    
      

      - **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.ValidationException`

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

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

  