executeGremlinProfileQuery method

Future<ExecuteGremlinProfileQueryOutput> executeGremlinProfileQuery({
  1. required String gremlinQuery,
  2. int? chop,
  3. bool? indexOps,
  4. bool? results,
  5. String? serializer,
})

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 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 IAM action in that cluster.

Note that the neptune-db:QueryLanguage:Gremlin 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).

May throw BadRequestException. May throw CancelledByUserException. May throw ClientTimeoutException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw FailureByQueryException. May throw IllegalArgumentException. May throw InvalidArgumentException. May throw InvalidParameterException. May throw MalformedQueryException. May throw MemoryLimitExceededException. May throw MissingParameterException. May throw ParsingException. May throw PreconditionsFailedException. May throw QueryLimitExceededException. May throw QueryLimitException. May throw QueryTooLargeException. May throw TimeLimitExceededException. May throw TooManyRequestsException. May throw UnsupportedOperationException.

Parameter gremlinQuery : The Gremlin query string to profile.

Parameter 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.

Parameter 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.

Parameter 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.

Parameter 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 for more information.

Implementation

Future<ExecuteGremlinProfileQueryOutput> executeGremlinProfileQuery({
  required String gremlinQuery,
  int? chop,
  bool? indexOps,
  bool? results,
  String? serializer,
}) async {
  final $payload = <String, dynamic>{
    'gremlin': gremlinQuery,
    if (chop != null) 'profile.chop': chop,
    if (indexOps != null) 'profile.indexOps': indexOps,
    if (results != null) 'profile.results': results,
    if (serializer != null) 'profile.serializer': serializer,
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'POST',
    requestUri: '/gremlin/profile',
    exceptionFnMap: _exceptionFns,
  );
  return ExecuteGremlinProfileQueryOutput(
    output: await response.stream.toBytes(),
  );
}