SageMaker / Client / describe_model_card

describe_model_card

SageMaker.Client.describe_model_card(**kwargs)

Describes the content, creation time, and security configuration of an Amazon SageMaker Model Card.

Warning

To retrieve only metadata about a model card without requiring kms:Decrypt permission on the associated customer-managed Amazon Web Services KMS key, set IncludedData to MetadataOnly. The default is AllData, which returns the full model card Content and requires kms:Decrypt permission when a customer-managed key is configured.

See also: AWS API Documentation

Request Syntax

response = client.describe_model_card(
    ModelCardName='string',
    ModelCardVersion=123,
    IncludedData='AllData'|'MetadataOnly'
)
Parameters:
  • ModelCardName (string) –

    [REQUIRED]

    The name or Amazon Resource Name (ARN) of the model card to describe.

  • ModelCardVersion (integer) – The version of the model card to describe. If a version is not provided, then the latest version of the model card is described.

  • IncludedData (string) –

    Specifies the level of model card data to include in the response. Use this parameter to call DescribeModelCard without requiring kms:Decrypt permission on the customer-managed Amazon Web Services KMS key.

    • AllData: Returns the full model card Content. This option requires kms:Decrypt permission on the customer-managed key, if one is associated with the model card. This is the default.

    • MetadataOnly: Returns the model card with sanitized Content that includes only a small set of unencrypted metadata fields. This option does not require kms:Decrypt permission. For the list of fields preserved in the response, see Content.

    If you don’t specify a value, SageMaker returns AllData.

Return type:

dict

Returns:

Response Syntax

{
    'ModelCardArn': 'string',
    'ModelCardName': 'string',
    'ModelCardVersion': 123,
    'Content': 'string',
    'ModelCardStatus': 'Draft'|'PendingReview'|'Approved'|'Archived',
    'SecurityConfig': {
        'KmsKeyId': 'string'
    },
    'CreationTime': datetime(2015, 1, 1),
    'CreatedBy': {
        'UserProfileArn': 'string',
        'UserProfileName': 'string',
        'DomainId': 'string',
        'IamIdentity': {
            'Arn': 'string',
            'PrincipalId': 'string',
            'SourceIdentity': 'string'
        }
    },
    'LastModifiedTime': datetime(2015, 1, 1),
    'LastModifiedBy': {
        'UserProfileArn': 'string',
        'UserProfileName': 'string',
        'DomainId': 'string',
        'IamIdentity': {
            'Arn': 'string',
            'PrincipalId': 'string',
            'SourceIdentity': 'string'
        }
    },
    'ModelCardProcessingStatus': 'DeleteInProgress'|'DeletePending'|'ContentDeleted'|'ExportJobsDeleted'|'DeleteCompleted'|'DeleteFailed'
}

Response Structure

  • (dict) –

    • ModelCardArn (string) –

      The Amazon Resource Name (ARN) of the model card.

    • ModelCardName (string) –

      The name of the model card.

    • ModelCardVersion (integer) –

      The version of the model card.

    • Content (string) –

      The content of the model card. Content is provided as a string in the model card JSON schema.

      When you set IncludedData to MetadataOnly in the request, SageMaker returns a sanitized version of Content that includes only the following JSON paths, when present in the model card:

      • model_overview.model_id

      • model_overview.model_name

      • intended_uses.risk_rating

      • model_package_details.model_package_group_name

      • model_package_details.model_package_arn

      All other fields are removed from Content when IncludedData is MetadataOnly, including model description, training details, evaluation details, business details, and additional information. To retrieve the complete Content, set IncludedData to AllData or omit the parameter.

    • ModelCardStatus (string) –

      The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.

      • Draft: The model card is a work in progress.

      • PendingReview: The model card is pending review.

      • Approved: The model card is approved.

      • Archived: The model card is archived. No more updates should be made to the model card, but it can still be exported.

    • SecurityConfig (dict) –

      The security configuration used to protect model card content.

      • KmsKeyId (string) –

        A Key Management Service key ID to use for encrypting a model card.

    • CreationTime (datetime) –

      The date and time the model card was created.

    • CreatedBy (dict) –

      Information about the user who created or modified a SageMaker resource.

      • UserProfileArn (string) –

        The Amazon Resource Name (ARN) of the user’s profile.

      • UserProfileName (string) –

        The name of the user’s profile.

      • DomainId (string) –

        The domain associated with the user.

      • IamIdentity (dict) –

        The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.

        • Arn (string) –

          The Amazon Resource Name (ARN) of the IAM identity.

        • PrincipalId (string) –

          The ID of the principal that assumes the IAM identity.

        • SourceIdentity (string) –

          The person or application which assumes the IAM identity.

    • LastModifiedTime (datetime) –

      The date and time the model card was last modified.

    • LastModifiedBy (dict) –

      Information about the user who created or modified a SageMaker resource.

      • UserProfileArn (string) –

        The Amazon Resource Name (ARN) of the user’s profile.

      • UserProfileName (string) –

        The name of the user’s profile.

      • DomainId (string) –

        The domain associated with the user.

      • IamIdentity (dict) –

        The IAM Identity details associated with the user. These details are associated with model package groups, model packages, and project entities only.

        • Arn (string) –

          The Amazon Resource Name (ARN) of the IAM identity.

        • PrincipalId (string) –

          The ID of the principal that assumes the IAM identity.

        • SourceIdentity (string) –

          The person or application which assumes the IAM identity.

    • ModelCardProcessingStatus (string) –

      The processing status of model card deletion. The ModelCardProcessingStatus updates throughout the different deletion steps.

      • DeletePending: Model card deletion request received.

      • DeleteInProgress: Model card deletion is in progress.

      • ContentDeleted: Deleted model card content.

      • ExportJobsDeleted: Deleted all export jobs associated with the model card.

      • DeleteCompleted: Successfully deleted the model card.

      • DeleteFailed: The model card failed to delete.

Exceptions

  • SageMaker.Client.exceptions.ResourceNotFound