createMarketplaceModelEndpoint method
Creates an endpoint for a model from Amazon Bedrock Marketplace. The endpoint is hosted by Amazon SageMaker.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter endpointConfig :
The configuration for the endpoint, including the number and type of
instances to use.
Parameter endpointName :
The name of the endpoint. This name must be unique within your Amazon Web
Services account and region.
Parameter modelSourceIdentifier :
The ARN of the model from Amazon Bedrock Marketplace that you want to
deploy to the endpoint.
Parameter acceptEula :
Indicates whether you accept the end-user license agreement (EULA) for the
model. Set to true to accept the EULA.
Parameter clientRequestToken :
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.
Parameter tags :
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.
Implementation
Future<CreateMarketplaceModelEndpointResponse>
createMarketplaceModelEndpoint({
required EndpointConfig endpointConfig,
required String endpointName,
required String modelSourceIdentifier,
bool? acceptEula,
String? clientRequestToken,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'endpointConfig': endpointConfig,
'endpointName': endpointName,
'modelSourceIdentifier': modelSourceIdentifier,
if (acceptEula != null) 'acceptEula': acceptEula,
'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/marketplace-model/endpoints',
exceptionFnMap: _exceptionFns,
);
return CreateMarketplaceModelEndpointResponse.fromJson(response);
}