createEdgePackagingJob method

Future<void> createEdgePackagingJob({
  1. required String compilationJobName,
  2. required String edgePackagingJobName,
  3. required String modelName,
  4. required String modelVersion,
  5. required EdgeOutputConfig outputConfig,
  6. required String roleArn,
  7. String? resourceKey,
  8. List<Tag>? tags,
})

Starts a SageMaker Edge Manager model packaging job. Edge Manager will use the model artifacts from the Amazon Simple Storage Service bucket that you specify. After the model has been packaged, Amazon SageMaker saves the resulting artifacts to an S3 bucket that you specify.

May throw ResourceLimitExceeded.

Parameter compilationJobName : The name of the SageMaker Neo compilation job that will be used to locate model artifacts for packaging.

Parameter edgePackagingJobName : The name of the edge packaging job.

Parameter modelName : The name of the model.

Parameter modelVersion : The version of the model.

Parameter outputConfig : Provides information about the output location for the packaged model.

Parameter roleArn : The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to download and upload the model, and to contact SageMaker Neo.

Parameter resourceKey : The CMK to use when encrypting the EBS volume the edge packaging job runs on.

Parameter tags : Creates tags for the packaging job.

Implementation

Future<void> createEdgePackagingJob({
  required String compilationJobName,
  required String edgePackagingJobName,
  required String modelName,
  required String modelVersion,
  required EdgeOutputConfig outputConfig,
  required String roleArn,
  String? resourceKey,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(compilationJobName, 'compilationJobName');
  _s.validateStringLength(
    'compilationJobName',
    compilationJobName,
    1,
    63,
    isRequired: true,
  );
  ArgumentError.checkNotNull(edgePackagingJobName, 'edgePackagingJobName');
  _s.validateStringLength(
    'edgePackagingJobName',
    edgePackagingJobName,
    1,
    63,
    isRequired: true,
  );
  ArgumentError.checkNotNull(modelName, 'modelName');
  _s.validateStringLength(
    'modelName',
    modelName,
    1,
    63,
    isRequired: true,
  );
  ArgumentError.checkNotNull(modelVersion, 'modelVersion');
  _s.validateStringLength(
    'modelVersion',
    modelVersion,
    1,
    30,
    isRequired: true,
  );
  ArgumentError.checkNotNull(outputConfig, 'outputConfig');
  ArgumentError.checkNotNull(roleArn, 'roleArn');
  _s.validateStringLength(
    'roleArn',
    roleArn,
    20,
    2048,
    isRequired: true,
  );
  _s.validateStringLength(
    'resourceKey',
    resourceKey,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateEdgePackagingJob'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CompilationJobName': compilationJobName,
      'EdgePackagingJobName': edgePackagingJobName,
      'ModelName': modelName,
      'ModelVersion': modelVersion,
      'OutputConfig': outputConfig,
      'RoleArn': roleArn,
      if (resourceKey != null) 'ResourceKey': resourceKey,
      if (tags != null) 'Tags': tags,
    },
  );
}