:doc:`SageMaker <../../sagemaker>` / Client / list_clusters

*************
list_clusters
*************



.. py:method:: SageMaker.Client.list_clusters(**kwargs)

  

  Retrieves the list of SageMaker HyperPod clusters.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListClusters>`_  


  **Request Syntax**
  ::

    response = client.list_clusters(
        CreationTimeAfter=datetime(2015, 1, 1),
        CreationTimeBefore=datetime(2015, 1, 1),
        MaxResults=123,
        NameContains='string',
        NextToken='string',
        SortBy='CREATION_TIME'|'NAME',
        SortOrder='Ascending'|'Descending',
        TrainingPlanArn='string'
    )
    
  :type CreationTimeAfter: datetime
  :param CreationTimeAfter: 

    Set a start time for the time range during which you want to list SageMaker HyperPod clusters. Timestamps are formatted according to the ISO 8601 standard.

     

    Acceptable formats include:

     

    
    * ``YYYY-MM-DDThh:mm:ss.sssTZD`` (UTC), for example, ``2014-10-01T20:30:00.000Z``
     
    * ``YYYY-MM-DDThh:mm:ss.sssTZD`` (with offset), for example, ``2014-10-01T12:30:00.000-08:00``
     
    * ``YYYY-MM-DD``, for example, ``2014-10-01``
     
    * Unix time in seconds, for example, ``1412195400``. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC.
    

     

    For more information about the timestamp format, see `Timestamp <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp>`__ in the *Amazon Web Services Command Line Interface User Guide*.

    

  
  :type CreationTimeBefore: datetime
  :param CreationTimeBefore: 

    Set an end time for the time range during which you want to list SageMaker HyperPod clusters. A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for ``CreationTimeAfter``. For more information about the timestamp format, see `Timestamp <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp>`__ in the *Amazon Web Services Command Line Interface User Guide*.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    Specifies the maximum number of clusters to evaluate for the operation (not necessarily the number of matching items). After SageMaker processes the number of clusters up to ``MaxResults``, it stops the operation and returns the matching clusters up to that point. If all the matching clusters are desired, SageMaker will go through all the clusters until ``NextToken`` is empty.

    

  
  :type NameContains: string
  :param NameContains: 

    Set the maximum number of instances to print in the list.

    

  
  :type NextToken: string
  :param NextToken: 

    Set the next token to retrieve the list of SageMaker HyperPod clusters.

    

  
  :type SortBy: string
  :param SortBy: 

    The field by which to sort results. The default value is ``CREATION_TIME``.

    

  
  :type SortOrder: string
  :param SortOrder: 

    The sort order for results. The default value is ``Ascending``.

    

  
  :type TrainingPlanArn: string
  :param TrainingPlanArn: 

    The Amazon Resource Name (ARN); of the training plan to filter clusters by. For more information about reserving GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see ``CreateTrainingPlan ``.

    

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

    
    ::

      {
          'NextToken': 'string',
          'ClusterSummaries': [
              {
                  'ClusterArn': 'string',
                  'ClusterName': 'string',
                  'CreationTime': datetime(2015, 1, 1),
                  'ClusterStatus': 'Creating'|'Deleting'|'Failed'|'InService'|'RollingBack'|'SystemUpdating'|'Updating',
                  'TrainingPlanArns': [
                      'string',
                  ]
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        If the result of the previous ``ListClusters`` request was truncated, the response includes a ``NextToken``. To retrieve the next set of clusters, use the token in the next request.

        
      

      - **ClusterSummaries** *(list) --* 

        The summaries of listed SageMaker HyperPod clusters.

        
        

        - *(dict) --* 

          Lists a summary of the properties of a SageMaker HyperPod cluster.

          
          

          - **ClusterArn** *(string) --* 

            The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster.

            
          

          - **ClusterName** *(string) --* 

            The name of the SageMaker HyperPod cluster.

            
          

          - **CreationTime** *(datetime) --* 

            The time when the SageMaker HyperPod cluster is created.

            
          

          - **ClusterStatus** *(string) --* 

            The status of the SageMaker HyperPod cluster.

            
          

          - **TrainingPlanArns** *(list) --* 

            A list of Amazon Resource Names (ARNs) of the training plans associated with this cluster.

             

            For more information about how to reserve GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see ``CreateTrainingPlan ``.

            
            

            - *(string) --* 
        
      
    
  