Skip to content

execute_query async

execute_query(
    workspace_id: Id,
    query_statement: QueryStatement,
    *,
    config_overrides: Optional[AsyncIoTTwinMakerClientConfig] = None,
    max_results: Optional[QueryServiceMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ExecuteQueryResponse

Run queries to access information from your knowledge graph of entities within individual workspaces.

The ExecuteQuery action only works with Amazon Web Services Java SDK2. ExecuteQuery will not work with any Amazon Web Services Java SDK version < 2.x.

Parameters:

  • workspace_id (Id) –

    The ID of the workspace.

  • query_statement (QueryStatement) –

    The query statement.

  • max_results (Optional[QueryServiceMaxResults], default: None ) –

    The maximum number of results to return at one time. The default is 50.

  • next_token (Optional[NextToken], default: None ) –

    The string that specifies the next page of results.

Raises:

Source code in docs_src/capo_iottwinmaker/_services/async_io_t_twin_maker.py
async def execute_query(
    self,
    workspace_id: "capo_iottwinmaker.types.id.Id",
    query_statement: "capo_iottwinmaker.types.query_statement.QueryStatement",
    *,
    config_overrides: Optional[AsyncIoTTwinMakerClientConfig] = None,
    max_results: Optional[
        "capo_iottwinmaker.types.query_service_max_results.QueryServiceMaxResults"
    ] = None,
    next_token: Optional["capo_iottwinmaker.types.next_token.NextToken"] = None,
) -> "capo_iottwinmaker.types.execute_query_response.ExecuteQueryResponse":
    """<p>Run queries to access information from your knowledge graph of entities within individual workspaces.</p> <note> <p>The ExecuteQuery action only works with <a href="https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html">Amazon Web Services Java SDK2</a>. ExecuteQuery will not work with any Amazon Web Services Java SDK version &lt; 2.x.</p> </note>

    Args:
        workspace_id: <p>The ID of the workspace.</p>
        query_statement: <p>The query statement.</p>
        max_results: <p>The maximum number of results to return at one time. The default is 50.</p>
        next_token: <p>The string that specifies the next page of results.</p>

    Raises:
        capo_iottwinmaker.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_iottwinmaker.errors.internal_server_exception.InternalServerException: <p>An unexpected error has occurred.</p>
        capo_iottwinmaker.errors.query_timeout_exception.QueryTimeoutException: <p>The query timeout exception.</p>
        capo_iottwinmaker.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota was exceeded.</p>
        capo_iottwinmaker.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iottwinmaker.errors.validation_exception.ValidationException: <p>Failed</p>
        capo_iottwinmaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iottwinmaker.types.execute_query_request.ExecuteQueryRequest]",
    ) -> AsyncOperationResponse[
        "capo_iottwinmaker.types.execute_query_response.ExecuteQueryResponse"
    ]:
        import capo_iottwinmaker._operations.aws_io_t_twin_maker.execute_query

        (
            output,
            http_response,
        ) = await capo_iottwinmaker._operations.aws_io_t_twin_maker.execute_query.async_execute_query(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ExecuteQuery")
    )
    input_: capo_iottwinmaker.types.execute_query_request.ExecuteQueryRequest = {
        "workspace_id": workspace_id,
        "query_statement": query_statement,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output