:doc:`Pricing <../../pricing>` / Client / describe_services

*****************
describe_services
*****************



.. py:method:: Pricing.Client.describe_services(**kwargs)

  

  Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as ``AmazonEC2``, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 are ``volumeType``, ``maxIopsVolume``, ``operation``, ``locationType``, and ``instanceCapacity10xlarge``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices>`_  


  **Request Syntax**
  ::

    response = client.describe_services(
        ServiceCode='string',
        FormatVersion='string',
        NextToken='string',
        MaxResults=123
    )
    
  :type ServiceCode: string
  :param ServiceCode: 

    The code for the service whose information you want to retrieve, such as ``AmazonEC2``. You can use the ``ServiceCode`` to filter the results in a ``GetProducts`` call. To retrieve a list of all services, leave this blank.

    

  
  :type FormatVersion: string
  :param FormatVersion: 

    The format version that you want the response to be in.

     

    Valid values are: ``aws_v1``

    

  
  :type NextToken: string
  :param NextToken: 

    The pagination token that indicates the next set of results that you want to retrieve.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results that you want returned in the response.

    

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

    
    ::

      {
          'Services': [
              {
                  'ServiceCode': 'string',
                  'AttributeNames': [
                      'string',
                  ]
              },
          ],
          'FormatVersion': 'string',
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Services** *(list) --* 

        The service metadata for the service or services in the response.

        
        

        - *(dict) --* 

          The metadata for a service, such as the service code and available attribute names.

          
          

          - **ServiceCode** *(string) --* 

            The code for the Amazon Web Services service.

            
          

          - **AttributeNames** *(list) --* 

            The attributes that are available for this service.

            
            

            - *(string) --* 
        
      
    
      

      - **FormatVersion** *(string) --* 

        The format version of the response. For example, ``aws_v1``.

        
      

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

        The pagination token for the next set of retrievable results.

        
  
  **Exceptions**
  
  *   :py:class:`Pricing.Client.exceptions.InvalidParameterException`

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

  
  *   :py:class:`Pricing.Client.exceptions.NotFoundException`

  
  *   :py:class:`Pricing.Client.exceptions.InternalErrorException`

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

  
  *   :py:class:`Pricing.Client.exceptions.ExpiredNextTokenException`

  

  **Examples**

  Retrieves the service for the given Service Code.
  ::

    response = client.describe_services(
        FormatVersion='aws_v1',
        MaxResults=1,
        ServiceCode='AmazonEC2',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'FormatVersion': 'aws_v1',
        'NextToken': 'abcdefg123',
        'Services': [
            {
                'AttributeNames': [
                    'volumeType',
                    'maxIopsvolume',
                    'instanceCapacity10xlarge',
                    'locationType',
                    'operation',
                ],
                'ServiceCode': 'AmazonEC2',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  