Skip to content

create_harness_endpoint

create_harness_endpoint(
    harness_id: HarnessId,
    endpoint_name: HarnessEndpointName,
    *,
    config_overrides: Optional[BedrockAgentCoreControlClientConfig] = None,
    target_version: Optional[HarnessVersion] = None,
    description: Optional[HarnessEndpointDescription] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
) -> CreateHarnessEndpointResponse

Operation to create a harness endpoint.

Parameters:

  • harness_id (HarnessId) –

    The ID of the harness to create an endpoint for.

  • endpoint_name (HarnessEndpointName) –

    The name of the endpoint. Must start with a letter and contain only alphanumeric characters and underscores.

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

    The harness version that the endpoint points to and serves invocations from.

  • description (Optional[HarnessEndpointDescription], default: None ) –

    A description of the endpoint.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure idempotency of the request.

  • tags (Optional[TagsMap], default: None ) –

    Tags to apply to the endpoint resource.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/bedrock_agent_core_control.py
def create_harness_endpoint(
    self,
    harness_id: "capo_bedrock_agentcore_control.types.harness_id.HarnessId",
    endpoint_name: "capo_bedrock_agentcore_control.types.harness_endpoint_name.HarnessEndpointName",
    *,
    config_overrides: Optional[BedrockAgentCoreControlClientConfig] = None,
    target_version: Optional[
        "capo_bedrock_agentcore_control.types.harness_version.HarnessVersion"
    ] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.harness_endpoint_description.HarnessEndpointDescription"
    ] = None,
    client_token: Optional[
        "capo_bedrock_agentcore_control.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_bedrock_agentcore_control.types.tags_map.TagsMap"] = None,
) -> "capo_bedrock_agentcore_control.types.create_harness_endpoint_response.CreateHarnessEndpointResponse":
    """<p>Operation to create a harness endpoint.</p>

    Args:
        harness_id: <p>The ID of the harness to create an endpoint for.</p>
        endpoint_name: <p>The name of the endpoint. Must start with a letter and contain only alphanumeric characters and underscores.</p>
        target_version: <p>The harness version that the endpoint points to and serves invocations from.</p>
        description: <p>A description of the endpoint.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
        tags: <p>Tags to apply to the endpoint resource.</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.conflict_exception.ConflictException: <p>This exception is thrown when there is a conflict performing an operation</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This exception is thrown when a request is made beyond the service quota</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.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock_agentcore_control.types.create_harness_endpoint_request.CreateHarnessEndpointRequest]",
    ) -> OperationResponse[
        "capo_bedrock_agentcore_control.types.create_harness_endpoint_response.CreateHarnessEndpointResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_harness_endpoint

        output, http_response = (
            capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_harness_endpoint.create_harness_endpoint(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateHarnessEndpoint")
    )
    input_: capo_bedrock_agentcore_control.types.create_harness_endpoint_request.CreateHarnessEndpointRequest = {
        "harness_id": harness_id,
        "endpoint_name": endpoint_name,
    }
    if target_version is not None:
        input_["target_version"] = target_version
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output