Skip to content

get_harness async

get_harness(
    harness_id: HarnessId,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    harness_version: Optional[HarnessVersion] = None,
) -> GetHarnessResponse

Operation to get a single harness.

Parameters:

  • harness_id (HarnessId) –

    The ID of the harness to retrieve.

  • harness_version (Optional[HarnessVersion], default: None ) –

    Specific version of the harness to retrieve. If omitted, returns the current Harness configuration, including its status.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def get_harness(
    self,
    harness_id: "capo_bedrock_agentcore_control.types.harness_id.HarnessId",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    harness_version: Optional[
        "capo_bedrock_agentcore_control.types.harness_version.HarnessVersion"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.get_harness_response.GetHarnessResponse":
    """<p>Operation to get a single harness.</p>

    Args:
        harness_id: <p>The ID of the harness to retrieve.</p>
        harness_version: <p>Specific version of the harness to retrieve. If omitted, returns the current Harness configuration, including its status.</p>

    Raises:
        capo_bedrock_agentcore_control.errors.access_denied_exception.AccessDeniedException: <p>This exception is thrown when a request is denied per access permissions</p>
        capo_bedrock_agentcore_control.errors.internal_server_exception.InternalServerException: <p>This exception is thrown if there was an unexpected error during processing of request</p>
        capo_bedrock_agentcore_control.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource referenced by the operation does not exist</p>
        capo_bedrock_agentcore_control.errors.throttling_exception.ThrottlingException: <p>This exception is thrown when the number of requests exceeds the limit</p>
        capo_bedrock_agentcore_control.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_bedrock_agentcore_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore_control.types.get_harness_request.GetHarnessRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.get_harness_response.GetHarnessResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.get_harness

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.get_harness.async_get_harness(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_bedrock_agentcore_control.types.get_harness_response.GetHarnessResponse",
    ) -> dict[str, Any]:
        import capo_bedrock_agentcore_control.types.get_harness_response

        return capo_bedrock_agentcore_control.types.get_harness_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetHarness", redact_output=_redact_output),
    )
    input_: capo_bedrock_agentcore_control.types.get_harness_request.GetHarnessRequest = {
        "harness_id": harness_id
    }
    if harness_version is not None:
        input_["harness_version"] = harness_version

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