:doc:`NeptuneData <../../neptunedata>` / Client / execute_gremlin_profile_query

*****************************
execute_gremlin_profile_query
*****************************



.. py:method:: NeptuneData.Client.execute_gremlin_profile_query(**kwargs)

  

  Executes a Gremlin Profile query, which runs a specified traversal, collects various metrics about the run, and produces a profile report as output. See `Gremlin profile API in Neptune <https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html>`__ for details.

   

  When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the `neptune-db\:ReadDataViaQuery <https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#readdataviaquery>`__ IAM action in that cluster.

   

  Note that the `neptune-db\:QueryLanguage\:Gremlin <https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys>`__ IAM condition key can be used in the policy document to restrict the use of Gremlin queries (see `Condition keys available in Neptune IAM data-access policy statements <https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html>`__).

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinProfileQuery>`_  


  **Request Syntax**
  ::

    response = client.execute_gremlin_profile_query(
        gremlinQuery='string',
        results=True|False,
        chop=123,
        serializer='string',
        indexOps=True|False
    )
    
  :type gremlinQuery: string
  :param gremlinQuery: **[REQUIRED]** 

    The Gremlin query string to profile.

    

  
  :type results: boolean
  :param results: 

    If this flag is set to ``TRUE``, the query results are gathered and displayed as part of the profile report. If ``FALSE``, only the result count is displayed.

    

  
  :type chop: integer
  :param chop: 

    If non-zero, causes the results string to be truncated at that number of characters. If set to zero, the string contains all the results.

    

  
  :type serializer: string
  :param serializer: 

    If non-null, the gathered results are returned in a serialized response message in the format specified by this parameter. See `Gremlin profile API in Neptune <https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html>`__ for more information.

    

  
  :type indexOps: boolean
  :param indexOps: 

    If this flag is set to ``TRUE``, the results include a detailed report of all index operations that took place during query execution and serialization.

    

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

    
    ::

      {
          'output': StreamingBody()
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **output** (:class:`.StreamingBody`) -- 

        A text blob containing the Gremlin Profile result. See `Gremlin profile API in Neptune <https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html>`__ for details.

        
  
  **Exceptions**
  
  *   :py:class:`NeptuneData.Client.exceptions.QueryTooLargeException`

  
  *   :py:class:`NeptuneData.Client.exceptions.BadRequestException`

  
  *   :py:class:`NeptuneData.Client.exceptions.QueryLimitExceededException`

  
  *   :py:class:`NeptuneData.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`NeptuneData.Client.exceptions.QueryLimitException`

  
  *   :py:class:`NeptuneData.Client.exceptions.ClientTimeoutException`

  
  *   :py:class:`NeptuneData.Client.exceptions.CancelledByUserException`

  
  *   :py:class:`NeptuneData.Client.exceptions.IllegalArgumentException`

  
  *   :py:class:`NeptuneData.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`NeptuneData.Client.exceptions.UnsupportedOperationException`

  
  *   :py:class:`NeptuneData.Client.exceptions.FailureByQueryException`

  
  *   :py:class:`NeptuneData.Client.exceptions.MemoryLimitExceededException`

  
  *   :py:class:`NeptuneData.Client.exceptions.PreconditionsFailedException`

  
  *   :py:class:`NeptuneData.Client.exceptions.MalformedQueryException`

  
  *   :py:class:`NeptuneData.Client.exceptions.ParsingException`

  
  *   :py:class:`NeptuneData.Client.exceptions.ConstraintViolationException`

  
  *   :py:class:`NeptuneData.Client.exceptions.TimeLimitExceededException`

  
  *   :py:class:`NeptuneData.Client.exceptions.InvalidArgumentException`

  
  *   :py:class:`NeptuneData.Client.exceptions.ConcurrentModificationException`

  
  *   :py:class:`NeptuneData.Client.exceptions.MissingParameterException`

  