createImage method
Creates a custom SageMaker AI image. A SageMaker AI image is a set of image versions. Each image version represents a container image stored in Amazon ECR. For more information, see Bring your own SageMaker AI image.
May throw ResourceInUse.
May throw ResourceLimitExceeded.
Parameter imageName :
The name of the image. Must be unique to your account.
Parameter roleArn :
The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks
on your behalf.
Parameter description :
The description of the image.
Parameter displayName :
The display name of the image. If not provided, ImageName is
displayed.
Parameter tags :
A list of tags to apply to the image.
Implementation
Future<CreateImageResponse> createImage({
required String imageName,
required String roleArn,
String? description,
String? displayName,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.CreateImage'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ImageName': imageName,
'RoleArn': roleArn,
if (description != null) 'Description': description,
if (displayName != null) 'DisplayName': displayName,
if (tags != null) 'Tags': tags,
},
);
return CreateImageResponse.fromJson(jsonResponse.body);
}