Skip to content

create_marketplace_model_endpoint async

create_marketplace_model_endpoint(
    model_source_identifier: ModelSourceIdentifier,
    endpoint_config: EndpointConfig,
    endpoint_name: EndpointName,
    *,
    config_overrides: Optional[AsyncBedrockClientConfig] = None,
    accept_eula: Optional[AcceptEula] = None,
    client_request_token: Optional[IdempotencyToken] = None,
    tags: Optional[TagList] = None,
) -> CreateMarketplaceModelEndpointResponse

Creates an endpoint for a model from Amazon Bedrock Marketplace. The endpoint is hosted by Amazon SageMaker.

Parameters:

  • model_source_identifier (ModelSourceIdentifier) –

    The ARN of the model from Amazon Bedrock Marketplace that you want to deploy to the endpoint.

  • endpoint_config (EndpointConfig) –

    The configuration for the endpoint, including the number and type of instances to use.

  • accept_eula (Optional[AcceptEula], default: None ) –

    Indicates whether you accept the end-user license agreement (EULA) for the model. Set to true to accept the EULA.

  • endpoint_name (EndpointName) –

    The name of the endpoint. This name must be unique within your Amazon Web Services account and region.

  • client_request_token (Optional[IdempotencyToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token is listed as not required because Amazon Web Services SDKs automatically generate it for you and set this parameter. If you're not using the Amazon Web Services SDK or the CLI, you must provide this token or the action will fail.

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

    An array of key-value pairs to apply to the underlying Amazon SageMaker endpoint. You can use these tags to organize and identify your Amazon Web Services resources.

Raises:

Source code in docs_src/capo_bedrock/_services/async_bedrock.py
async def create_marketplace_model_endpoint(
    self,
    model_source_identifier: "capo_bedrock.types.model_source_identifier.ModelSourceIdentifier",
    endpoint_config: "capo_bedrock.types.endpoint_config.EndpointConfig",
    endpoint_name: "capo_bedrock.types.endpoint_name.EndpointName",
    *,
    config_overrides: Optional[AsyncBedrockClientConfig] = None,
    accept_eula: Optional["capo_bedrock.types.accept_eula.AcceptEula"] = None,
    client_request_token: Optional[
        "capo_bedrock.types.idempotency_token.IdempotencyToken"
    ] = None,
    tags: Optional["capo_bedrock.types.tag_list.TagList"] = None,
) -> "capo_bedrock.types.create_marketplace_model_endpoint_response.CreateMarketplaceModelEndpointResponse":
    """<p>Creates an endpoint for a model from Amazon Bedrock Marketplace. The endpoint is hosted by Amazon SageMaker.</p>

    Args:
        model_source_identifier: <p>The ARN of the model from Amazon Bedrock Marketplace that you want to deploy to the endpoint.</p>
        endpoint_config: <p>The configuration for the endpoint, including the number and type of instances to use.</p>
        accept_eula: <p>Indicates whether you accept the end-user license agreement (EULA) for the model. Set to <code>true</code> to accept the EULA.</p>
        endpoint_name: <p>The name of the endpoint. This name must be unique within your Amazon Web Services account and region.</p>
        client_request_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token is listed as not required because Amazon Web Services SDKs automatically generate it for you and set this parameter. If you're not using the Amazon Web Services SDK or the CLI, you must provide this token or the action will fail.</p>
        tags: <p>An array of key-value pairs to apply to the underlying Amazon SageMaker endpoint. You can use these tags to organize and identify your Amazon Web Services resources.</p>

    Raises:
        capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock.errors.conflict_exception.ConflictException: <p>Error occurred because of a conflict while performing an operation.</p>
        capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_bedrock.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
        capo_bedrock.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
        capo_bedrock.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_bedrock.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
        capo_bedrock.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock.types.create_marketplace_model_endpoint_request.CreateMarketplaceModelEndpointRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock.types.create_marketplace_model_endpoint_response.CreateMarketplaceModelEndpointResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.create_marketplace_model_endpoint

        (
            output,
            http_response,
        ) = await capo_bedrock._operations.amazon_bedrock_control_plane_service.create_marketplace_model_endpoint.async_create_marketplace_model_endpoint(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMarketplaceModelEndpoint")
    )
    input_: capo_bedrock.types.create_marketplace_model_endpoint_request.CreateMarketplaceModelEndpointRequest = {
        "model_source_identifier": model_source_identifier,
        "endpoint_config": endpoint_config,
        "endpoint_name": endpoint_name,
    }
    if accept_eula is not None:
        input_["accept_eula"] = accept_eula
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if tags is not None:
        input_["tags"] = tags

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