:doc:`CloudHSMV2 <../../cloudhsmv2>` / Client / list_tags

*********
list_tags
*********



.. py:method:: CloudHSMV2.Client.list_tags(**kwargs)

  

  Gets a list of tags for the specified CloudHSM cluster.

   

  This is a paginated operation, which means that each response might contain only a subset of all the tags. When the response contains only a subset of tags, it includes a ``NextToken`` value. Use this value in a subsequent ``ListTags`` request to get more tags. When you receive a response with no ``NextToken`` (or an empty or null value), that means there are no more tags to get.

   

  **Cross-account use:** No. You cannot perform this operation on an CloudHSM resource in a different Amazon Web Services account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/ListTags>`_  


  **Request Syntax**
  ::

    response = client.list_tags(
        ResourceId='string',
        NextToken='string',
        MaxResults=123
    )
    
  :type ResourceId: string
  :param ResourceId: **[REQUIRED]** 

    The cluster identifier (ID) for the cluster whose tags you are getting. To find the cluster ID, use  DescribeClusters.

    

  
  :type NextToken: string
  :param NextToken: 

    The ``NextToken`` value that you received in the previous response. Use this value to get more tags.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of tags to return in the response. When there are more tags than the number you specify, the response contains a ``NextToken`` value.

    

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

    
    ::

      {
          'TagList': [
              {
                  'Key': 'string',
                  'Value': 'string'
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TagList** *(list) --* 

        A list of tags.

        
        

        - *(dict) --* 

          Contains a tag. A tag is a key-value pair.

          
          

          - **Key** *(string) --* 

            The key of the tag.

            
          

          - **Value** *(string) --* 

            The value of the tag.

            
      
    
      

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

        An opaque string that indicates that the response contains only a subset of tags. Use this value in a subsequent ``ListTags`` request to get more tags.

        
  
  **Exceptions**
  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmAccessDeniedException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmInternalFailureException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmInvalidRequestException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmResourceNotFoundException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmServiceException`

  
  *   :py:class:`CloudHSMV2.Client.exceptions.CloudHsmTagException`

  