describeModelPackage method
- required String modelPackageName,
- IncludedData? includedData,
Returns a description of the specified model package, which is used to create SageMaker models or list them on Amazon Web Services Marketplace. To create models in SageMaker, buyers can subscribe to model packages listed on Amazon Web Services Marketplace.
Parameter modelPackageName :
The name or Amazon Resource Name (ARN) of the model package to describe.
When you specify a name, the name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).
Parameter includedData :
Specifies the level of model package data to include in the response. Use
this parameter to call DescribeModelPackage on a model
package that has an associated model card without requiring
kms:Decrypt permission on the customer-managed KMS key
associated with the embedded model card.
-
AllData: Returns the full model package response, including the unredactedModelCard.ModelCardContent. This option requireskms:Decryptpermission on the customer-managed key, if one is associated with the embedded model card. This is the default. -
MetadataOnly: Returns the full model package response, but with the embeddedModelCard.ModelCardContentsanitized to include only a small set of unencrypted metadata fields. This option does not requirekms:Decryptpermission. All other top-level response fields, includingInferenceSpecification,ModelMetrics,DriftCheckBaselines, andSecurityConfig, are returned unchanged. For the list of fields preserved withinModelCardContent, see ModelCard.
AllData.
Implementation
Future<DescribeModelPackageOutput> describeModelPackage({
required String modelPackageName,
IncludedData? includedData,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.DescribeModelPackage'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ModelPackageName': modelPackageName,
if (includedData != null) 'IncludedData': includedData.value,
},
);
return DescribeModelPackageOutput.fromJson(jsonResponse.body);
}