sagemaker.core.resources

Contents

sagemaker.core.resources#

Classes

Action(*, action_name[, action_arn, source, ...])

Class representing resource Action

ActionInternal(*, action_name, source, ...)

Class representing resource ActionInternal

Algorithm(*, algorithm_name[, ...])

Class representing resource Algorithm

App(*, domain_id, app_type, app_name[, ...])

Class representing resource App

AppImageConfig(*, app_image_config_name[, ...])

Class representing resource AppImageConfig

Artifact(*, artifact_arn[, artifact_name, ...])

Class representing resource Artifact

ArtifactInternal(*, source, artifact_type, ...)

Class representing resource ArtifactInternal

Association(*[, source_arn, ...])

Class representing resource Association

AutoMLJob(*, auto_ml_job_name[, ...])

Class representing resource AutoMLJob

AutoMLJobV2(*, auto_ml_job_name[, ...])

Class representing resource AutoMLJobV2

AutoMLTask(*, auto_ml_task_arn[, ...])

Class representing resource AutoMLTask

Base()

CapacitySchedule(*[, capacity_schedule_arn, ...])

Class representing resource CapacitySchedule

Cluster(*, cluster_name[, cluster_arn, ...])

Class representing resource Cluster

ClusterHealthCheck()

Class representing resource ClusterHealthCheck

ClusterNode()

Class representing resource ClusterNode

ClusterSchedulerConfig(*, ...[, ...])

Class representing resource ClusterSchedulerConfig

CodeRepository(*, code_repository_name[, ...])

Class representing resource CodeRepository

CompilationJob(*, compilation_job_name[, ...])

Class representing resource CompilationJob

ComputeQuota(*, compute_quota_id[, ...])

Class representing resource ComputeQuota

Context(*, context_name[, context_arn, ...])

Class representing resource Context

ContextInternal(*, context_name, source, ...)

Class representing resource ContextInternal

CrossAccountTrainingJob(*, ...[, ...])

Class representing resource CrossAccountTrainingJob

CustomMonitoringJobDefinition(*, ...[, ...])

Class representing resource CustomMonitoringJobDefinition

DataQualityJobDefinition(*, job_definition_name)

Class representing resource DataQualityJobDefinition

Device(*, device_name, device_fleet_name[, ...])

Class representing resource Device

DeviceFleet(*, device_fleet_name[, ...])

Class representing resource DeviceFleet

Domain(*, domain_id[, domain_arn, ...])

Class representing resource Domain

EdgeDeploymentPlan(*, edge_deployment_plan_name)

Class representing resource EdgeDeploymentPlan

EdgePackagingJob(*, edge_packaging_job_name)

Class representing resource EdgePackagingJob

Endpoint(*, endpoint_name[, endpoint_arn, ...])

Class representing resource Endpoint

EndpointConfig(*, endpoint_config_name[, ...])

Class representing resource EndpointConfig

Experiment(*, experiment_name[, ...])

Class representing resource Experiment

ExperimentInternal(*, experiment_name, ...)

Class representing resource ExperimentInternal

FeatureGroup(*, feature_group_name[, ...])

Class representing resource FeatureGroup

FeatureGroupInternal(*, feature_group_name, ...)

Class representing resource FeatureGroupInternal

FeatureMetadata(*, feature_group_name, ...)

Class representing resource FeatureMetadata

FlowDefinition(*, flow_definition_name[, ...])

Class representing resource FlowDefinition

GroundTruthJob(*, ground_truth_job_name[, ...])

Class representing resource GroundTruthJob

GroundTruthProject(*, ground_truth_project_name)

Class representing resource GroundTruthProject

GroundTruthWorkflow(*, ...[, ...])

Class representing resource GroundTruthWorkflow

Hub(*, hub_name[, hub_arn, ...])

Class representing resource Hub

HubContent(*[, hub_name, hub_content_arn, ...])

Class representing resource HubContent

HubContentPresignedUrls(*, hub_name, ...[, ...])

Class representing resource HubContentPresignedUrls

HubContentReference(*, hub_name, ...[, ...])

Class representing resource HubContentReference

HumanTaskUi(*, human_task_ui_name[, ...])

Class representing resource HumanTaskUi

HyperParameterTuningJob(*, ...[, ...])

Class representing resource HyperParameterTuningJob

HyperParameterTuningJobInternal(*, ...[, ...])

Class representing resource HyperParameterTuningJobInternal

Image(*, image_name[, creation_time, ...])

Class representing resource Image

ImageVersion(*, image_name[, base_image, ...])

Class representing resource ImageVersion

InferenceComponent(*, inference_component_name)

Class representing resource InferenceComponent

InferenceExperiment(*, name[, arn, type, ...])

Class representing resource InferenceExperiment

InferenceRecommendationsJob(*, job_name[, ...])

Class representing resource InferenceRecommendationsJob

LabelingJob(*, labeling_job_name[, ...])

Class representing resource LabelingJob

LineageGroup(*, lineage_group_name[, ...])

Class representing resource LineageGroup

LineageGroupInternal(*, lineage_group_name, ...)

Class representing resource LineageGroupInternal

MlflowApp(*, arn[, name, ...])

Class representing resource MlflowApp

MlflowTrackingServer(*, tracking_server_name)

Class representing resource MlflowTrackingServer

Model(*, model_name[, primary_container, ...])

Class representing resource Model

ModelBiasJobDefinition(*, job_definition_name)

Class representing resource ModelBiasJobDefinition

ModelCard(*, model_card_name[, ...])

Class representing resource ModelCard

ModelCardExportJob(*, model_card_export_job_arn)

Class representing resource ModelCardExportJob

ModelExplainabilityJobDefinition(*, ...[, ...])

Class representing resource ModelExplainabilityJobDefinition

ModelPackage(*[, model_package_name, ...])

Class representing resource ModelPackage

ModelPackageGroup(*, model_package_group_name)

Class representing resource ModelPackageGroup

ModelQualityJobDefinition(*, job_definition_name)

Class representing resource ModelQualityJobDefinition

MonitoringAlert(*, monitoring_alert_name, ...)

Class representing resource MonitoringAlert

MonitoringExecution(*, monitoring_execution_id)

Class representing resource MonitoringExecution

MonitoringSchedule(*, monitoring_schedule_name)

Class representing resource MonitoringSchedule

NotebookInstance(*, notebook_instance_name)

Class representing resource NotebookInstance

NotebookInstanceLifecycleConfig(*, ...[, ...])

Class representing resource NotebookInstanceLifecycleConfig

OptimizationJob(*, optimization_job_name[, ...])

Class representing resource OptimizationJob

PartnerApp(*, arn[, name, type, status, ...])

Class representing resource PartnerApp

PartnerAppPresignedUrl(*, arn[, ...])

Class representing resource PartnerAppPresignedUrl

PersistentVolume(*, persistent_volume_name, ...)

Class representing resource PersistentVolume

Pipeline(*, pipeline_name[, pipeline_arn, ...])

Class representing resource Pipeline

PipelineExecution(*, pipeline_execution_arn)

Class representing resource PipelineExecution

PresignedDomainUrl(*, domain_id, ...[, ...])

Class representing resource PresignedDomainUrl

PresignedDomainUrlWithPrincipalTag(*[, ...])

Class representing resource PresignedDomainUrlWithPrincipalTag

PresignedMlflowAppUrl(*, arn[, ...])

Class representing resource PresignedMlflowAppUrl

PresignedMlflowTrackingServerUrl(*, ...[, ...])

Class representing resource PresignedMlflowTrackingServerUrl

PresignedNotebookInstanceUrl(*, ...[, ...])

Class representing resource PresignedNotebookInstanceUrl

ProcessingJob(*, processing_job_name[, ...])

Class representing resource ProcessingJob

Project(*, project_name[, project_arn, ...])

Class representing resource Project

QuotaAllocation(*, quota_allocation_arn[, ...])

Class representing resource QuotaAllocation

ResourceCatalog(*, resource_catalog_arn, ...)

Class representing resource ResourceCatalog

SagemakerServicecatalogPortfolio()

Class representing resource SagemakerServicecatalogPortfolio

SharedModel(*, shared_model_id, ...[, ...])

Class representing resource SharedModel

SharedModelReviewers()

Class representing resource SharedModelReviewers

Space(*, domain_id, space_name[, space_arn, ...])

Class representing resource Space

StudioLifecycleConfig(*, ...[, ...])

Class representing resource StudioLifecycleConfig

SubscribedWorkteam(*, workteam_arn[, ...])

Class representing resource SubscribedWorkteam

Tag(*, key, value)

Class representing resource Tag

TrainingJob(*, training_job_name[, ...])

Class representing resource TrainingJob

TrainingPlan(*, training_plan_name[, ...])

Class representing resource TrainingPlan

TransformJob(*, transform_job_name[, ...])

Class representing resource TransformJob

Trial(*, trial_name[, trial_arn, ...])

Class representing resource Trial

TrialComponent(*, trial_component_name[, ...])

Class representing resource TrialComponent

TrialComponentInternal(*, ...[, ...])

Class representing resource TrialComponentInternal

TrialInternal(*, trial_name, experiment_name)

Class representing resource TrialInternal

UserProfile(*, domain_id, user_profile_name)

Class representing resource UserProfile

Workforce(*, workforce_name[, workforce])

Class representing resource Workforce

Workteam(*, workteam_name[, workteam])

Class representing resource Workteam

class sagemaker.core.resources.Action(*, action_name: str | PipelineVariable, action_arn: str | PipelineVariable | None = Unassigned(), source: ActionSource | None = Unassigned(), action_type: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), lineage_group_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Action

action_name#

The name of the action.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

action_arn#

The Amazon Resource Name (ARN) of the action.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source#

The source of the action.

Type:

sagemaker.core.shapes.shapes.ActionSource | None

action_type#

The type of the action.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

The description of the action.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status of the action.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

properties#

A list of the action’s properties.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

creation_time#

When the action was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

When the action was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

lineage_group_arn#

The Amazon Resource Name (ARN) of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

action_arn: str | PipelineVariable | None#
action_name: str | PipelineVariable#
action_type: str | PipelineVariable | None#
classmethod create(action_name: str | PipelineVariable, source: ActionSource, action_type: str | PipelineVariable, description: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Action | None[source]#

Create a Action resource

Parameters:
  • action_name – The name of the action. Must be unique to your account in an Amazon Web Services Region.

  • source – The source type, ID, and URI.

  • action_type – The action type.

  • description – The description of the action.

  • status – The status of the action.

  • properties – A list of properties to add to the action.

  • metadata_properties

  • tags – A list of tags to apply to the action.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Action resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Action resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
classmethod get(action_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Action | None[source]#

Get a Action resource

Parameters:
  • action_name – The name of the action to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Action resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(source_uri: str | PipelineVariable | None = Unassigned(), action_type: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Action][source]#

Get all Action resources

Parameters:
  • source_uri – A filter that returns only actions with the specified source URI.

  • action_type – A filter that returns only actions of the specified type.

  • created_after – A filter that returns only actions created on or after the specified time.

  • created_before – A filter that returns only actions created on or before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • next_token – If the previous call to ListActions didn’t return the full set of actions, the call returns a token for getting the next set of actions.

  • max_results – The maximum number of actions to return in the response. The default value is 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Action resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
lineage_group_arn: str | PipelineVariable | None#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
refresh() Action | None[source]#

Refresh a Action resource

Returns:

The Action resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

source: ActionSource | None#
status: str | PipelineVariable | None#
update(description: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), properties_to_remove: List[str | PipelineVariable] | None = Unassigned()) Action | None[source]#

Update a Action resource

Parameters:

properties_to_remove – A list of properties to remove.

Returns:

The Action resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.ActionInternal(*, action_name: str | PipelineVariable | object, source: ActionSource, action_type: str | PipelineVariable, customer_details: CustomerDetails, creation_time: datetime | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), action_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ActionInternal

action_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

source#
Type:

sagemaker.core.shapes.shapes.ActionSource

action_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

creation_time#
Type:

datetime.datetime | None

description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

properties#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

action_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

action_arn: str | PipelineVariable | None#
action_name: str | PipelineVariable | object#
action_type: str | PipelineVariable#
classmethod create(action_name: str | PipelineVariable | object, source: ActionSource, action_type: str | PipelineVariable, customer_details: CustomerDetails, creation_time: datetime | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) ActionInternal | None[source]#

Create a ActionInternal resource

Parameters:
  • action_name

  • source

  • action_type

  • customer_details

  • creation_time

  • description

  • status

  • properties

  • metadata_properties

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The ActionInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails#
description: str | PipelineVariable | None#
get_name() str[source]#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
source: ActionSource#
status: str | PipelineVariable | None#
tags: List[Tag] | None#
class sagemaker.core.resources.Algorithm(*, algorithm_name: str | PipelineVariable, algorithm_arn: str | PipelineVariable | None = Unassigned(), algorithm_description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), training_specification: TrainingSpecification | None = Unassigned(), inference_specification: InferenceSpecification | None = Unassigned(), validation_specification: AlgorithmValidationSpecification | None = Unassigned(), algorithm_status: str | PipelineVariable | None = Unassigned(), algorithm_status_details: AlgorithmStatusDetails | None = Unassigned(), product_id: str | PipelineVariable | None = Unassigned(), certify_for_marketplace: bool | None = Unassigned())[source]#

Bases: Base

Class representing resource Algorithm

algorithm_name#

The name of the algorithm being described.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

algorithm_arn#

The Amazon Resource Name (ARN) of the algorithm.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

A timestamp specifying when the algorithm was created.

Type:

datetime.datetime | None

training_specification#

Details about training jobs run by this algorithm.

Type:

sagemaker.core.shapes.shapes.TrainingSpecification | None

algorithm_status#

The current status of the algorithm.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

algorithm_status_details#

Details about the current status of the algorithm.

Type:

sagemaker.core.shapes.shapes.AlgorithmStatusDetails | None

algorithm_description#

A brief summary about the algorithm.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

inference_specification#

Details about inference jobs that the algorithm runs.

Type:

sagemaker.core.shapes.model_card_shapes.InferenceSpecification | None

validation_specification#

Details about configurations for one or more training jobs that SageMaker runs to test the algorithm.

Type:

sagemaker.core.shapes.shapes.AlgorithmValidationSpecification | None

product_id#

The product identifier of the algorithm.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

certify_for_marketplace#

Whether the algorithm is certified to be listed in Amazon Web Services Marketplace.

Type:

bool | None

algorithm_arn: str | PipelineVariable | None#
algorithm_description: str | PipelineVariable | None#
algorithm_name: str | PipelineVariable#
algorithm_status: str | PipelineVariable | None#
algorithm_status_details: AlgorithmStatusDetails | None#
certify_for_marketplace: bool | None#
classmethod create(algorithm_name: str | PipelineVariable, training_specification: TrainingSpecification, algorithm_description: str | PipelineVariable | None = Unassigned(), inference_specification: InferenceSpecification | None = Unassigned(), validation_specification: AlgorithmValidationSpecification | None = Unassigned(), certify_for_marketplace: bool | None = Unassigned(), require_image_scan: bool | None = Unassigned(), workflow_disabled: bool | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Algorithm | None[source]#

Create a Algorithm resource

Parameters:
  • algorithm_name – The name of the algorithm.

  • training_specification – Specifies details about training jobs run by this algorithm, including the following: The Amazon ECR path of the container and the version digest of the algorithm. The hyperparameters that the algorithm supports. The instance types that the algorithm supports for training. Whether the algorithm supports distributed training. The metrics that the algorithm emits to Amazon CloudWatch. Which metrics that the algorithm emits can be used as the objective metric for hyperparameter tuning jobs. The input channels that the algorithm supports for training data. For example, an algorithm might support train, validation, and test channels.

  • algorithm_description – A description of the algorithm.

  • inference_specification – Specifies details about inference jobs that the algorithm runs, including the following: The Amazon ECR paths of containers that contain the inference code and model artifacts. The instance types that the algorithm supports for transform jobs and real-time endpoints used for inference. The input and output content formats that the algorithm supports for inference.

  • validation_specification – Specifies configurations for one or more training jobs and that SageMaker runs to test the algorithm’s training code and, optionally, one or more batch transform jobs that SageMaker runs to test the algorithm’s inference code.

  • certify_for_marketplace – Whether to certify the algorithm so that it can be listed in Amazon Web Services Marketplace.

  • require_image_scan

  • workflow_disabled

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Algorithm resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a Algorithm resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

classmethod get(algorithm_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Algorithm | None[source]#

Get a Algorithm resource

Parameters:
  • algorithm_name – The name of the algorithm to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Algorithm resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Algorithm][source]#

Get all Algorithm resources

Parameters:
  • creation_time_after – A filter that returns only algorithms created after the specified time (timestamp).

  • creation_time_before – A filter that returns only algorithms created before the specified time (timestamp).

  • max_results – The maximum number of algorithms to return in the response.

  • name_contains – A string in the algorithm name. This filter returns only algorithms whose name contains the specified string.

  • next_token – If the response to a previous ListAlgorithms request was truncated, the response includes a NextToken. To retrieve the next set of algorithms, use the token in the next request.

  • sort_by – The parameter by which to sort the results. The default is CreationTime.

  • sort_order – The sort order for the results. The default is Ascending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Algorithm resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
inference_specification: InferenceSpecification | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
product_id: str | PipelineVariable | None#
refresh() Algorithm | None[source]#

Refresh a Algorithm resource

Returns:

The Algorithm resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

training_specification: TrainingSpecification | None#
validation_specification: AlgorithmValidationSpecification | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Algorithm resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Pending', 'InProgress', 'Completed', 'Failed', 'Deleting'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Algorithm resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.App(*, domain_id: str | PipelineVariable, app_type: str | PipelineVariable, app_name: str | PipelineVariable, app_arn: str | PipelineVariable | None = Unassigned(), user_profile_name: str | PipelineVariable | None = Unassigned(), space_name: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), effective_trusted_identity_propagation_status: str | PipelineVariable | None = Unassigned(), recovery_mode: bool | None = Unassigned(), last_health_check_timestamp: datetime | None = Unassigned(), last_user_activity_timestamp: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), restart_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), resource_spec: ResourceSpec | None = Unassigned(), built_in_lifecycle_config_arn: str | PipelineVariable | None = Unassigned(), app_launch_configuration: AppLaunchConfiguration | None = Unassigned())[source]#

Bases: Base

Class representing resource App

app_arn#

The Amazon Resource Name (ARN) of the app.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_type#

The type of app.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

app_name#

The name of the app.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

domain_id#

The domain ID.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

user_profile_name#

The user profile name.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

space_name#

The name of the space. If this value is not set, then UserProfileName must be set.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

effective_trusted_identity_propagation_status#

The effective status of Trusted Identity Propagation (TIP) for this application. When enabled, user identities from IAM Identity Center are being propagated through the application to TIP enabled Amazon Web Services services. When disabled, standard IAM role-based access is used.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

recovery_mode#

Indicates whether the application is launched in recovery mode.

Type:

bool | None

last_health_check_timestamp#

The timestamp of the last health check.

Type:

datetime.datetime | None

last_user_activity_timestamp#

The timestamp of the last user’s activity. LastUserActivityTimestamp is also updated when SageMaker AI performs health checks without user activity. As a result, this value is set to the same value as LastHealthCheckTimestamp.

Type:

datetime.datetime | None

creation_time#

The creation time of the application. After an application has been shut down for 24 hours, SageMaker AI deletes all metadata for the application. To be considered an update and retain application metadata, applications must be restarted within 24 hours after the previous application has been shut down. After this time window, creation of an application is considered a new application rather than an update of the previous application.

Type:

datetime.datetime | None

restart_time#
Type:

datetime.datetime | None

failure_reason#

The failure reason.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

resource_spec#

The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.

Type:

sagemaker.core.shapes.shapes.ResourceSpec | None

built_in_lifecycle_config_arn#

The lifecycle configuration that runs before the default lifecycle configuration

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_launch_configuration#
Type:

sagemaker.core.shapes.shapes.AppLaunchConfiguration | None

app_arn: str | PipelineVariable | None#
app_launch_configuration: AppLaunchConfiguration | None#
app_name: str | PipelineVariable#
app_type: str | PipelineVariable#
built_in_lifecycle_config_arn: str | PipelineVariable | None#
classmethod create(domain_id: str | PipelineVariable, app_type: str | PipelineVariable, app_name: str | PipelineVariable, user_profile_name: str | PipelineVariable | object | None = Unassigned(), space_name: str | PipelineVariable | object | None = Unassigned(), tags: List[Tag] | None = Unassigned(), resource_spec: ResourceSpec | None = Unassigned(), persistent_volume_names: List[str | PipelineVariable] | None = Unassigned(), app_launch_configuration: AppLaunchConfiguration | None = Unassigned(), recovery_mode: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) App | None[source]#

Create a App resource

Parameters:
  • domain_id – The domain ID.

  • app_type – The type of app.

  • app_name – The name of the app.

  • user_profile_name – The user profile name. If this value is not set, then SpaceName must be set.

  • space_name – The name of the space. If this value is not set, then UserProfileName must be set.

  • tags – Each tag consists of a key and an optional value. Tag keys must be unique per resource.

  • resource_spec – The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance. The value of InstanceType passed as part of the ResourceSpec in the CreateApp call overrides the value passed as part of the ResourceSpec configured for the user profile or the domain. If InstanceType is not specified in any of those three ResourceSpec values for a KernelGateway app, the CreateApp call fails with a request validation error.

  • persistent_volume_names

  • app_launch_configuration

  • recovery_mode – Indicates whether the application is launched in recovery mode.

  • session – Boto3 session.

  • region – Region name.

Returns:

The App resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a App resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

domain_id: str | PipelineVariable#
effective_trusted_identity_propagation_status: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(domain_id: str | PipelineVariable, app_type: str | PipelineVariable, app_name: str | PipelineVariable, user_profile_name: str | PipelineVariable | None = Unassigned(), space_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) App | None[source]#

Get a App resource

Parameters:
  • domain_id – The domain ID.

  • app_type – The type of app.

  • app_name – The name of the app.

  • user_profile_name – The user profile name. If this value is not set, then SpaceName must be set.

  • space_name – The name of the space.

  • session – Boto3 session.

  • region – Region name.

Returns:

The App resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), domain_id_equals: str | PipelineVariable | None = Unassigned(), user_profile_name_equals: str | PipelineVariable | None = Unassigned(), space_name_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[App][source]#

Get all App resources

Parameters:
  • next_token – If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

  • max_results – This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

  • sort_order – The sort order for the results. The default is Ascending.

  • sort_by – The parameter by which to sort the results. The default is CreationTime.

  • domain_id_equals – A parameter to search for the domain ID.

  • user_profile_name_equals – A parameter to search by user profile name. If SpaceNameEquals is set, then this value cannot be set.

  • space_name_equals – A parameter to search by space name. If UserProfileNameEquals is set, then this value cannot be set.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed App resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_health_check_timestamp: datetime | None#
last_user_activity_timestamp: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

recovery_mode: bool | None#
refresh() App | None[source]#

Refresh a App resource

Returns:

The App resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

resource_spec: ResourceSpec | None#
restart_time: datetime | None#
space_name: str | PipelineVariable | None#
status: str | PipelineVariable | None#
update(app_type: str | PipelineVariable, user_profile_name: str | PipelineVariable | None = Unassigned(), space_name: str | PipelineVariable | None = Unassigned()) App | None[source]#

Update a App resource

Returns:

The App resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

user_profile_name: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a App resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Deleted', 'Deleting', 'Failed', 'InService', 'Pending'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a App resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.AppImageConfig(*, app_image_config_name: str | PipelineVariable, app_image_config_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), kernel_gateway_image_config: KernelGatewayImageConfig | None = Unassigned(), savitur_app_image_config: SaviturAppImageConfig | None = Unassigned(), jupyter_lab_app_image_config: JupyterLabAppImageConfig | None = Unassigned(), code_editor_app_image_config: CodeEditorAppImageConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource AppImageConfig

app_image_config_arn#

The ARN of the AppImageConfig.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_image_config_name#

The name of the AppImageConfig.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

When the AppImageConfig was created.

Type:

datetime.datetime | None

last_modified_time#

When the AppImageConfig was last modified.

Type:

datetime.datetime | None

kernel_gateway_image_config#

The configuration of a KernelGateway app.

Type:

sagemaker.core.shapes.shapes.KernelGatewayImageConfig | None

savitur_app_image_config#
Type:

sagemaker.core.shapes.shapes.SaviturAppImageConfig | None

jupyter_lab_app_image_config#

The configuration of the JupyterLab app.

Type:

sagemaker.core.shapes.shapes.JupyterLabAppImageConfig | None

code_editor_app_image_config#

The configuration of the Code Editor app.

Type:

sagemaker.core.shapes.shapes.CodeEditorAppImageConfig | None

app_image_config_arn: str | PipelineVariable | None#
app_image_config_name: str | PipelineVariable#
code_editor_app_image_config: CodeEditorAppImageConfig | None#
classmethod create(app_image_config_name: str | PipelineVariable, tags: List[Tag] | None = Unassigned(), kernel_gateway_image_config: KernelGatewayImageConfig | None = Unassigned(), savitur_app_image_config: SaviturAppImageConfig | None = Unassigned(), jupyter_lab_app_image_config: JupyterLabAppImageConfig | None = Unassigned(), code_editor_app_image_config: CodeEditorAppImageConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) AppImageConfig | None[source]#

Create a AppImageConfig resource

Parameters:
  • app_image_config_name – The name of the AppImageConfig. Must be unique to your account.

  • tags – A list of tags to apply to the AppImageConfig.

  • kernel_gateway_image_config – The KernelGatewayImageConfig. You can only specify one image kernel in the AppImageConfig API. This kernel will be shown to users before the image starts. Once the image runs, all kernels are visible in JupyterLab.

  • savitur_app_image_config

  • jupyter_lab_app_image_config – The JupyterLabAppImageConfig. You can only specify one image kernel in the AppImageConfig API. This kernel is shown to users before the image starts. After the image runs, all kernels are visible in JupyterLab.

  • code_editor_app_image_config – The CodeEditorAppImageConfig. You can only specify one image kernel in the AppImageConfig API. This kernel is shown to users before the image starts. After the image runs, all kernels are visible in Code Editor.

  • session – Boto3 session.

  • region – Region name.

Returns:

The AppImageConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a AppImageConfig resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(app_image_config_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) AppImageConfig | None[source]#

Get a AppImageConfig resource

Parameters:
  • app_image_config_name – The name of the AppImageConfig to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The AppImageConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), modified_time_before: datetime | None = Unassigned(), modified_time_after: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[AppImageConfig][source]#

Get all AppImageConfig resources

Parameters:
  • max_results – The total number of items to return in the response. If the total number of items available is more than the value specified, a NextToken is provided in the response. To resume pagination, provide the NextToken value in the as part of a subsequent call. The default value is 10.

  • next_token – If the previous call to ListImages didn’t return the full set of AppImageConfigs, the call returns a token for getting the next set of AppImageConfigs.

  • name_contains – A filter that returns only AppImageConfigs whose name contains the specified string.

  • creation_time_before – A filter that returns only AppImageConfigs created on or before the specified time.

  • creation_time_after – A filter that returns only AppImageConfigs created on or after the specified time.

  • modified_time_before – A filter that returns only AppImageConfigs modified on or before the specified time.

  • modified_time_after – A filter that returns only AppImageConfigs modified on or after the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed AppImageConfig resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
jupyter_lab_app_image_config: JupyterLabAppImageConfig | None#
kernel_gateway_image_config: KernelGatewayImageConfig | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() AppImageConfig | None[source]#

Refresh a AppImageConfig resource

Returns:

The AppImageConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

savitur_app_image_config: SaviturAppImageConfig | None#
update(kernel_gateway_image_config: KernelGatewayImageConfig | None = Unassigned(), savitur_app_image_config: SaviturAppImageConfig | None = Unassigned(), jupyter_lab_app_image_config: JupyterLabAppImageConfig | None = Unassigned(), code_editor_app_image_config: CodeEditorAppImageConfig | None = Unassigned()) AppImageConfig | None[source]#

Update a AppImageConfig resource

Returns:

The AppImageConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.Artifact(*, artifact_arn: str | PipelineVariable, artifact_name: str | PipelineVariable | None = Unassigned(), source: ArtifactSource | None = Unassigned(), artifact_type: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), lineage_group_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Artifact

artifact_name#

The name of the artifact.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

artifact_arn#

The Amazon Resource Name (ARN) of the artifact.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

source#

The source of the artifact.

Type:

sagemaker.core.shapes.shapes.ArtifactSource | None

artifact_type#

The type of the artifact.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

properties#

A list of the artifact’s properties.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

creation_time#

When the artifact was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

When the artifact was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

lineage_group_arn#

The Amazon Resource Name (ARN) of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

artifact_arn: str | PipelineVariable#
artifact_name: str | PipelineVariable | None#
artifact_type: str | PipelineVariable | None#
classmethod create(source: ArtifactSource, artifact_type: str | PipelineVariable, artifact_name: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Artifact | None[source]#

Create a Artifact resource

Parameters:
  • source – The ID, ID type, and URI of the source.

  • artifact_type – The artifact type.

  • artifact_name – The name of the artifact. Must be unique to your account in an Amazon Web Services Region.

  • properties – A list of properties to add to the artifact.

  • metadata_properties

  • tags – A list of tags to apply to the artifact.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Artifact resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Artifact resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(artifact_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Artifact | None[source]#

Get a Artifact resource

Parameters:
  • artifact_arn – The Amazon Resource Name (ARN) of the artifact to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Artifact resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(source_uri: str | PipelineVariable | None = Unassigned(), artifact_type: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Artifact][source]#

Get all Artifact resources

Parameters:
  • source_uri – A filter that returns only artifacts with the specified source URI.

  • artifact_type – A filter that returns only artifacts of the specified type.

  • created_after – A filter that returns only artifacts created on or after the specified time.

  • created_before – A filter that returns only artifacts created on or before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • next_token – If the previous call to ListArtifacts didn’t return the full set of artifacts, the call returns a token for getting the next set of artifacts.

  • max_results – The maximum number of artifacts to return in the response. The default value is 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Artifact resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
lineage_group_arn: str | PipelineVariable | None#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
refresh() Artifact | None[source]#

Refresh a Artifact resource

Returns:

The Artifact resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

source: ArtifactSource | None#
update(artifact_name: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), properties_to_remove: List[str | PipelineVariable] | None = Unassigned()) Artifact | None[source]#

Update a Artifact resource

Parameters:

properties_to_remove – A list of properties to remove.

Returns:

The Artifact resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.ArtifactInternal(*, source: ArtifactSource, artifact_type: str | PipelineVariable, customer_details: CustomerDetails, artifact_name: str | PipelineVariable | object | None = Unassigned(), creation_time: datetime | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), artifact_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ArtifactInternal

source#
Type:

sagemaker.core.shapes.shapes.ArtifactSource

artifact_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

artifact_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object | None

creation_time#
Type:

datetime.datetime | None

properties#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

artifact_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

artifact_arn: str | PipelineVariable | None#
artifact_name: str | PipelineVariable | object | None#
artifact_type: str | PipelineVariable#
classmethod create(source: ArtifactSource, artifact_type: str | PipelineVariable, customer_details: CustomerDetails, artifact_name: str | PipelineVariable | object | None = Unassigned(), creation_time: datetime | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) ArtifactInternal | None[source]#

Create a ArtifactInternal resource

Parameters:
  • source

  • artifact_type

  • customer_details

  • artifact_name

  • creation_time

  • properties

  • metadata_properties

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The ArtifactInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails#
get_name() str[source]#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
source: ArtifactSource#
tags: List[Tag] | None#
class sagemaker.core.resources.Association(*, source_arn: str | PipelineVariable | None = Unassigned(), destination_arn: str | PipelineVariable | None = Unassigned(), source_type: str | PipelineVariable | None = Unassigned(), destination_type: str | PipelineVariable | None = Unassigned(), association_type: str | PipelineVariable | None = Unassigned(), source_name: str | PipelineVariable | None = Unassigned(), destination_name: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource Association

source_arn#

The ARN of the source.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

destination_arn#

The Amazon Resource Name (ARN) of the destination.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source_type#

The source type.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

destination_type#

The destination type.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

association_type#

The type of the association.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source_name#

The name of the source.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

destination_name#

The name of the destination.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

When the association was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

classmethod add(source_arn: str | PipelineVariable, destination_arn: str | PipelineVariable, association_type: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Creates an association between the source and the destination.

Parameters:
  • source_arn – The ARN of the source.

  • destination_arn – The Amazon Resource Name (ARN) of the destination.

  • association_type – The type of association. The following are suggested uses for each type. Amazon SageMaker places no restrictions on their use. ContributedTo - The source contributed to the destination or had a part in enabling the destination. For example, the training data contributed to the training job. AssociatedWith - The source is connected to the destination. For example, an approval workflow is associated with a model deployment. DerivedFrom - The destination is a modification of the source. For example, a digest output of a channel input for a processing job is derived from the original inputs. Produced - The source generated the destination. For example, a training job produced a model artifact.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

association_type: str | PipelineVariable | None#
created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Association resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

destination_arn: str | PipelineVariable | None#
destination_name: str | PipelineVariable | None#
destination_type: str | PipelineVariable | None#
classmethod get_all(source_arn: str | PipelineVariable | None = Unassigned(), destination_arn: str | PipelineVariable | None = Unassigned(), source_type: str | PipelineVariable | None = Unassigned(), destination_type: str | PipelineVariable | None = Unassigned(), association_type: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Association][source]#

Get all Association resources

Parameters:
  • source_arn – A filter that returns only associations with the specified source ARN.

  • destination_arn – A filter that returns only associations with the specified destination Amazon Resource Name (ARN).

  • source_type – A filter that returns only associations with the specified source type.

  • destination_type – A filter that returns only associations with the specified destination type.

  • association_type – A filter that returns only associations of the specified type.

  • created_after – A filter that returns only associations created on or after the specified time.

  • created_before – A filter that returns only associations created on or before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • next_token – If the previous call to ListAssociations didn’t return the full set of associations, the call returns a token for getting the next set of associations.

  • max_results – The maximum number of associations to return in the response. The default value is 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Association resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source_arn: str | PipelineVariable | None#
source_name: str | PipelineVariable | None#
source_type: str | PipelineVariable | None#
class sagemaker.core.resources.AutoMLJob(*, auto_ml_job_name: str | PipelineVariable, auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), input_data_config: List[AutoMLChannel] | None = Unassigned(), output_data_config: AutoMLOutputDataConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), auto_ml_job_objective: AutoMLJobObjective | None = Unassigned(), problem_type: str | PipelineVariable | None = Unassigned(), auto_ml_job_config: AutoMLJobConfig | None = Unassigned(), creation_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), partial_failure_reasons: List[AutoMLPartialFailureReason] | None = Unassigned(), best_candidate: AutoMLCandidate | None = Unassigned(), auto_ml_job_status: str | PipelineVariable | None = Unassigned(), auto_ml_job_secondary_status: str | PipelineVariable | None = Unassigned(), generate_candidate_definitions_only: bool | None = Unassigned(), auto_ml_job_artifacts: AutoMLJobArtifacts | None = Unassigned(), image_url_overrides: ImageUrlOverrides | None = Unassigned(), resolved_attributes: ResolvedAttributes | None = Unassigned(), model_deploy_config: ModelDeployConfig | None = Unassigned(), model_deploy_result: ModelDeployResult | None = Unassigned())[source]#

Bases: Base

Class representing resource AutoMLJob

auto_ml_job_name#

Returns the name of the AutoML job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

auto_ml_job_arn#

Returns the ARN of the AutoML job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

input_data_config#

Returns the input data configuration for the AutoML job.

Type:

List[sagemaker.core.shapes.shapes.AutoMLChannel] | None

output_data_config#

Returns the job’s output data config.

Type:

sagemaker.core.shapes.shapes.AutoMLOutputDataConfig | None

role_arn#

The ARN of the IAM role that has read permission to the input data location and write permission to the output data location in Amazon S3.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

Returns the creation time of the AutoML job.

Type:

datetime.datetime | None

last_modified_time#

Returns the job’s last modified time.

Type:

datetime.datetime | None

auto_ml_job_status#

Returns the status of the AutoML job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_secondary_status#

Returns the secondary status of the AutoML job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_objective#

Returns the job’s objective.

Type:

sagemaker.core.shapes.shapes.AutoMLJobObjective | None

problem_type#

Returns the job’s problem type.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_config#

Returns the configuration for the AutoML job.

Type:

sagemaker.core.shapes.shapes.AutoMLJobConfig | None

end_time#

Returns the end time of the AutoML job.

Type:

datetime.datetime | None

failure_reason#

Returns the failure reason for an AutoML job, when applicable.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

partial_failure_reasons#

Returns a list of reasons for partial failures within an AutoML job.

Type:

List[sagemaker.core.shapes.shapes.AutoMLPartialFailureReason] | None

best_candidate#

The best model candidate selected by SageMaker AI Autopilot using both the best objective metric and lowest InferenceLatency for an experiment.

Type:

sagemaker.core.shapes.shapes.AutoMLCandidate | None

generate_candidate_definitions_only#

Indicates whether the output for an AutoML job generates candidate definitions only.

Type:

bool | None

auto_ml_job_artifacts#

Returns information on the job’s artifacts found in AutoMLJobArtifacts.

Type:

sagemaker.core.shapes.shapes.AutoMLJobArtifacts | None

image_url_overrides#
Type:

sagemaker.core.shapes.shapes.ImageUrlOverrides | None

resolved_attributes#

Contains ProblemType, AutoMLJobObjective, and CompletionCriteria. If you do not provide these values, they are inferred.

Type:

sagemaker.core.shapes.shapes.ResolvedAttributes | None

model_deploy_config#

Indicates whether the model was deployed automatically to an endpoint and the name of that endpoint if deployed automatically.

Type:

sagemaker.core.shapes.shapes.ModelDeployConfig | None

model_deploy_result#

Provides information about endpoint for the model deployment.

Type:

sagemaker.core.shapes.shapes.ModelDeployResult | None

auto_ml_job_arn: str | PipelineVariable | None#
auto_ml_job_artifacts: AutoMLJobArtifacts | None#
auto_ml_job_config: AutoMLJobConfig | None#
auto_ml_job_name: str | PipelineVariable#
auto_ml_job_objective: AutoMLJobObjective | None#
auto_ml_job_secondary_status: str | PipelineVariable | None#
auto_ml_job_status: str | PipelineVariable | None#
best_candidate: AutoMLCandidate | None#
classmethod create(auto_ml_job_name: str | PipelineVariable, input_data_config: List[AutoMLChannel], output_data_config: AutoMLOutputDataConfig, role_arn: str | PipelineVariable, problem_type: str | PipelineVariable | None = Unassigned(), auto_ml_job_objective: AutoMLJobObjective | None = Unassigned(), auto_ml_job_config: AutoMLJobConfig | None = Unassigned(), generate_candidate_definitions_only: bool | None = Unassigned(), tags: List[Tag] | None = Unassigned(), image_url_overrides: ImageUrlOverrides | None = Unassigned(), model_deploy_config: ModelDeployConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) AutoMLJob | None[source]#

Create a AutoMLJob resource

Parameters:
  • auto_ml_job_name – Identifies an Autopilot job. The name must be unique to your account and is case insensitive.

  • input_data_config – An array of channel objects that describes the input data and its location. Each channel is a named input source. Similar to InputDataConfig supported by HyperParameterTrainingJobDefinition. Format(s) supported: CSV, Parquet. A minimum of 500 rows is required for the training dataset. There is not a minimum number of rows required for the validation dataset.

  • output_data_config – Provides information about encryption and the Amazon S3 output path needed to store artifacts from an AutoML job. Format(s) supported: CSV.

  • role_arn – The ARN of the role that is used to access the data.

  • problem_type – Defines the type of supervised learning problem available for the candidates. For more information, see SageMaker Autopilot problem types.

  • auto_ml_job_objective – Specifies a metric to minimize or maximize as the objective of a job. If not specified, the default objective metric depends on the problem type. See AutoMLJobObjective for the default values.

  • auto_ml_job_config – A collection of settings used to configure an AutoML job.

  • generate_candidate_definitions_only – Generates possible candidates without training the models. A candidate is a combination of data preprocessors, algorithms, and algorithm parameter settings.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web ServicesResources. Tag keys must be unique per resource.

  • image_url_overrides

  • model_deploy_config – Specifies how to generate the endpoint name for an automatic one-click Autopilot model deployment.

  • session – Boto3 session.

  • region – Region name.

Returns:

The AutoMLJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a AutoMLJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessDeniedException

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

end_time: datetime | None#
failure_reason: str | PipelineVariable | None#
generate_candidate_definitions_only: bool | None#
classmethod get(auto_ml_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) AutoMLJob | None[source]#

Get a AutoMLJob resource

Parameters:
  • auto_ml_job_name – Requests information about an AutoML job using its unique name.

  • session – Boto3 session.

  • region – Region name.

Returns:

The AutoMLJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[AutoMLJob][source]#

Get all AutoMLJob resources

Parameters:
  • creation_time_after – Request a list of jobs, using a filter for time.

  • creation_time_before – Request a list of jobs, using a filter for time.

  • last_modified_time_after – Request a list of jobs, using a filter for time.

  • last_modified_time_before – Request a list of jobs, using a filter for time.

  • name_contains – Request a list of jobs, using a search filter for name.

  • status_equals – Request a list of jobs, using a filter for status.

  • sort_order – The sort order for the results. The default is Descending.

  • sort_by – The parameter by which to sort the results. The default is Name.

  • max_results – Request a list of jobs up to a specified limit.

  • next_token – If the previous response was truncated, you receive this token. Use it in your next request to receive the next set of results.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed AutoMLJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_candidates(status_equals: str | PipelineVariable | None = Unassigned(), candidate_name_equals: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[AutoMLCandidate][source]#

List the candidates created for the job.

Parameters:
  • status_equals – List the candidates for the job and filter by status.

  • candidate_name_equals – List the candidates for the job and filter by candidate name.

  • sort_order – The sort order for the results. The default is Ascending.

  • sort_by – The parameter by which to sort the results. The default is Descending.

  • max_results – List the job’s candidates up to a specified limit.

  • next_token – If the previous response was truncated, you receive this token. Use it in your next request to receive the next set of results.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed AutoMLCandidate.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
image_url_overrides: ImageUrlOverrides | None#
input_data_config: List[AutoMLChannel] | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_deploy_config: ModelDeployConfig | None#
model_deploy_result: ModelDeployResult | None#
output_data_config: AutoMLOutputDataConfig | None#
partial_failure_reasons: List[AutoMLPartialFailureReason] | None#
populate_inputs_decorator()[source]#
problem_type: str | PipelineVariable | None#
refresh() AutoMLJob | None[source]#

Refresh a AutoMLJob resource

Returns:

The AutoMLJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

resolved_attributes: ResolvedAttributes | None#
role_arn: str | PipelineVariable | None#
stop() None[source]#

Stop a AutoMLJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a AutoMLJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.AutoMLJobV2(*, auto_ml_job_name: str | PipelineVariable, auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), auto_ml_job_input_data_config: List[AutoMLJobChannel] | None = Unassigned(), output_data_config: AutoMLOutputDataConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), auto_ml_job_objective: AutoMLJobObjective | None = Unassigned(), auto_ml_problem_type_config: AutoMLProblemTypeConfig | None = Unassigned(), auto_ml_problem_type_config_name: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), partial_failure_reasons: List[AutoMLPartialFailureReason] | None = Unassigned(), best_candidate: AutoMLCandidate | None = Unassigned(), auto_ml_job_status: str | PipelineVariable | None = Unassigned(), auto_ml_job_secondary_status: str | PipelineVariable | None = Unassigned(), auto_ml_job_artifacts: AutoMLJobArtifacts | None = Unassigned(), image_url_overrides: ImageUrlOverrides | None = Unassigned(), resolved_attributes: AutoMLResolvedAttributes | None = Unassigned(), model_deploy_config: ModelDeployConfig | None = Unassigned(), model_deploy_result: ModelDeployResult | None = Unassigned(), data_split_config: AutoMLDataSplitConfig | None = Unassigned(), security_config: AutoMLSecurityConfig | None = Unassigned(), external_feature_transformers: AutoMLExternalFeatureTransformers | None = Unassigned(), auto_ml_compute_config: AutoMLComputeConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource AutoMLJobV2

auto_ml_job_name#

Returns the name of the AutoML job V2.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

auto_ml_job_arn#

Returns the Amazon Resource Name (ARN) of the AutoML job V2.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_input_data_config#

Returns an array of channel objects describing the input data and their location.

Type:

List[sagemaker.core.shapes.shapes.AutoMLJobChannel] | None

output_data_config#

Returns the job’s output data config.

Type:

sagemaker.core.shapes.shapes.AutoMLOutputDataConfig | None

role_arn#

The ARN of the IAM role that has read permission to the input data location and write permission to the output data location in Amazon S3.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

Returns the creation time of the AutoML job V2.

Type:

datetime.datetime | None

last_modified_time#

Returns the job’s last modified time.

Type:

datetime.datetime | None

auto_ml_job_status#

Returns the status of the AutoML job V2.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_secondary_status#

Returns the secondary status of the AutoML job V2.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_objective#

Returns the job’s objective.

Type:

sagemaker.core.shapes.shapes.AutoMLJobObjective | None

auto_ml_problem_type_config#

Returns the configuration settings of the problem type set for the AutoML job V2.

Type:

sagemaker.core.shapes.shapes.AutoMLProblemTypeConfig | None

auto_ml_problem_type_config_name#

Returns the name of the problem type configuration set for the AutoML job V2.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

end_time#

Returns the end time of the AutoML job V2.

Type:

datetime.datetime | None

failure_reason#

Returns the reason for the failure of the AutoML job V2, when applicable.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

partial_failure_reasons#

Returns a list of reasons for partial failures within an AutoML job V2.

Type:

List[sagemaker.core.shapes.shapes.AutoMLPartialFailureReason] | None

best_candidate#

Information about the candidate produced by an AutoML training job V2, including its status, steps, and other properties.

Type:

sagemaker.core.shapes.shapes.AutoMLCandidate | None

auto_ml_job_artifacts#
Type:

sagemaker.core.shapes.shapes.AutoMLJobArtifacts | None

image_url_overrides#
Type:

sagemaker.core.shapes.shapes.ImageUrlOverrides | None

resolved_attributes#

Returns the resolved attributes used by the AutoML job V2.

Type:

sagemaker.core.shapes.shapes.AutoMLResolvedAttributes | None

model_deploy_config#

Indicates whether the model was deployed automatically to an endpoint and the name of that endpoint if deployed automatically.

Type:

sagemaker.core.shapes.shapes.ModelDeployConfig | None

model_deploy_result#

Provides information about endpoint for the model deployment.

Type:

sagemaker.core.shapes.shapes.ModelDeployResult | None

data_split_config#

Returns the configuration settings of how the data are split into train and validation datasets.

Type:

sagemaker.core.shapes.shapes.AutoMLDataSplitConfig | None

security_config#

Returns the security configuration for traffic encryption or Amazon VPC settings.

Type:

sagemaker.core.shapes.shapes.AutoMLSecurityConfig | None

external_feature_transformers#
Type:

sagemaker.core.shapes.shapes.AutoMLExternalFeatureTransformers | None

auto_ml_compute_config#

The compute configuration used for the AutoML job V2.

Type:

sagemaker.core.shapes.shapes.AutoMLComputeConfig | None

auto_ml_compute_config: AutoMLComputeConfig | None#
auto_ml_job_arn: str | PipelineVariable | None#
auto_ml_job_artifacts: AutoMLJobArtifacts | None#
auto_ml_job_input_data_config: List[AutoMLJobChannel] | None#
auto_ml_job_name: str | PipelineVariable#
auto_ml_job_objective: AutoMLJobObjective | None#
auto_ml_job_secondary_status: str | PipelineVariable | None#
auto_ml_job_status: str | PipelineVariable | None#
auto_ml_problem_type_config: AutoMLProblemTypeConfig | None#
auto_ml_problem_type_config_name: str | PipelineVariable | None#
best_candidate: AutoMLCandidate | None#
classmethod create(auto_ml_job_name: str | PipelineVariable, auto_ml_job_input_data_config: List[AutoMLJobChannel], output_data_config: AutoMLOutputDataConfig, auto_ml_problem_type_config: AutoMLProblemTypeConfig, role_arn: str | PipelineVariable, tags: List[Tag] | None = Unassigned(), security_config: AutoMLSecurityConfig | None = Unassigned(), auto_ml_job_objective: AutoMLJobObjective | None = Unassigned(), model_deploy_config: ModelDeployConfig | None = Unassigned(), image_url_overrides: ImageUrlOverrides | None = Unassigned(), data_split_config: AutoMLDataSplitConfig | None = Unassigned(), auto_ml_execution_mode: str | PipelineVariable | None = Unassigned(), external_feature_transformers: AutoMLExternalFeatureTransformers | None = Unassigned(), auto_ml_compute_config: AutoMLComputeConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) AutoMLJobV2 | None[source]#

Create a AutoMLJobV2 resource

Parameters:
  • auto_ml_job_name – Identifies an Autopilot job. The name must be unique to your account and is case insensitive.

  • auto_ml_job_input_data_config – An array of channel objects describing the input data and their location. Each channel is a named input source. Similar to the InputDataConfig attribute in the CreateAutoMLJob input parameters. The supported formats depend on the problem type: For tabular problem types: S3Prefix, ManifestFile. For image classification: S3Prefix, ManifestFile, AugmentedManifestFile. For text classification: S3Prefix. For time-series forecasting: S3Prefix. For text generation (LLMs fine-tuning): S3Prefix.

  • output_data_config – Provides information about encryption and the Amazon S3 output path needed to store artifacts from an AutoML job.

  • auto_ml_problem_type_config – Defines the configuration settings of one of the supported problem types.

  • role_arn – The ARN of the role that is used to access the data.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, such as by purpose, owner, or environment. For more information, see Tagging Amazon Web ServicesResources. Tag keys must be unique per resource.

  • security_config – The security configuration for traffic encryption or Amazon VPC settings.

  • auto_ml_job_objective – Specifies a metric to minimize or maximize as the objective of a job. If not specified, the default objective metric depends on the problem type. For the list of default values per problem type, see AutoMLJobObjective. For tabular problem types: You must either provide both the AutoMLJobObjective and indicate the type of supervised learning problem in AutoMLProblemTypeConfig (TabularJobConfig.ProblemType), or none at all. For text generation problem types (LLMs fine-tuning): Fine-tuning language models in Autopilot does not require setting the AutoMLJobObjective field. Autopilot fine-tunes LLMs without requiring multiple candidates to be trained and evaluated. Instead, using your dataset, Autopilot directly fine-tunes your target model to enhance a default objective metric, the cross-entropy loss. After fine-tuning a language model, you can evaluate the quality of its generated text using different metrics. For a list of the available metrics, see Metrics for fine-tuning LLMs in Autopilot.

  • model_deploy_config – Specifies how to generate the endpoint name for an automatic one-click Autopilot model deployment.

  • image_url_overrides

  • data_split_config – This structure specifies how to split the data into train and validation datasets. The validation and training datasets must contain the same headers. For jobs created by calling CreateAutoMLJob, the validation dataset must be less than 2 GB in size. This attribute must not be set for the time-series forecasting problem type, as Autopilot automatically splits the input dataset into training and validation sets.

  • auto_ml_execution_mode

  • external_feature_transformers

  • auto_ml_compute_config – Specifies the compute configuration for the AutoML job V2.

  • session – Boto3 session.

  • region – Region name.

Returns:

The AutoMLJobV2 resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
data_split_config: AutoMLDataSplitConfig | None#
end_time: datetime | None#
external_feature_transformers: AutoMLExternalFeatureTransformers | None#
failure_reason: str | PipelineVariable | None#
classmethod get(auto_ml_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) AutoMLJobV2 | None[source]#

Get a AutoMLJobV2 resource

Parameters:
  • auto_ml_job_name – Requests information about an AutoML job V2 using its unique name.

  • session – Boto3 session.

  • region – Region name.

Returns:

The AutoMLJobV2 resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
image_url_overrides: ImageUrlOverrides | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_deploy_config: ModelDeployConfig | None#
model_deploy_result: ModelDeployResult | None#
output_data_config: AutoMLOutputDataConfig | None#
partial_failure_reasons: List[AutoMLPartialFailureReason] | None#
populate_inputs_decorator()[source]#
refresh() AutoMLJobV2 | None[source]#

Refresh a AutoMLJobV2 resource

Returns:

The AutoMLJobV2 resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

resolved_attributes: AutoMLResolvedAttributes | None#
role_arn: str | PipelineVariable | None#
security_config: AutoMLSecurityConfig | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a AutoMLJobV2 resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.AutoMLTask(*, auto_ml_task_arn: str | PipelineVariable, auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), candidate_name: str | PipelineVariable | None = Unassigned(), auto_ml_task_type: str | PipelineVariable | None = Unassigned(), auto_ml_task_status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), auto_ml_task_artifacts_location: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource AutoMLTask

auto_ml_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_task_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

candidate_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_task_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_task_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#
Type:

datetime.datetime | None

last_modified_time#
Type:

datetime.datetime | None

end_time#
Type:

datetime.datetime | None

failure_reason#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_task_artifacts_location#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_arn: str | PipelineVariable | None#
auto_ml_task_arn: str | PipelineVariable#
auto_ml_task_artifacts_location: str | PipelineVariable | None#
auto_ml_task_status: str | PipelineVariable | None#
auto_ml_task_type: str | PipelineVariable | None#
candidate_name: str | PipelineVariable | None#
classmethod create(auto_ml_job_name: str | PipelineVariable, auto_ml_task_context: AutoMLTaskContext, auto_ml_task_type: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) AutoMLTask | None[source]#

Create a AutoMLTask resource

Parameters:
  • auto_ml_job_name

  • auto_ml_task_context

  • auto_ml_task_type

  • session – Boto3 session.

  • region – Region name.

Returns:

The AutoMLTask resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
end_time: datetime | None#
failure_reason: str | PipelineVariable | None#
classmethod get(auto_ml_task_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) AutoMLTask | None[source]#

Get a AutoMLTask resource

Parameters:
  • auto_ml_task_arn

  • session – Boto3 session.

  • region – Region name.

Returns:

The AutoMLTask resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() AutoMLTask | None[source]#

Refresh a AutoMLTask resource

Returns:

The AutoMLTask resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Completed', 'InProgress', 'Failed', 'Stopped', 'Stopping'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a AutoMLTask resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.Base[source]#

Bases: BaseModel

static add_validate_call(func)[source]#
config_manager: ClassVar[SageMakerConfig] = <sagemaker.core.config.config_manager.SageMakerConfig object>#
classmethod get_sagemaker_client(session=None, region_name=None, service_name='sagemaker')[source]#
static get_updated_kwargs_with_configured_attributes(config_schema_for_resource: dict, resource_name: str, **kwargs)[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

static populate_chained_attributes(resource_name: str, operation_input_args: dict | object)[source]#
class sagemaker.core.resources.CapacitySchedule(*, capacity_schedule_arn: str | PipelineVariable | None = Unassigned(), owner_account_id: str | PipelineVariable | None = Unassigned(), capacity_schedule_type: str | PipelineVariable | None = Unassigned(), instance_type: str | PipelineVariable | None = Unassigned(), total_instance_count: int | None = Unassigned(), available_instance_count: int | None = Unassigned(), placement: str | PipelineVariable | None = Unassigned(), availability_zone: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), requested_start_time: datetime | None = Unassigned(), requested_end_time: datetime | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), duration_in_hours: int | None = Unassigned(), capacity_block_offerings: List[CapacityBlockOffering] | None = Unassigned(), capacity_resources: CapacityResources | None = Unassigned(), target_resources: List[str | PipelineVariable] | None = Unassigned(), capacity_schedule_status_transitions: List[CapacityScheduleStatusTransition] | None = Unassigned())[source]#

Bases: Base

Class representing resource CapacitySchedule

capacity_schedule_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

capacity_schedule_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

instance_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

total_instance_count#
Type:

int | None

placement#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

requested_start_time#
Type:

datetime.datetime | None

owner_account_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

available_instance_count#
Type:

int | None

availability_zone#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

requested_end_time#
Type:

datetime.datetime | None

start_time#
Type:

datetime.datetime | None

end_time#
Type:

datetime.datetime | None

duration_in_hours#
Type:

int | None

capacity_block_offerings#
Type:

List[sagemaker.core.shapes.shapes.CapacityBlockOffering] | None

capacity_resources#
Type:

sagemaker.core.shapes.shapes.CapacityResources | None

target_resources#
Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

capacity_schedule_status_transitions#
Type:

List[sagemaker.core.shapes.shapes.CapacityScheduleStatusTransition] | None

availability_zone: str | PipelineVariable | None#
available_instance_count: int | None#
capacity_block_offerings: List[CapacityBlockOffering] | None#
capacity_resources: CapacityResources | None#
capacity_schedule_arn: str | PipelineVariable | None#
capacity_schedule_status_transitions: List[CapacityScheduleStatusTransition] | None#
capacity_schedule_type: str | PipelineVariable | None#
classmethod create(capacity_schedule_name: str | PipelineVariable, capacity_schedule_offering_id: str | PipelineVariable, target_services: List[str | PipelineVariable] | None = Unassigned(), max_wait_time_in_seconds: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) CapacitySchedule | None[source]#

Create a CapacitySchedule resource

Parameters:
  • capacity_schedule_name

  • capacity_schedule_offering_id

  • target_services

  • max_wait_time_in_seconds

  • session – Boto3 session.

  • region – Region name.

Returns:

The CapacitySchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

duration_in_hours: int | None#
end_time: datetime | None#
classmethod get(capacity_schedule_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) CapacitySchedule | None[source]#

Get a CapacitySchedule resource

Parameters:
  • capacity_schedule_name

  • session – Boto3 session.

  • region – Region name.

Returns:

The CapacitySchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
instance_type: str | PipelineVariable | None#
classmethod load(capacity_schedule_name: str | PipelineVariable, capacity_resource_arn: str | PipelineVariable, target_resources: List[str | PipelineVariable], session: Session | None = None, region: str | PipelineVariable | None = None) CapacitySchedule | None[source]#

Import a CapacitySchedule resource

Parameters:
  • capacity_schedule_name

  • capacity_resource_arn

  • target_resources

  • session – Boto3 session.

  • region – Region name.

Returns:

The CapacitySchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceAlreadyExists

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

owner_account_id: str | PipelineVariable | None#
placement: str | PipelineVariable | None#
refresh(capacity_schedule_name: str | PipelineVariable) CapacitySchedule | None[source]#

Refresh a CapacitySchedule resource

Returns:

The CapacitySchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

requested_end_time: datetime | None#
requested_start_time: datetime | None#
start_time: datetime | None#
status: str | PipelineVariable | None#
stop() None[source]#

Stop a CapacitySchedule resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

target_resources: List[str | PipelineVariable] | None#
total_instance_count: int | None#
update(capacity_schedule_name: str | PipelineVariable, max_wait_time_in_seconds: int | None = Unassigned(), requested_start_time: datetime | None = Unassigned(), requested_end_time: datetime | None = Unassigned(), instance_count: int | None = Unassigned()) CapacitySchedule | None[source]#

Update a CapacitySchedule resource

Parameters:
  • capacity_schedule_name

  • max_wait_time_in_seconds

  • instance_count

Returns:

The CapacitySchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Pending', 'Confirmed', 'Active', 'Updating', 'Stopping', 'Stopped', 'Rejected', 'Withdrawn'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a CapacitySchedule resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.Cluster(*, cluster_name: str | PipelineVariable, cluster_arn: str | PipelineVariable | None = Unassigned(), cluster_status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), failure_message: str | PipelineVariable | None = Unassigned(), instance_groups: List[ClusterInstanceGroupDetails] | None = Unassigned(), restricted_instance_groups: List[ClusterRestrictedInstanceGroupDetails] | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), orchestrator: ClusterOrchestrator | None = Unassigned(), resilience_config: ClusterResilienceConfig | None = Unassigned(), tiered_storage_config: ClusterTieredStorageConfig | None = Unassigned(), node_recovery: str | PipelineVariable | None = Unassigned(), node_provisioning_mode: str | PipelineVariable | None = Unassigned(), cluster_role: str | PipelineVariable | None = Unassigned(), auto_scaling: ClusterAutoScalingConfigOutput | None = Unassigned(), custom_metadata: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned())[source]#

Bases: Base

Class representing resource Cluster

cluster_arn#

The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_status#

The status of the SageMaker HyperPod cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

instance_groups#

The instance groups of the SageMaker HyperPod cluster.

Type:

List[sagemaker.core.shapes.shapes.ClusterInstanceGroupDetails] | None

cluster_name#

The name of the SageMaker HyperPod cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The time when the SageMaker Cluster is created.

Type:

datetime.datetime | None

failure_message#

The failure message of the SageMaker HyperPod cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

restricted_instance_groups#

The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.

Type:

List[sagemaker.core.shapes.shapes.ClusterRestrictedInstanceGroupDetails] | None

vpc_config#
Type:

sagemaker.core.shapes.shapes.VpcConfig | None

orchestrator#

The type of orchestrator used for the SageMaker HyperPod cluster.

Type:

sagemaker.core.shapes.shapes.ClusterOrchestrator | None

resilience_config#
Type:

sagemaker.core.shapes.shapes.ClusterResilienceConfig | None

tiered_storage_config#

The current configuration for managed tier checkpointing on the HyperPod cluster. For example, this shows whether the feature is enabled and the percentage of cluster memory allocated for checkpoint storage.

Type:

sagemaker.core.shapes.shapes.ClusterTieredStorageConfig | None

node_recovery#

The node recovery mode configured for the SageMaker HyperPod cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

node_provisioning_mode#

The mode used for provisioning nodes in the cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_role#

The Amazon Resource Name (ARN) of the IAM role that HyperPod uses for cluster autoscaling operations.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_scaling#

The current autoscaling configuration and status for the autoscaler.

Type:

sagemaker.core.shapes.shapes.ClusterAutoScalingConfigOutput | None

custom_metadata#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

auto_scaling: ClusterAutoScalingConfigOutput | None#
batch_delete_nodes(node_ids: List[str | PipelineVariable] | None = Unassigned(), node_logical_ids: List[str | PipelineVariable] | None = Unassigned(), dry_run: bool | None = Unassigned(), session: Session | None = None, region: str | None = None) BatchDeleteClusterNodesResponse | None[source]#

Deletes specific nodes within a SageMaker HyperPod cluster.

Parameters:
  • node_ids – A list of node IDs to be deleted from the specified cluster. For SageMaker HyperPod clusters using the Slurm workload manager, you cannot remove instances that are configured as Slurm controller nodes. If you need to delete more than 99 instances, contact Support for assistance.

  • node_logical_ids – A list of NodeLogicalIds identifying the nodes to be deleted. You can specify up to 50 NodeLogicalIds. You must specify either NodeLogicalIds, InstanceIds, or both, with a combined maximum of 50 identifiers.

  • dry_run

  • session – Boto3 session.

  • region – Region name.

Returns:

BatchDeleteClusterNodesResponse

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • DryRunOperation

  • ResourceNotFound – Resource being access is not found.

cluster_arn: str | PipelineVariable | None#
cluster_name: str | PipelineVariable#
cluster_role: str | PipelineVariable | None#
cluster_status: str | PipelineVariable | None#
classmethod create(cluster_name: str | PipelineVariable, instance_groups: List[ClusterInstanceGroupSpecification] | None = Unassigned(), restricted_instance_groups: List[ClusterRestrictedInstanceGroupSpecification] | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), orchestrator: ClusterOrchestrator | None = Unassigned(), resilience_config: ClusterResilienceConfig | None = Unassigned(), node_recovery: str | PipelineVariable | None = Unassigned(), tiered_storage_config: ClusterTieredStorageConfig | None = Unassigned(), node_provisioning_mode: str | PipelineVariable | None = Unassigned(), dry_run: bool | None = Unassigned(), cluster_role: str | PipelineVariable | None = Unassigned(), auto_scaling: ClusterAutoScalingConfig | None = Unassigned(), custom_metadata: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Cluster | None[source]#

Create a Cluster resource

Parameters:
  • cluster_name – The name for the new SageMaker HyperPod cluster.

  • instance_groups – The instance groups to be created in the SageMaker HyperPod cluster.

  • restricted_instance_groups – The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.

  • vpc_config – Specifies the Amazon Virtual Private Cloud (VPC) that is associated with the Amazon SageMaker HyperPod cluster. You can control access to and from your resources by configuring your VPC. For more information, see Give SageMaker access to resources in your Amazon VPC. When your Amazon VPC and subnets support IPv6, network communications differ based on the cluster orchestration platform: Slurm-orchestrated clusters automatically configure nodes with dual IPv6 and IPv4 addresses, allowing immediate IPv6 network communications. In Amazon EKS-orchestrated clusters, nodes receive dual-stack addressing, but pods can only use IPv6 when the Amazon EKS cluster is explicitly IPv6-enabled. For information about deploying an IPv6 Amazon EKS cluster, see Amazon EKS IPv6 Cluster Deployment. Additional resources for IPv6 configuration: For information about adding IPv6 support to your VPC, see to IPv6 Support for VPC. For information about creating a new IPv6-compatible VPC, see Amazon VPC Creation Guide. To configure SageMaker HyperPod with a custom Amazon VPC, see Custom Amazon VPC Setup for SageMaker HyperPod.

  • tags – Custom tags for managing the SageMaker HyperPod cluster as an Amazon Web Services resource. You can add tags to your cluster in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see Tagging Amazon Web Services Resources User Guide.

  • orchestrator – The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is “eks”, which is to use an Amazon Elastic Kubernetes Service cluster as the orchestrator.

  • resilience_config

  • node_recovery – The node recovery mode for the SageMaker HyperPod cluster. When set to Automatic, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to None, cluster administrators will need to manually manage any faulty cluster instances.

  • tiered_storage_config – The configuration for managed tier checkpointing on the HyperPod cluster. When enabled, this feature uses a multi-tier storage approach for storing model checkpoints, providing faster checkpoint operations and improved fault tolerance across cluster nodes.

  • node_provisioning_mode – The mode for provisioning nodes in the cluster. You can specify the following modes: Continuous: Scaling behavior that enables 1) concurrent operation execution within instance groups, 2) continuous retry mechanisms for failed operations, 3) enhanced customer visibility into cluster events through detailed event streams, 4) partial provisioning capabilities. Your clusters and instance groups remain InService while scaling. This mode is only supported for EKS orchestrated clusters.

  • dry_run

  • cluster_role – The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes to perform cluster autoscaling operations. This role must have permissions for sagemaker:BatchAddClusterNodes and sagemaker:BatchDeleteClusterNodes. This is only required when autoscaling is enabled and when HyperPod is performing autoscaling operations.

  • auto_scaling – The autoscaling configuration for the cluster. Enables automatic scaling of cluster nodes based on workload demand using a Karpenter-based system.

  • custom_metadata

  • session – Boto3 session.

  • region – Region name.

Returns:

The Cluster resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • DryRunOperation

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
custom_metadata: Dict[str | PipelineVariable, str | PipelineVariable] | None#
delete(dry_run: bool | None = Unassigned()) None[source]#

Delete a Cluster resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceNotFound – Resource being access is not found.

failure_message: str | PipelineVariable | None#
classmethod get(cluster_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Cluster | None[source]#

Get a Cluster resource

Parameters:
  • cluster_name – The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Cluster resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), training_plan_arn: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Cluster][source]#

Get all Cluster resources

Parameters:
  • creation_time_after – Set a start time for the time range during which you want to list SageMaker HyperPod clusters. Timestamps are formatted according to the ISO 8601 standard. Acceptable formats include: YYYY-MM-DDThh:mm:ss.sssTZD (UTC), for example, 2014-10-01T20:30:00.000Z YYYY-MM-DDThh:mm:ss.sssTZD (with offset), for example, 2014-10-01T12:30:00.000-08:00 YYYY-MM-DD, for example, 2014-10-01 Unix time in seconds, for example, 1412195400. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC. For more information about the timestamp format, see Timestamp in the Amazon Web Services Command Line Interface User Guide.

  • creation_time_before – Set an end time for the time range during which you want to list SageMaker HyperPod clusters. A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for CreationTimeAfter. For more information about the timestamp format, see Timestamp in the Amazon Web Services Command Line Interface User Guide.

  • max_results – Specifies the maximum number of clusters to evaluate for the operation (not necessarily the number of matching items). After SageMaker processes the number of clusters up to MaxResults, it stops the operation and returns the matching clusters up to that point. If all the matching clusters are desired, SageMaker will go through all the clusters until NextToken is empty.

  • name_contains – Set the maximum number of instances to print in the list.

  • next_token – Set the next token to retrieve the list of SageMaker HyperPod clusters.

  • sort_by – The field by which to sort results. The default value is CREATION_TIME.

  • sort_order – The sort order for results. The default value is Ascending.

  • training_plan_arn – The Amazon Resource Name (ARN); of the training plan to filter clusters by. For more information about reserving GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see CreateTrainingPlan .

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Cluster resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_nodes(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), instance_group_name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), include_node_logical_ids: bool | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[ClusterNodeDetails][source]#

Retrieves the list of instances (also called nodes interchangeably) in a SageMaker HyperPod cluster.

Parameters:
  • creation_time_after – A filter that returns nodes in a SageMaker HyperPod cluster created after the specified time. Timestamps are formatted according to the ISO 8601 standard. Acceptable formats include: YYYY-MM-DDThh:mm:ss.sssTZD (UTC), for example, 2014-10-01T20:30:00.000Z YYYY-MM-DDThh:mm:ss.sssTZD (with offset), for example, 2014-10-01T12:30:00.000-08:00 YYYY-MM-DD, for example, 2014-10-01 Unix time in seconds, for example, 1412195400. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC. For more information about the timestamp format, see Timestamp in the Amazon Web Services Command Line Interface User Guide.

  • creation_time_before – A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for CreationTimeAfter. For more information about the timestamp format, see Timestamp in the Amazon Web Services Command Line Interface User Guide.

  • instance_group_name_contains – A filter that returns the instance groups whose name contain a specified string.

  • max_results – The maximum number of nodes to return in the response.

  • next_token – If the result of the previous ListClusterNodes request was truncated, the response includes a NextToken. To retrieve the next set of cluster nodes, use the token in the next request.

  • sort_by – The field by which to sort results. The default value is CREATION_TIME.

  • sort_order – The sort order for results. The default value is Ascending.

  • include_node_logical_ids – Specifies whether to include nodes that are still being provisioned in the response. When set to true, the response includes all nodes regardless of their provisioning status. When set to False (default), only nodes with assigned InstanceIds are returned.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ClusterNodeDetails.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
get_node(node_id: str | PipelineVariable | None = Unassigned(), node_logical_id: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ClusterNodeDetails | None[source]#

Retrieves information of a node (also called a instance interchangeably) of a SageMaker HyperPod cluster.

Parameters:
  • node_id – The ID of the SageMaker HyperPod cluster node.

  • node_logical_id – The logical identifier of the node to describe. You can specify either NodeLogicalId or InstanceId, but not both. NodeLogicalId can be used to describe nodes that are still being provisioned and don’t yet have an InstanceId assigned.

  • session – Boto3 session.

  • region – Region name.

Returns:

ClusterNodeDetails

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

instance_groups: List[ClusterInstanceGroupDetails] | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

node_provisioning_mode: str | PipelineVariable | None#
node_recovery: str | PipelineVariable | None#
orchestrator: ClusterOrchestrator | None#
populate_inputs_decorator()[source]#
refresh() Cluster | None[source]#

Refresh a Cluster resource

Returns:

The Cluster resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

resilience_config: ClusterResilienceConfig | None#
restricted_instance_groups: List[ClusterRestrictedInstanceGroupDetails] | None#
tiered_storage_config: ClusterTieredStorageConfig | None#
update(instance_groups: List[ClusterInstanceGroupSpecification] | None = Unassigned(), restricted_instance_groups: List[ClusterRestrictedInstanceGroupSpecification] | None = Unassigned(), resilience_config: ClusterResilienceConfig | None = Unassigned(), tiered_storage_config: ClusterTieredStorageConfig | None = Unassigned(), node_recovery: str | PipelineVariable | None = Unassigned(), instance_groups_to_delete: List[str | PipelineVariable] | None = Unassigned(), node_provisioning_mode: str | PipelineVariable | None = Unassigned(), dry_run: bool | None = Unassigned(), cluster_role: str | PipelineVariable | None = Unassigned(), auto_scaling: ClusterAutoScalingConfig | None = Unassigned(), custom_metadata: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned()) Cluster | None[source]#

Update a Cluster resource

Parameters:
  • instance_groups_to_delete – Specify the names of the instance groups to delete. Use a single , as the separator between multiple names.

  • dry_run

Returns:

The Cluster resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

update_software(deployment_config: DeploymentConfiguration | None = Unassigned(), dry_run: bool | None = Unassigned(), image_id: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Updates the platform software of a SageMaker HyperPod cluster for security patching.

Parameters:
  • deployment_config – The configuration to use when updating the AMI versions.

  • dry_run

  • image_id – When configuring your HyperPod cluster, you can specify an image ID using one of the following options: HyperPodPublicAmiId: Use a HyperPod public AMI CustomAmiId: Use your custom AMI default: Use the default latest system image If you choose to use a custom AMI (CustomAmiId), ensure it meets the following requirements: Encryption: The custom AMI must be unencrypted. Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster. Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported. When updating the instance group’s AMI through the UpdateClusterSoftware operation, if an instance group uses a custom AMI, you must provide an ImageId or use the default as input. Note that if you don’t specify an instance group in your UpdateClusterSoftware request, then all of the instance groups are patched with the specified image.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceNotFound – Resource being access is not found.

vpc_config: VpcConfig | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Cluster resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'Deleting', 'Failed', 'InService', 'RollingBack', 'SystemUpdating', 'Updating'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Cluster resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ClusterHealthCheck[source]#

Bases: Base

Class representing resource ClusterHealthCheck

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class sagemaker.core.resources.ClusterNode[source]#

Bases: Base

Class representing resource ClusterNode

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class sagemaker.core.resources.ClusterSchedulerConfig(*, cluster_scheduler_config_id: str | PipelineVariable, cluster_scheduler_config_arn: str | PipelineVariable | None = Unassigned(), name: str | PipelineVariable | None = Unassigned(), cluster_scheduler_config_version: int | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), cluster_arn: str | PipelineVariable | None = Unassigned(), scheduler_config: SchedulerConfig | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource ClusterSchedulerConfig

cluster_scheduler_config_arn#

ARN of the cluster policy.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_scheduler_config_id#

ID of the cluster policy.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

name#

Name of the cluster policy.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_scheduler_config_version#

Version of the cluster policy.

Type:

int | None

status#

Status of the cluster policy.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

Creation time of the cluster policy.

Type:

datetime.datetime | None

failure_reason#

Failure reason of the cluster policy.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_arn#

ARN of the cluster where the cluster policy is applied.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

scheduler_config#

Cluster policy configuration. This policy is used for task prioritization and fair-share allocation. This helps prioritize critical workloads and distributes idle compute across entities.

Type:

sagemaker.core.shapes.shapes.SchedulerConfig | None

description#

Description of the cluster policy.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

Last modified time of the cluster policy.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

cluster_arn: str | PipelineVariable | None#
cluster_scheduler_config_arn: str | PipelineVariable | None#
cluster_scheduler_config_id: str | PipelineVariable#
cluster_scheduler_config_version: int | None#
classmethod create(name: str | PipelineVariable, cluster_arn: str | PipelineVariable, scheduler_config: SchedulerConfig, description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), dry_run: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ClusterSchedulerConfig | None[source]#

Create a ClusterSchedulerConfig resource

Parameters:
  • name – Name for the cluster policy.

  • cluster_arn – ARN of the cluster.

  • scheduler_config – Configuration about the monitoring schedule.

  • description – Description of the cluster policy.

  • tags – Tags of the cluster policy.

  • dry_run

  • session – Boto3 session.

  • region – Region name.

Returns:

The ClusterSchedulerConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete(dry_run: bool | None = Unassigned()) None[source]#

Delete a ClusterSchedulerConfig resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • DryRunOperation

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(cluster_scheduler_config_id: str | PipelineVariable, cluster_scheduler_config_version: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ClusterSchedulerConfig | None[source]#

Get a ClusterSchedulerConfig resource

Parameters:
  • cluster_scheduler_config_id – ID of the cluster policy.

  • cluster_scheduler_config_version – Version of the cluster policy.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ClusterSchedulerConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), cluster_arn: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ClusterSchedulerConfig][source]#

Get all ClusterSchedulerConfig resources

Parameters:
  • created_after – Filter for after this creation time. The input for this parameter is a Unix timestamp. To convert a date and time into a Unix timestamp, see EpochConverter.

  • created_before – Filter for before this creation time. The input for this parameter is a Unix timestamp. To convert a date and time into a Unix timestamp, see EpochConverter.

  • name_contains – Filter for name containing this string.

  • cluster_arn – Filter for ARN of the cluster.

  • status – Filter for status.

  • sort_by – Filter for sorting the list by a given value. For example, sort by name, creation time, or status.

  • sort_order – The order of the list. By default, listed in Descending order according to by SortBy. To change the list order, you can specify SortOrder to be Ascending.

  • next_token – If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

  • max_results – The maximum number of cluster policies to list.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ClusterSchedulerConfig resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str | PipelineVariable | None#
refresh() ClusterSchedulerConfig | None[source]#

Refresh a ClusterSchedulerConfig resource

Returns:

The ClusterSchedulerConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

scheduler_config: SchedulerConfig | None#
status: str | PipelineVariable | None#
update(target_version: int, scheduler_config: SchedulerConfig | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), dry_run: bool | None = Unassigned()) ClusterSchedulerConfig | None[source]#

Update a ClusterSchedulerConfig resource

Parameters:
  • target_version – Target version.

  • dry_run

Returns:

The ClusterSchedulerConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ClusterSchedulerConfig resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'CreateFailed', 'CreateRollbackFailed', 'Created', 'Updating', 'UpdateFailed', 'UpdateRollbackFailed', 'Updated', 'Deleting', 'DeleteFailed', 'DeleteRollbackFailed', 'Deleted'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ClusterSchedulerConfig resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.CodeRepository(*, code_repository_name: str | PipelineVariable, code_repository_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), git_config: GitConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource CodeRepository

code_repository_name#

The name of the Git repository.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

code_repository_arn#

The Amazon Resource Name (ARN) of the Git repository.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The date and time that the repository was created.

Type:

datetime.datetime | None

last_modified_time#

The date and time that the repository was last changed.

Type:

datetime.datetime | None

git_config#

Configuration details about the repository, including the URL where the repository is located, the default branch, and the Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that contains the credentials used to access the repository.

Type:

sagemaker.core.shapes.shapes.GitConfig | None

code_repository_arn: str | PipelineVariable | None#
code_repository_name: str | PipelineVariable#
classmethod create(code_repository_name: str | PipelineVariable, git_config: GitConfig, tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) CodeRepository | None[source]#

Create a CodeRepository resource

Parameters:
  • code_repository_name – The name of the Git repository. The name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).

  • git_config – Specifies details about the repository, including the URL where the repository is located, the default branch, and credentials to use to access the repository.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Returns:

The CodeRepository resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a CodeRepository resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get(code_repository_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) CodeRepository | None[source]#

Get a CodeRepository resource

Parameters:
  • code_repository_name – The name of the Git repository to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The CodeRepository resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[CodeRepository][source]#

Gets a list of the Git repositories in your account.

Parameters:
  • creation_time_after – A filter that returns only Git repositories that were created after the specified time.

  • creation_time_before – A filter that returns only Git repositories that were created before the specified time.

  • last_modified_time_after – A filter that returns only Git repositories that were last modified after the specified time.

  • last_modified_time_before – A filter that returns only Git repositories that were last modified before the specified time.

  • max_results – The maximum number of Git repositories to return in the response.

  • name_contains – A string in the Git repositories name. This filter returns only repositories whose name contains the specified string.

  • next_token – If the result of a ListCodeRepositoriesOutput request was truncated, the response includes a NextToken. To get the next set of Git repositories, use the token in the next request.

  • sort_by – The field to sort results by. The default is Name.

  • sort_order – The sort order for results. The default is Ascending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed CodeRepository.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
git_config: GitConfig | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() CodeRepository | None[source]#

Refresh a CodeRepository resource

Returns:

The CodeRepository resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

update(git_config: GitConfigForUpdate | None = Unassigned()) CodeRepository | None[source]#

Update a CodeRepository resource

Returns:

The CodeRepository resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

class sagemaker.core.resources.CompilationJob(*, compilation_job_name: str | PipelineVariable, compilation_job_arn: str | PipelineVariable | None = Unassigned(), compilation_job_status: str | PipelineVariable | None = Unassigned(), compilation_start_time: datetime | None = Unassigned(), compilation_end_time: datetime | None = Unassigned(), stopping_condition: StoppingCondition | None = Unassigned(), inference_image: str | PipelineVariable | None = Unassigned(), model_package_version_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), model_artifacts: ModelArtifacts | None = Unassigned(), model_digests: ModelDigests | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), input_config: InputConfig | None = Unassigned(), output_config: OutputConfig | None = Unassigned(), resource_config: NeoResourceConfig | None = Unassigned(), vpc_config: NeoVpcConfig | None = Unassigned(), derived_information: DerivedInformation | None = Unassigned())[source]#

Bases: Base

Class representing resource CompilationJob

compilation_job_name#

The name of the model compilation job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

compilation_job_arn#

The Amazon Resource Name (ARN) of the model compilation job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

compilation_job_status#

The status of the model compilation job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

stopping_condition#

Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.

Type:

sagemaker.core.shapes.shapes.StoppingCondition | None

creation_time#

The time that the model compilation job was created.

Type:

datetime.datetime | None

last_modified_time#

The time that the status of the model compilation job was last modified.

Type:

datetime.datetime | None

failure_reason#

If a model compilation job failed, the reason it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_artifacts#

Information about the location in Amazon S3 that has been configured for storing the model artifacts used in the compilation job.

Type:

sagemaker.core.shapes.shapes.ModelArtifacts | None

role_arn#

The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI assumes to perform the model compilation job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

input_config#

Information about the location in Amazon S3 of the input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.

Type:

sagemaker.core.shapes.shapes.InputConfig | None

output_config#

Information about the output location for the compiled model and the target device that the model runs on.

Type:

sagemaker.core.shapes.shapes.OutputConfig | None

compilation_start_time#

The time when the model compilation job started the CompilationJob instances. You are billed for the time between this timestamp and the timestamp in the CompilationEndTime field. In Amazon CloudWatch Logs, the start time might be later than this time. That’s because it takes time to download the compilation job, which depends on the size of the compilation job container.

Type:

datetime.datetime | None

compilation_end_time#

The time when the model compilation job on a compilation job instance ended. For a successful or stopped job, this is when the job’s model artifacts have finished uploading. For a failed job, this is when Amazon SageMaker AI detected that the job failed.

Type:

datetime.datetime | None

inference_image#

The inference image to use when compiling a model. Specify an image only if the target device is a cloud instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_package_version_arn#

The Amazon Resource Name (ARN) of the versioned model package that was provided to SageMaker Neo when you initiated a compilation job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_digests#

Provides a BLAKE2 hash value that identifies the compiled model artifacts in Amazon S3.

Type:

sagemaker.core.shapes.shapes.ModelDigests | None

resource_config#
Type:

sagemaker.core.shapes.shapes.NeoResourceConfig | None

vpc_config#

A VpcConfig object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see Protect Compilation Jobs by Using an Amazon Virtual Private Cloud.

Type:

sagemaker.core.shapes.shapes.NeoVpcConfig | None

derived_information#

Information that SageMaker Neo automatically derived about the model.

Type:

sagemaker.core.shapes.shapes.DerivedInformation | None

compilation_end_time: datetime | None#
compilation_job_arn: str | PipelineVariable | None#
compilation_job_name: str | PipelineVariable#
compilation_job_status: str | PipelineVariable | None#
compilation_start_time: datetime | None#
classmethod create(compilation_job_name: str | PipelineVariable, role_arn: str | PipelineVariable, output_config: OutputConfig, stopping_condition: StoppingCondition, model_package_version_arn: str | PipelineVariable | None = Unassigned(), input_config: InputConfig | None = Unassigned(), resource_config: NeoResourceConfig | None = Unassigned(), vpc_config: NeoVpcConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) CompilationJob | None[source]#

Create a CompilationJob resource

Parameters:
  • compilation_job_name – A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf. During model compilation, Amazon SageMaker AI needs your permission to: Read input data from an S3 bucket Write model artifacts to an S3 bucket Write logs to Amazon CloudWatch Logs Publish metrics to Amazon CloudWatch You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker AI Roles.

  • output_config – Provides information about the output location for the compiled model and the target device the model runs on.

  • stopping_condition – Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.

  • model_package_version_arn – The Amazon Resource Name (ARN) of a versioned model package. Provide either a ModelPackageVersionArn or an InputConfig object in the request syntax. The presence of both objects in the CreateCompilationJob request will return an exception.

  • input_config – Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.

  • resource_config

  • vpc_config – A VpcConfig object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see Protect Compilation Jobs by Using an Amazon Virtual Private Cloud.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Returns:

The CompilationJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a CompilationJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

derived_information: DerivedInformation | None#
failure_reason: str | PipelineVariable | None#
classmethod get(compilation_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) CompilationJob | None[source]#

Get a CompilationJob resource

Parameters:
  • compilation_job_name – The name of the model compilation job that you want information about.

  • session – Boto3 session.

  • region – Region name.

Returns:

The CompilationJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[CompilationJob][source]#

Get all CompilationJob resources

Parameters:
  • next_token – If the result of the previous ListCompilationJobs request was truncated, the response includes a NextToken. To retrieve the next set of model compilation jobs, use the token in the next request.

  • max_results – The maximum number of model compilation jobs to return in the response.

  • creation_time_after – A filter that returns the model compilation jobs that were created after a specified time.

  • creation_time_before – A filter that returns the model compilation jobs that were created before a specified time.

  • last_modified_time_after – A filter that returns the model compilation jobs that were modified after a specified time.

  • last_modified_time_before – A filter that returns the model compilation jobs that were modified before a specified time.

  • name_contains – A filter that returns the model compilation jobs whose name contains a specified string.

  • status_equals – A filter that retrieves model compilation jobs with a specific CompilationJobStatus status.

  • sort_by – The field by which to sort results. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed CompilationJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
inference_image: str | PipelineVariable | None#
input_config: InputConfig | None#
last_modified_time: datetime | None#
model_artifacts: ModelArtifacts | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_digests: ModelDigests | None#
model_package_version_arn: str | PipelineVariable | None#
output_config: OutputConfig | None#
populate_inputs_decorator()[source]#
refresh() CompilationJob | None[source]#

Refresh a CompilationJob resource

Returns:

The CompilationJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

resource_config: NeoResourceConfig | None#
role_arn: str | PipelineVariable | None#
stop() None[source]#

Stop a CompilationJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stopping_condition: StoppingCondition | None#
vpc_config: NeoVpcConfig | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a CompilationJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ComputeQuota(*, compute_quota_id: str | PipelineVariable, compute_quota_arn: str | PipelineVariable | None = Unassigned(), name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), compute_quota_version: int | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), cluster_arn: str | PipelineVariable | None = Unassigned(), compute_quota_config: ComputeQuotaConfig | None = Unassigned(), compute_quota_target: ComputeQuotaTarget | None = Unassigned(), activation_state: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource ComputeQuota

compute_quota_arn#

ARN of the compute allocation definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

compute_quota_id#

ID of the compute allocation definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

name#

Name of the compute allocation definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

compute_quota_version#

Version of the compute allocation definition.

Type:

int | None

status#

Status of the compute allocation definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

compute_quota_target#

The target entity to allocate compute resources to.

Type:

sagemaker.core.shapes.shapes.ComputeQuotaTarget | None

creation_time#

Creation time of the compute allocation configuration.

Type:

datetime.datetime | None

description#

Description of the compute allocation definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

Failure reason of the compute allocation definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_arn#

ARN of the cluster.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

compute_quota_config#

Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.

Type:

sagemaker.core.shapes.shapes.ComputeQuotaConfig | None

activation_state#

The state of the compute allocation being described. Use to enable or disable compute allocation. Default is Enabled.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

Last modified time of the compute allocation configuration.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

activation_state: str | PipelineVariable | None#
cluster_arn: str | PipelineVariable | None#
compute_quota_arn: str | PipelineVariable | None#
compute_quota_config: ComputeQuotaConfig | None#
compute_quota_id: str | PipelineVariable#
compute_quota_target: ComputeQuotaTarget | None#
compute_quota_version: int | None#
classmethod create(name: str | PipelineVariable, cluster_arn: str | PipelineVariable, compute_quota_config: ComputeQuotaConfig, compute_quota_target: ComputeQuotaTarget, description: str | PipelineVariable | None = Unassigned(), activation_state: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), dry_run: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ComputeQuota | None[source]#

Create a ComputeQuota resource

Parameters:
  • name – Name to the compute allocation definition.

  • cluster_arn – ARN of the cluster.

  • compute_quota_config – Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.

  • compute_quota_target – The target entity to allocate compute resources to.

  • description – Description of the compute allocation definition.

  • activation_state – The state of the compute allocation being described. Use to enable or disable compute allocation. Default is Enabled.

  • tags – Tags of the compute allocation definition.

  • dry_run

  • session – Boto3 session.

  • region – Region name.

Returns:

The ComputeQuota resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete(dry_run: bool | None = Unassigned()) None[source]#

Delete a ComputeQuota resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • DryRunOperation

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(compute_quota_id: str | PipelineVariable, compute_quota_version: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ComputeQuota | None[source]#

Get a ComputeQuota resource

Parameters:
  • compute_quota_id – ID of the compute allocation definition.

  • compute_quota_version – Version of the compute allocation definition.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ComputeQuota resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), cluster_arn: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ComputeQuota][source]#

Get all ComputeQuota resources

Parameters:
  • created_after – Filter for after this creation time. The input for this parameter is a Unix timestamp. To convert a date and time into a Unix timestamp, see EpochConverter.

  • created_before – Filter for before this creation time. The input for this parameter is a Unix timestamp. To convert a date and time into a Unix timestamp, see EpochConverter.

  • name_contains – Filter for name containing this string.

  • status – Filter for status.

  • cluster_arn – Filter for ARN of the cluster.

  • sort_by – Filter for sorting the list by a given value. For example, sort by name, creation time, or status.

  • sort_order – The order of the list. By default, listed in Descending order according to by SortBy. To change the list order, you can specify SortOrder to be Ascending.

  • next_token – If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

  • max_results – The maximum number of compute allocation definitions to list.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ComputeQuota resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str | PipelineVariable | None#
refresh() ComputeQuota | None[source]#

Refresh a ComputeQuota resource

Returns:

The ComputeQuota resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

status: str | PipelineVariable | None#
update(target_version: int, compute_quota_config: ComputeQuotaConfig | None = Unassigned(), compute_quota_target: ComputeQuotaTarget | None = Unassigned(), activation_state: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), dry_run: bool | None = Unassigned()) ComputeQuota | None[source]#

Update a ComputeQuota resource

Parameters:
  • target_version – Target version.

  • dry_run

Returns:

The ComputeQuota resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • DryRunOperation

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ComputeQuota resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'CreateFailed', 'CreateRollbackFailed', 'Created', 'Updating', 'UpdateFailed', 'UpdateRollbackFailed', 'Updated', 'Deleting', 'DeleteFailed', 'DeleteRollbackFailed', 'Deleted'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ComputeQuota resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.Context(*, context_name: str | PipelineVariable, context_arn: str | PipelineVariable | None = Unassigned(), source: ContextSource | None = Unassigned(), context_type: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), lineage_group_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Context

context_name#

The name of the context.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

context_arn#

The Amazon Resource Name (ARN) of the context.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source#

The source of the context.

Type:

sagemaker.core.shapes.shapes.ContextSource | None

context_type#

The type of the context.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

The description of the context.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

properties#

A list of the context’s properties.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

creation_time#

When the context was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

When the context was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

lineage_group_arn#

The Amazon Resource Name (ARN) of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

context_arn: str | PipelineVariable | None#
context_name: str | PipelineVariable#
context_type: str | PipelineVariable | None#
classmethod create(context_name: str | PipelineVariable, source: ContextSource, context_type: str | PipelineVariable, description: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Context | None[source]#

Create a Context resource

Parameters:
  • context_name – The name of the context. Must be unique to your account in an Amazon Web Services Region.

  • source – The source type, ID, and URI.

  • context_type – The context type.

  • description – The description of the context.

  • properties – A list of properties to add to the context.

  • tags – A list of tags to apply to the context.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Context resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Context resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
classmethod get(context_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Context | None[source]#

Get a Context resource

Parameters:
  • context_name – The name of the context to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Context resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(source_uri: str | PipelineVariable | None = Unassigned(), context_type: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Context][source]#

Get all Context resources

Parameters:
  • source_uri – A filter that returns only contexts with the specified source URI.

  • context_type – A filter that returns only contexts of the specified type.

  • created_after – A filter that returns only contexts created on or after the specified time.

  • created_before – A filter that returns only contexts created on or before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • next_token – If the previous call to ListContexts didn’t return the full set of contexts, the call returns a token for getting the next set of contexts.

  • max_results – The maximum number of contexts to return in the response. The default value is 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Context resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
lineage_group_arn: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
refresh() Context | None[source]#

Refresh a Context resource

Returns:

The Context resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

source: ContextSource | None#
update(description: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), properties_to_remove: List[str | PipelineVariable] | None = Unassigned()) Context | None[source]#

Update a Context resource

Parameters:

properties_to_remove – A list of properties to remove.

Returns:

The Context resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.ContextInternal(*, context_name: str | PipelineVariable | object, source: ContextSource, context_type: str | PipelineVariable, customer_details: CustomerDetails, creation_time: datetime | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), context_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ContextInternal

context_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

source#
Type:

sagemaker.core.shapes.shapes.ContextSource

context_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

creation_time#
Type:

datetime.datetime | None

description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

properties#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

context_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

context_arn: str | PipelineVariable | None#
context_name: str | PipelineVariable | object#
context_type: str | PipelineVariable#
classmethod create(context_name: str | PipelineVariable | object, source: ContextSource, context_type: str | PipelineVariable, customer_details: CustomerDetails, creation_time: datetime | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) ContextInternal | None[source]#

Create a ContextInternal resource

Parameters:
  • context_name

  • source

  • context_type

  • customer_details

  • creation_time

  • description

  • properties

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The ContextInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails#
description: str | PipelineVariable | None#
get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
source: ContextSource#
tags: List[Tag] | None#
class sagemaker.core.resources.CrossAccountTrainingJob(*, training_job_name: str | PipelineVariable | object, algorithm_specification: AlgorithmSpecification, cross_account_role_arn: str | PipelineVariable, input_data_config: List[Channel], output_data_config: OutputDataConfig, resource_config: ResourceConfig, stopping_condition: StoppingCondition, training_job_arn: str | PipelineVariable, hyper_parameters: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), source_arn: str | PipelineVariable | None = Unassigned(), source_account: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource CrossAccountTrainingJob

training_job_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

algorithm_specification#
Type:

sagemaker.core.shapes.shapes.AlgorithmSpecification

cross_account_role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

input_data_config#
Type:

List[sagemaker.core.shapes.shapes.Channel]

output_data_config#
Type:

sagemaker.core.shapes.shapes.OutputDataConfig

resource_config#
Type:

sagemaker.core.shapes.shapes.ResourceConfig

stopping_condition#
Type:

sagemaker.core.shapes.shapes.StoppingCondition

training_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hyper_parameters#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

vpc_config#
Type:

sagemaker.core.shapes.shapes.VpcConfig | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

environment#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

source_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source_account#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

algorithm_specification: AlgorithmSpecification#
classmethod create(training_job_name: str | PipelineVariable | object, algorithm_specification: AlgorithmSpecification, cross_account_role_arn: str | PipelineVariable, input_data_config: List[Channel], output_data_config: OutputDataConfig, resource_config: ResourceConfig, stopping_condition: StoppingCondition, hyper_parameters: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), source_arn: str | PipelineVariable | None = Unassigned(), source_account: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) CrossAccountTrainingJob | None[source]#

Create a CrossAccountTrainingJob resource

Parameters:
  • training_job_name

  • algorithm_specification

  • cross_account_role_arn

  • input_data_config

  • output_data_config

  • resource_config

  • stopping_condition

  • hyper_parameters

  • vpc_config

  • tags

  • environment

  • source_arn

  • source_account

  • session – Boto3 session.

  • region – Region name.

Returns:

The CrossAccountTrainingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

cross_account_role_arn: str | PipelineVariable#
environment: Dict[str | PipelineVariable, str | PipelineVariable] | None#
get_name() str[source]#
hyper_parameters: Dict[str | PipelineVariable, str | PipelineVariable] | None#
input_data_config: List[Channel]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_data_config: OutputDataConfig#
resource_config: ResourceConfig#
source_account: str | PipelineVariable | None#
source_arn: str | PipelineVariable | None#
stopping_condition: StoppingCondition#
tags: List[Tag] | None#
training_job_arn: str | PipelineVariable#
training_job_name: str | PipelineVariable | object#
vpc_config: VpcConfig | None#
class sagemaker.core.resources.CustomMonitoringJobDefinition(*, job_definition_name: str | PipelineVariable, job_definition_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), custom_monitoring_app_specification: CustomMonitoringAppSpecification | None = Unassigned(), custom_monitoring_job_input: CustomMonitoringJobInput | None = Unassigned(), custom_monitoring_job_output_config: MonitoringOutputConfig | None = Unassigned(), job_resources: MonitoringResources | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned())[source]#

Bases: Base

Class representing resource CustomMonitoringJobDefinition

job_definition_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_definition_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#
Type:

datetime.datetime | None

custom_monitoring_app_specification#
Type:

sagemaker.core.shapes.shapes.CustomMonitoringAppSpecification | None

custom_monitoring_job_input#
Type:

sagemaker.core.shapes.shapes.CustomMonitoringJobInput | None

job_resources#
Type:

sagemaker.core.shapes.shapes.MonitoringResources | None

role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

custom_monitoring_job_output_config#
Type:

sagemaker.core.shapes.shapes.MonitoringOutputConfig | None

network_config#
Type:

sagemaker.core.shapes.shapes.MonitoringNetworkConfig | None

stopping_condition#
Type:

sagemaker.core.shapes.shapes.MonitoringStoppingCondition | None

classmethod create(job_definition_name: str | PipelineVariable, custom_monitoring_app_specification: CustomMonitoringAppSpecification, custom_monitoring_job_input: CustomMonitoringJobInput, job_resources: MonitoringResources, role_arn: str | PipelineVariable, custom_monitoring_job_output_config: MonitoringOutputConfig | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) CustomMonitoringJobDefinition | None[source]#

Create a CustomMonitoringJobDefinition resource

Parameters:
  • job_definition_name

  • custom_monitoring_app_specification

  • custom_monitoring_job_input

  • job_resources

  • role_arn

  • custom_monitoring_job_output_config

  • network_config

  • stopping_condition

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The CustomMonitoringJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
custom_monitoring_app_specification: CustomMonitoringAppSpecification | None#
custom_monitoring_job_input: CustomMonitoringJobInput | None#
custom_monitoring_job_output_config: MonitoringOutputConfig | None#
delete() None[source]#

Delete a CustomMonitoringJobDefinition resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(job_definition_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) CustomMonitoringJobDefinition | None[source]#

Get a CustomMonitoringJobDefinition resource

Parameters:
  • job_definition_name

  • session – Boto3 session.

  • region – Region name.

Returns:

The CustomMonitoringJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[CustomMonitoringJobDefinition][source]#

Get all CustomMonitoringJobDefinition resources

Parameters:
  • endpoint_name

  • sort_by

  • sort_order

  • next_token

  • max_results

  • name_contains

  • creation_time_before

  • creation_time_after

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed CustomMonitoringJobDefinition resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
job_definition_arn: str | PipelineVariable | None#
job_definition_name: str | PipelineVariable#
job_resources: MonitoringResources | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_config: MonitoringNetworkConfig | None#
refresh() CustomMonitoringJobDefinition | None[source]#

Refresh a CustomMonitoringJobDefinition resource

Returns:

The CustomMonitoringJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stopping_condition: MonitoringStoppingCondition | None#
class sagemaker.core.resources.DataQualityJobDefinition(*, job_definition_name: str | PipelineVariable, job_definition_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), data_quality_baseline_config: DataQualityBaselineConfig | None = Unassigned(), data_quality_app_specification: DataQualityAppSpecification | None = Unassigned(), data_quality_job_input: DataQualityJobInput | None = Unassigned(), data_quality_job_output_config: MonitoringOutputConfig | None = Unassigned(), job_resources: MonitoringResources | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned())[source]#

Bases: Base

Class representing resource DataQualityJobDefinition

job_definition_arn#

The Amazon Resource Name (ARN) of the data quality monitoring job definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_definition_name#

The name of the data quality monitoring job definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The time that the data quality monitoring job definition was created.

Type:

datetime.datetime | None

data_quality_app_specification#

Information about the container that runs the data quality monitoring job.

Type:

sagemaker.core.shapes.shapes.DataQualityAppSpecification | None

data_quality_job_input#

The list of inputs for the data quality monitoring job. Currently endpoints are supported.

Type:

sagemaker.core.shapes.shapes.DataQualityJobInput | None

data_quality_job_output_config#
Type:

sagemaker.core.shapes.shapes.MonitoringOutputConfig | None

job_resources#
Type:

sagemaker.core.shapes.shapes.MonitoringResources | None

role_arn#

The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

data_quality_baseline_config#

The constraints and baselines for the data quality monitoring job definition.

Type:

sagemaker.core.shapes.shapes.DataQualityBaselineConfig | None

network_config#

The networking configuration for the data quality monitoring job.

Type:

sagemaker.core.shapes.shapes.MonitoringNetworkConfig | None

stopping_condition#
Type:

sagemaker.core.shapes.shapes.MonitoringStoppingCondition | None

classmethod create(job_definition_name: str | PipelineVariable, data_quality_app_specification: DataQualityAppSpecification, data_quality_job_input: DataQualityJobInput, data_quality_job_output_config: MonitoringOutputConfig, job_resources: MonitoringResources, role_arn: str | PipelineVariable, data_quality_baseline_config: DataQualityBaselineConfig | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) DataQualityJobDefinition | None[source]#

Create a DataQualityJobDefinition resource

Parameters:
  • job_definition_name – The name for the monitoring job definition.

  • data_quality_app_specification – Specifies the container that runs the monitoring job.

  • data_quality_job_input – A list of inputs for the monitoring job. Currently endpoints are supported as monitoring inputs.

  • data_quality_job_output_config

  • job_resources

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.

  • data_quality_baseline_config – Configures the constraints and baselines for the monitoring job.

  • network_config – Specifies networking configuration for the monitoring job.

  • stopping_condition

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The DataQualityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
data_quality_app_specification: DataQualityAppSpecification | None#
data_quality_baseline_config: DataQualityBaselineConfig | None#
data_quality_job_input: DataQualityJobInput | None#
data_quality_job_output_config: MonitoringOutputConfig | None#
delete() None[source]#

Delete a DataQualityJobDefinition resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(job_definition_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) DataQualityJobDefinition | None[source]#

Get a DataQualityJobDefinition resource

Parameters:
  • job_definition_name – The name of the data quality monitoring job definition to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The DataQualityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[DataQualityJobDefinition][source]#

Get all DataQualityJobDefinition resources

Parameters:
  • endpoint_name – A filter that lists the data quality job definitions associated with the specified endpoint.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – Whether to sort the results in Ascending or Descending order. The default is Descending.

  • next_token – If the result of the previous ListDataQualityJobDefinitions request was truncated, the response includes a NextToken. To retrieve the next set of transform jobs, use the token in the next request.&gt;

  • max_results – The maximum number of data quality monitoring job definitions to return in the response.

  • name_contains – A string in the data quality monitoring job definition name. This filter returns only data quality monitoring job definitions whose name contains the specified string.

  • creation_time_before – A filter that returns only data quality monitoring job definitions created before the specified time.

  • creation_time_after – A filter that returns only data quality monitoring job definitions created after the specified time.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed DataQualityJobDefinition resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
job_definition_arn: str | PipelineVariable | None#
job_definition_name: str | PipelineVariable#
job_resources: MonitoringResources | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_config: MonitoringNetworkConfig | None#
populate_inputs_decorator()[source]#
refresh() DataQualityJobDefinition | None[source]#

Refresh a DataQualityJobDefinition resource

Returns:

The DataQualityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stopping_condition: MonitoringStoppingCondition | None#
class sagemaker.core.resources.Device(*, device_name: str | PipelineVariable, device_fleet_name: str | PipelineVariable, device_arn: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), iot_thing_name: str | PipelineVariable | None = Unassigned(), registration_time: datetime | None = Unassigned(), latest_heartbeat: datetime | None = Unassigned(), models: List[EdgeModel] | None = Unassigned(), max_models: int | None = Unassigned(), next_token: str | PipelineVariable | None = Unassigned(), agent_version: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Device

device_name#

The unique identifier of the device.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

device_fleet_name#

The name of the fleet the device belongs to.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

registration_time#

The timestamp of the last registration or de-reregistration.

Type:

datetime.datetime | None

device_arn#

The Amazon Resource Name (ARN) of the device.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

A description of the device.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

iot_thing_name#

The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

latest_heartbeat#

The last heartbeat received from the device.

Type:

datetime.datetime | None

models#

Models on the device.

Type:

List[sagemaker.core.shapes.shapes.EdgeModel] | None

max_models#

The maximum number of models.

Type:

int | None

next_token#

The response from the last list when returning a list large enough to need tokening.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

agent_version#

Edge Manager agent version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

agent_version: str | PipelineVariable | None#
description: str | PipelineVariable | None#
device_arn: str | PipelineVariable | None#
device_fleet_name: str | PipelineVariable#
device_name: str | PipelineVariable#
classmethod get(device_name: str | PipelineVariable, device_fleet_name: str | PipelineVariable, next_token: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Device | None[source]#

Get a Device resource

Parameters:
  • device_name – The unique ID of the device.

  • device_fleet_name – The name of the fleet the devices belong to.

  • next_token – Next token of device description.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Device resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(latest_heartbeat_after: datetime | None = Unassigned(), model_name: str | PipelineVariable | None = Unassigned(), device_fleet_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Device][source]#

Get all Device resources

Parameters:
  • next_token – The response from the last list when returning a list large enough to need tokening.

  • max_results – Maximum number of results to select.

  • latest_heartbeat_after – Select fleets where the job was updated after X

  • model_name – A filter that searches devices that contains this name in any of their models.

  • device_fleet_name – Filter for fleets containing this name in their device fleet name.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Device resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
iot_thing_name: str | PipelineVariable | None#
latest_heartbeat: datetime | None#
max_models: int | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

models: List[EdgeModel] | None#
next_token: str | PipelineVariable | None#
refresh() Device | None[source]#

Refresh a Device resource

Returns:

The Device resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

registration_time: datetime | None#
class sagemaker.core.resources.DeviceFleet(*, device_fleet_name: str | PipelineVariable, device_fleet_arn: str | PipelineVariable | None = Unassigned(), output_config: EdgeOutputConfig | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), iot_role_alias: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource DeviceFleet

device_fleet_name#

The name of the fleet.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

device_fleet_arn#

The The Amazon Resource Name (ARN) of the fleet.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

output_config#

The output configuration for storing sampled data.

Type:

sagemaker.core.shapes.shapes.EdgeOutputConfig | None

creation_time#

Timestamp of when the device fleet was created.

Type:

datetime.datetime | None

last_modified_time#

Timestamp of when the device fleet was last updated.

Type:

datetime.datetime | None

description#

A description of the fleet.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

role_arn#

The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet of Things (IoT).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

iot_role_alias#

The Amazon Resource Name (ARN) alias created in Amazon Web Services Internet of Things (IoT).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(device_fleet_name: str | PipelineVariable, output_config: EdgeOutputConfig, role_arn: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), enable_iot_role_alias: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) DeviceFleet | None[source]#

Create a DeviceFleet resource

Parameters:
  • device_fleet_name – The name of the fleet that the device belongs to.

  • output_config – The output configuration for storing sample data collected by the fleet.

  • role_arn – The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet of Things (IoT).

  • description – A description of the fleet.

  • tags – Creates tags for the specified fleet.

  • enable_iot_role_alias – Whether to create an Amazon Web Services IoT Role Alias during device fleet creation. The name of the role alias generated will match this pattern: “SageMakerEdge-{DeviceFleetName}”. For example, if your device fleet is called “demo-fleet”, the name of the role alias will be “SageMakerEdge-demo-fleet”.

  • session – Boto3 session.

  • region – Region name.

Returns:

The DeviceFleet resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a DeviceFleet resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

deregister_devices(device_names: List[str | PipelineVariable], session: Session | None = None, region: str | None = None) None[source]#

Deregisters the specified devices.

Parameters:
  • device_names – The unique IDs of the devices.

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

description: str | PipelineVariable | None#
device_fleet_arn: str | PipelineVariable | None#
device_fleet_name: str | PipelineVariable#
classmethod get(device_fleet_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) DeviceFleet | None[source]#

Get a DeviceFleet resource

Parameters:
  • device_fleet_name – The name of the fleet.

  • session – Boto3 session.

  • region – Region name.

Returns:

The DeviceFleet resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[DeviceFleet][source]#

Get all DeviceFleet resources

Parameters:
  • next_token – The response from the last list when returning a list large enough to need tokening.

  • max_results – The maximum number of results to select.

  • creation_time_after – Filter fleets where packaging job was created after specified time.

  • creation_time_before – Filter fleets where the edge packaging job was created before specified time.

  • last_modified_time_after – Select fleets where the job was updated after X

  • last_modified_time_before – Select fleets where the job was updated before X

  • name_contains – Filter for fleets containing this name in their fleet device name.

  • sort_by – The column to sort by.

  • sort_order – What direction to sort in.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed DeviceFleet resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
get_report(session: Session | None = None, region: str | None = None) GetDeviceFleetReportResponse | None[source]#

Describes a fleet.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

GetDeviceFleetReportResponse

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

iot_role_alias: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_config: EdgeOutputConfig | None#
populate_inputs_decorator()[source]#
refresh() DeviceFleet | None[source]#

Refresh a DeviceFleet resource

Returns:

The DeviceFleet resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

register_devices(devices: List[Device], tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Register devices.

Parameters:
  • devices – A list of devices to register with SageMaker Edge Manager.

  • tags – The tags associated with devices.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

role_arn: str | PipelineVariable | None#
update(output_config: EdgeOutputConfig, role_arn: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), enable_iot_role_alias: bool | None = Unassigned()) DeviceFleet | None[source]#

Update a DeviceFleet resource

Parameters:

enable_iot_role_alias – Whether to create an Amazon Web Services IoT Role Alias during device fleet creation. The name of the role alias generated will match this pattern: “SageMakerEdge-{DeviceFleetName}”. For example, if your device fleet is called “demo-fleet”, the name of the role alias will be “SageMakerEdge-demo-fleet”.

Returns:

The DeviceFleet resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

update_devices(devices: List[Device], session: Session | None = None, region: str | None = None) None[source]#

Updates one or more devices in a fleet.

Parameters:
  • devices – List of devices to register with Edge Manager agent.

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

class sagemaker.core.resources.Domain(*, domain_id: str | PipelineVariable, domain_arn: str | PipelineVariable | None = Unassigned(), domain_name: str | PipelineVariable | None = Unassigned(), home_efs_file_system_id: str | PipelineVariable | None = Unassigned(), single_sign_on_managed_application_instance_id: str | PipelineVariable | None = Unassigned(), single_sign_on_application_arn: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), security_group_id_for_domain_boundary: str | PipelineVariable | None = Unassigned(), auth_mode: str | PipelineVariable | None = Unassigned(), default_user_settings: UserSettings | None = Unassigned(), domain_settings: DomainSettings | None = Unassigned(), app_network_access: str | PipelineVariable | None = Unassigned(), app_network_access_type: str | PipelineVariable | None = Unassigned(), home_efs_file_system_kms_key_id: str | PipelineVariable | None = Unassigned(), subnet_ids: List[str | PipelineVariable] | None = Unassigned(), url: str | PipelineVariable | None = Unassigned(), vpc_id: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), app_security_group_management: str | PipelineVariable | None = Unassigned(), app_storage_type: str | PipelineVariable | None = Unassigned(), tag_propagation: str | PipelineVariable | None = Unassigned(), default_space_settings: DefaultSpaceSettings | None = Unassigned())[source]#

Bases: Base

Class representing resource Domain

domain_arn#

The domain’s Amazon Resource Name (ARN).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

domain_id#

The domain ID.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

domain_name#

The domain name.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

home_efs_file_system_id#

The ID of the Amazon Elastic File System managed by this Domain.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

single_sign_on_managed_application_instance_id#

The IAM Identity Center managed application instance ID.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

single_sign_on_application_arn#

The ARN of the application managed by SageMaker AI in IAM Identity Center. This value is only returned for domains created after October 1, 2023.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The creation time.

Type:

datetime.datetime | None

last_modified_time#

The last modified time.

Type:

datetime.datetime | None

failure_reason#

The failure reason.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

security_group_id_for_domain_boundary#

The ID of the security group that authorizes traffic between the RSessionGateway apps and the RStudioServerPro app.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auth_mode#

The domain’s authentication mode.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

default_user_settings#

Settings which are applied to UserProfiles in this domain if settings are not explicitly specified in a given UserProfile.

Type:

sagemaker.core.shapes.shapes.UserSettings | None

domain_settings#

A collection of Domain settings.

Type:

sagemaker.core.shapes.shapes.DomainSettings | None

app_network_access#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_network_access_type#

Specifies the VPC used for non-EFS traffic. The default value is PublicInternetOnly. PublicInternetOnly - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access VpcOnly - All traffic is through the specified VPC and subnets

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

home_efs_file_system_kms_key_id#

Use KmsKeyId.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

subnet_ids#

The VPC subnets that the domain uses for communication.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

url#

The domain’s URL.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

vpc_id#

The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

kms_key_id#

The Amazon Web Services KMS customer managed key used to encrypt the EFS volume attached to the domain.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_security_group_management#

The entity that creates and manages the required security groups for inter-app communication in VPCOnly mode. Required when CreateDomain.AppNetworkAccessType is VPCOnly and DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is provided.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_storage_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tag_propagation#

Indicates whether custom tag propagation is supported for the domain.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

default_space_settings#

The default settings for shared spaces that users create in the domain.

Type:

sagemaker.core.shapes.shapes.DefaultSpaceSettings | None

app_network_access: str | PipelineVariable | None#
app_network_access_type: str | PipelineVariable | None#
app_security_group_management: str | PipelineVariable | None#
app_storage_type: str | PipelineVariable | None#
auth_mode: str | PipelineVariable | None#
classmethod create(domain_name: str | PipelineVariable, auth_mode: str | PipelineVariable, default_user_settings: UserSettings, domain_settings: DomainSettings | None = Unassigned(), subnet_ids: List[str | PipelineVariable] | None = Unassigned(), vpc_id: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), app_network_access: str | PipelineVariable | None = Unassigned(), app_network_access_type: str | PipelineVariable | None = Unassigned(), home_efs_file_system_kms_key_id: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), app_security_group_management: str | PipelineVariable | None = Unassigned(), app_storage_type: str | PipelineVariable | None = Unassigned(), tag_propagation: str | PipelineVariable | None = Unassigned(), default_space_settings: DefaultSpaceSettings | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Domain | None[source]#

Create a Domain resource

Parameters:
  • domain_name – A name for the domain.

  • auth_mode – The mode of authentication that members use to access the domain.

  • default_user_settings – The default settings to use to create a user profile when UserSettings isn’t specified in the call to the CreateUserProfile API. SecurityGroups is aggregated when specified in both calls. For all other settings in UserSettings, the values specified in CreateUserProfile take precedence over those specified in CreateDomain.

  • domain_settings – A collection of Domain settings.

  • subnet_ids – The VPC subnets that the domain uses for communication. The field is optional when the AppNetworkAccessType parameter is set to PublicInternetOnly for domains created from Amazon SageMaker Unified Studio.

  • vpc_id – The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication. The field is optional when the AppNetworkAccessType parameter is set to PublicInternetOnly for domains created from Amazon SageMaker Unified Studio.

  • tags – Tags to associated with the Domain. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the Search API. Tags that you specify for the Domain are also added to all Apps that the Domain launches.

  • app_network_access

  • app_network_access_type – Specifies the VPC used for non-EFS traffic. The default value is PublicInternetOnly. PublicInternetOnly - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access VpcOnly - All traffic is through the specified VPC and subnets

  • home_efs_file_system_kms_key_id – Use KmsKeyId.

  • kms_key_id – SageMaker AI uses Amazon Web Services KMS to encrypt EFS and EBS volumes attached to the domain with an Amazon Web Services managed key by default. For more control, specify a customer managed key.

  • app_security_group_management – The entity that creates and manages the required security groups for inter-app communication in VPCOnly mode. Required when CreateDomain.AppNetworkAccessType is VPCOnly and DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is provided. If setting up the domain for use with RStudio, this value must be set to Service.

  • app_storage_type

  • tag_propagation – Indicates whether custom tag propagation is supported for the domain. Defaults to DISABLED.

  • default_space_settings – The default settings for shared spaces that users create in the domain.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Domain resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
default_space_settings: DefaultSpaceSettings | None#
default_user_settings: UserSettings | None#
delete(retention_policy: RetentionPolicy | None = Unassigned()) None[source]#

Delete a Domain resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

domain_arn: str | PipelineVariable | None#
domain_id: str | PipelineVariable#
domain_name: str | PipelineVariable | None#
domain_settings: DomainSettings | None#
failure_reason: str | PipelineVariable | None#
classmethod get(domain_id: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Domain | None[source]#

Get a Domain resource

Parameters:
  • domain_id – The domain ID.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Domain resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Domain][source]#

Get all Domain resources.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Domain resources.

get_name() str[source]#
home_efs_file_system_id: str | PipelineVariable | None#
home_efs_file_system_kms_key_id: str | PipelineVariable | None#
kms_key_id: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() Domain | None[source]#

Refresh a Domain resource

Returns:

The Domain resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

security_group_id_for_domain_boundary: str | PipelineVariable | None#
single_sign_on_application_arn: str | PipelineVariable | None#
single_sign_on_managed_application_instance_id: str | PipelineVariable | None#
status: str | PipelineVariable | None#
subnet_ids: List[str | PipelineVariable] | None#
tag_propagation: str | PipelineVariable | None#
update(default_user_settings: UserSettings | None = Unassigned(), domain_settings_for_update: DomainSettingsForUpdate | None = Unassigned(), app_security_group_management: str | PipelineVariable | None = Unassigned(), default_space_settings: DefaultSpaceSettings | None = Unassigned(), subnet_ids: List[str | PipelineVariable] | None = Unassigned(), app_network_access_type: str | PipelineVariable | None = Unassigned(), tag_propagation: str | PipelineVariable | None = Unassigned(), vpc_id: str | PipelineVariable | None = Unassigned()) Domain | None[source]#

Update a Domain resource

Parameters:

domain_settings_for_update – A collection of DomainSettings configuration values to update.

Returns:

The Domain resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

url: str | PipelineVariable | None#
vpc_id: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Domain resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Deleting', 'Failed', 'InService', 'Pending', 'Updating', 'Update_Failed', 'Delete_Failed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Domain resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.EdgeDeploymentPlan(*, edge_deployment_plan_name: str | PipelineVariable, edge_deployment_plan_arn: str | PipelineVariable | None = Unassigned(), model_configs: List[EdgeDeploymentModelConfig] | None = Unassigned(), device_fleet_name: str | PipelineVariable | None = Unassigned(), edge_deployment_success: int | None = Unassigned(), edge_deployment_pending: int | None = Unassigned(), edge_deployment_failed: int | None = Unassigned(), stages: List[DeploymentStageStatusSummary] | None = Unassigned(), next_token: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource EdgeDeploymentPlan

edge_deployment_plan_arn#

The ARN of edge deployment plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

edge_deployment_plan_name#

The name of the edge deployment plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

model_configs#

List of models associated with the edge deployment plan.

Type:

List[sagemaker.core.shapes.shapes.EdgeDeploymentModelConfig] | None

device_fleet_name#

The device fleet used for this edge deployment plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

stages#

List of stages in the edge deployment plan.

Type:

List[sagemaker.core.shapes.shapes.DeploymentStageStatusSummary] | None

edge_deployment_success#

The number of edge devices with the successful deployment.

Type:

int | None

edge_deployment_pending#

The number of edge devices yet to pick up deployment, or in progress.

Type:

int | None

edge_deployment_failed#

The number of edge devices that failed the deployment.

Type:

int | None

next_token#

Token to use when calling the next set of stages in the edge deployment plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time when the edge deployment plan was created.

Type:

datetime.datetime | None

last_modified_time#

The time when the edge deployment plan was last updated.

Type:

datetime.datetime | None

classmethod create(edge_deployment_plan_name: str | PipelineVariable, model_configs: List[EdgeDeploymentModelConfig], device_fleet_name: str | PipelineVariable | object, stages: List[DeploymentStage] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) EdgeDeploymentPlan | None[source]#

Create a EdgeDeploymentPlan resource

Parameters:
  • edge_deployment_plan_name – The name of the edge deployment plan.

  • model_configs – List of models associated with the edge deployment plan.

  • device_fleet_name – The device fleet used for this edge deployment plan.

  • stages – List of stages of the edge deployment plan. The number of stages is limited to 10 per deployment.

  • tags – List of tags with which to tag the edge deployment plan.

  • session – Boto3 session.

  • region – Region name.

Returns:

The EdgeDeploymentPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

create_stage(session: Session | None = None, region: str | None = None) None[source]#

Creates a new stage in an existing edge deployment plan.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

creation_time: datetime | None#
delete() None[source]#

Delete a EdgeDeploymentPlan resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

delete_stage(stage_name: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Delete a stage in an edge deployment plan if (and only if) the stage is inactive.

Parameters:
  • stage_name – The name of the stage.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

device_fleet_name: str | PipelineVariable | None#
edge_deployment_failed: int | None#
edge_deployment_pending: int | None#
edge_deployment_plan_arn: str | PipelineVariable | None#
edge_deployment_plan_name: str | PipelineVariable#
edge_deployment_success: int | None#
classmethod get(edge_deployment_plan_name: str | PipelineVariable, next_token: str | PipelineVariable | None = Unassigned(), max_results: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) EdgeDeploymentPlan | None[source]#

Get a EdgeDeploymentPlan resource

Parameters:
  • edge_deployment_plan_name – The name of the deployment plan to describe.

  • next_token – If the edge deployment plan has enough stages to require tokening, then this is the response from the last list of stages returned.

  • max_results – The maximum number of results to select (50 by default).

  • session – Boto3 session.

  • region – Region name.

Returns:

The EdgeDeploymentPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), device_fleet_name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[EdgeDeploymentPlan][source]#

Get all EdgeDeploymentPlan resources

Parameters:
  • next_token – The response from the last list when returning a list large enough to need tokening.

  • max_results – The maximum number of results to select (50 by default).

  • creation_time_after – Selects edge deployment plans created after this time.

  • creation_time_before – Selects edge deployment plans created before this time.

  • last_modified_time_after – Selects edge deployment plans that were last updated after this time.

  • last_modified_time_before – Selects edge deployment plans that were last updated before this time.

  • name_contains – Selects edge deployment plans with names containing this name.

  • device_fleet_name_contains – Selects edge deployment plans with a device fleet name containing this name.

  • sort_by – The column by which to sort the edge deployment plans. Can be one of NAME, DEVICEFLEETNAME, CREATIONTIME, LASTMODIFIEDTIME.

  • sort_order – The direction of the sorting (ascending or descending).

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed EdgeDeploymentPlan resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_stage_devices(stage_name: str | PipelineVariable, exclude_devices_deployed_in_other_stage: bool | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[DeviceDeploymentSummary][source]#

Lists devices allocated to the stage, containing detailed device information and deployment status.

Parameters:
  • stage_name – The name of the stage in the deployment.

  • max_results – The maximum number of requests to select.

  • exclude_devices_deployed_in_other_stage – Toggle for excluding devices deployed in other stages.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed DeviceDeploymentSummary.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_configs: List[EdgeDeploymentModelConfig] | None#
next_token: str | PipelineVariable | None#
refresh(max_results: int | None = Unassigned()) EdgeDeploymentPlan | None[source]#

Refresh a EdgeDeploymentPlan resource

Returns:

The EdgeDeploymentPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stages: List[DeploymentStageStatusSummary] | None#
start_stage(stage_name: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Starts a stage in an edge deployment plan.

Parameters:
  • stage_name – The name of the stage to start.

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

stop_stage(stage_name: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Stops a stage in an edge deployment plan.

Parameters:
  • stage_name – The name of the stage to stop.

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

class sagemaker.core.resources.EdgePackagingJob(*, edge_packaging_job_name: str | PipelineVariable, edge_packaging_job_arn: str | PipelineVariable | None = Unassigned(), compilation_job_name: str | PipelineVariable | None = Unassigned(), model_name: str | PipelineVariable | None = Unassigned(), model_version: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), output_config: EdgeOutputConfig | None = Unassigned(), resource_key: str | PipelineVariable | None = Unassigned(), edge_packaging_job_status: str | PipelineVariable | None = Unassigned(), edge_packaging_job_status_message: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), model_artifact: str | PipelineVariable | None = Unassigned(), model_signature: str | PipelineVariable | None = Unassigned(), preset_deployment_output: EdgePresetDeploymentOutput | None = Unassigned())[source]#

Bases: Base

Class representing resource EdgePackagingJob

edge_packaging_job_arn#

The Amazon Resource Name (ARN) of the edge packaging job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

edge_packaging_job_name#

The name of the edge packaging job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

edge_packaging_job_status#

The current status of the packaging job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

compilation_job_name#

The name of the SageMaker Neo compilation job that is used to locate model artifacts that are being packaged.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_name#

The name of the model.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_version#

The version of the model.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

role_arn#

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

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

output_config#

The output configuration for the edge packaging job.

Type:

sagemaker.core.shapes.shapes.EdgeOutputConfig | None

resource_key#

The Amazon Web Services KMS key to use when encrypting the EBS volume the job run on.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

edge_packaging_job_status_message#

Returns a message describing the job status and error messages.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The timestamp of when the packaging job was created.

Type:

datetime.datetime | None

last_modified_time#

The timestamp of when the job was last updated.

Type:

datetime.datetime | None

model_artifact#

The Amazon Simple Storage (S3) URI where model artifacts ares stored.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_signature#

The signature document of files in the model artifact.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

preset_deployment_output#

The output of a SageMaker Edge Manager deployable resource.

Type:

sagemaker.core.shapes.shapes.EdgePresetDeploymentOutput | None

compilation_job_name: str | PipelineVariable | None#
classmethod create(edge_packaging_job_name: str | PipelineVariable, compilation_job_name: str | PipelineVariable | object, model_name: str | PipelineVariable | object, model_version: str | PipelineVariable, role_arn: str | PipelineVariable, output_config: EdgeOutputConfig, resource_key: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) EdgePackagingJob | None[source]#

Create a EdgePackagingJob resource

Parameters:
  • edge_packaging_job_name – The name of the edge packaging job.

  • compilation_job_name – The name of the SageMaker Neo compilation job that will be used to locate model artifacts for packaging.

  • model_name – The name of the model.

  • model_version – The version of the model.

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

  • output_config – Provides information about the output location for the packaged model.

  • resource_key – The Amazon Web Services KMS key to use when encrypting the EBS volume the edge packaging job runs on.

  • tags – Creates tags for the packaging job.

  • session – Boto3 session.

  • region – Region name.

Returns:

The EdgePackagingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
edge_packaging_job_arn: str | PipelineVariable | None#
edge_packaging_job_name: str | PipelineVariable#
edge_packaging_job_status: str | PipelineVariable | None#
edge_packaging_job_status_message: str | PipelineVariable | None#
classmethod get(edge_packaging_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) EdgePackagingJob | None[source]#

Get a EdgePackagingJob resource

Parameters:
  • edge_packaging_job_name – The name of the edge packaging job.

  • session – Boto3 session.

  • region – Region name.

Returns:

The EdgePackagingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), model_name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[EdgePackagingJob][source]#

Get all EdgePackagingJob resources

Parameters:
  • next_token – The response from the last list when returning a list large enough to need tokening.

  • max_results – Maximum number of results to select.

  • creation_time_after – Select jobs where the job was created after specified time.

  • creation_time_before – Select jobs where the job was created before specified time.

  • last_modified_time_after – Select jobs where the job was updated after specified time.

  • last_modified_time_before – Select jobs where the job was updated before specified time.

  • name_contains – Filter for jobs containing this name in their packaging job name.

  • model_name_contains – Filter for jobs where the model name contains this string.

  • status_equals – The job status to filter for.

  • sort_by – Use to specify what column to sort by.

  • sort_order – What direction to sort by.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed EdgePackagingJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_time: datetime | None#
model_artifact: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_name: str | PipelineVariable | None#
model_signature: str | PipelineVariable | None#
model_version: str | PipelineVariable | None#
output_config: EdgeOutputConfig | None#
populate_inputs_decorator()[source]#
preset_deployment_output: EdgePresetDeploymentOutput | None#
refresh() EdgePackagingJob | None[source]#

Refresh a EdgePackagingJob resource

Returns:

The EdgePackagingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

resource_key: str | PipelineVariable | None#
role_arn: str | PipelineVariable | None#
stop() None[source]#

Stop a EdgePackagingJob resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a EdgePackagingJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.Endpoint(*, endpoint_name: str | PipelineVariable, endpoint_arn: str | PipelineVariable | None = Unassigned(), endpoint_config_name: str | PipelineVariable | None = Unassigned(), deletion_condition: EndpointDeletionCondition | None = Unassigned(), production_variants: List[ProductionVariantSummary] | None = Unassigned(), data_capture_config: DataCaptureConfigSummary | None = Unassigned(), endpoint_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_deployment_config: DeploymentConfig | None = Unassigned(), async_inference_config: AsyncInferenceConfig | None = Unassigned(), pending_deployment_summary: PendingDeploymentSummary | None = Unassigned(), explainer_config: ExplainerConfig | None = Unassigned(), shadow_production_variants: List[ProductionVariantSummary] | None = Unassigned(), graph_config_name: str | PipelineVariable | None = Unassigned(), metrics_config: MetricsConfig | None = Unassigned(), serializer: BaseSerializer | None = None, deserializer: BaseDeserializer | None = None)[source]#

Bases: Base

Class representing resource Endpoint

endpoint_name#

Name of the endpoint.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

endpoint_arn#

The Amazon Resource Name (ARN) of the endpoint.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

endpoint_status#

The status of the endpoint. OutOfService: Endpoint is not available to take incoming requests. Creating: CreateEndpoint is executing. Updating: UpdateEndpoint or UpdateEndpointWeightsAndCapacities is executing. SystemUpdating: Endpoint is undergoing maintenance and cannot be updated or deleted or re-scaled until it has completed. This maintenance operation does not change any customer-specified values such as VPC config, KMS encryption, model, instance type, or instance count. RollingBack: Endpoint fails to scale up or down or change its variant weight and is in the process of rolling back to its previous configuration. Once the rollback completes, endpoint returns to an InService status. This transitional status only applies to an endpoint that has autoscaling enabled and is undergoing variant weight or capacity changes as part of an UpdateEndpointWeightsAndCapacities call or when the UpdateEndpointWeightsAndCapacities operation is called explicitly. InService: Endpoint is available to process incoming requests. Deleting: DeleteEndpoint is executing. Failed: Endpoint could not be created, updated, or re-scaled. Use the FailureReason value returned by DescribeEndpoint for information about the failure. DeleteEndpoint is the only operation that can be performed on a failed endpoint. UpdateRollbackFailed: Both the rolling deployment and auto-rollback failed. Your endpoint is in service with a mix of the old and new endpoint configurations. For information about how to remedy this issue and restore the endpoint’s status to InService, see Rolling Deployments.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

A timestamp that shows when the endpoint was created.

Type:

datetime.datetime | None

last_modified_time#

A timestamp that shows when the endpoint was last modified.

Type:

datetime.datetime | None

endpoint_config_name#

The name of the endpoint configuration associated with this endpoint.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

deletion_condition#
Type:

sagemaker.core.shapes.shapes.EndpointDeletionCondition | None

production_variants#

An array of ProductionVariantSummary objects, one for each model hosted behind this endpoint.

Type:

List[sagemaker.core.shapes.shapes.ProductionVariantSummary] | None

data_capture_config#
Type:

sagemaker.core.shapes.shapes.DataCaptureConfigSummary | None

failure_reason#

If the status of the endpoint is Failed, the reason why it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_deployment_config#

The most recent deployment configuration for the endpoint.

Type:

sagemaker.core.shapes.shapes.DeploymentConfig | None

async_inference_config#

Returns the description of an endpoint configuration created using the CreateEndpointConfig API.

Type:

sagemaker.core.shapes.shapes.AsyncInferenceConfig | None

pending_deployment_summary#

Returns the summary of an in-progress deployment. This field is only returned when the endpoint is creating or updating with a new endpoint configuration.

Type:

sagemaker.core.shapes.shapes.PendingDeploymentSummary | None

explainer_config#

The configuration parameters for an explainer.

Type:

sagemaker.core.shapes.shapes.ExplainerConfig | None

shadow_production_variants#

An array of ProductionVariantSummary objects, one for each model that you want to host at this endpoint in shadow mode with production traffic replicated from the model specified on ProductionVariants.

Type:

List[sagemaker.core.shapes.shapes.ProductionVariantSummary] | None

graph_config_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

metrics_config#

The Configuration parameters for Utilization metrics.

Type:

sagemaker.core.shapes.shapes.MetricsConfig | None

async_inference_config: AsyncInferenceConfig | None#
classmethod create(endpoint_name: str | PipelineVariable, endpoint_config_name: str | PipelineVariable | object, graph_config_name: str | PipelineVariable | None = Unassigned(), deletion_condition: EndpointDeletionCondition | None = Unassigned(), deployment_config: DeploymentConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Endpoint | None[source]#

Create a Endpoint resource

Parameters:
  • endpoint_name – The name of the endpoint.The name must be unique within an Amazon Web Services Region in your Amazon Web Services account. The name is case-insensitive in CreateEndpoint, but the case is preserved and must be matched in InvokeEndpoint.

  • endpoint_config_name – The name of an endpoint configuration. For more information, see CreateEndpointConfig.

  • graph_config_name

  • deletion_condition

  • deployment_config

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Endpoint resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
data_capture_config: DataCaptureConfigSummary | None#
delete(force_delete: bool | None = Unassigned()) None[source]#

Delete a Endpoint resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

deletion_condition: EndpointDeletionCondition | None#
deserializer: BaseDeserializer | None#
endpoint_arn: str | PipelineVariable | None#
endpoint_config_name: str | PipelineVariable | None#
endpoint_name: str | PipelineVariable#
endpoint_status: str | PipelineVariable | None#
explainer_config: ExplainerConfig | None#
failure_reason: str | PipelineVariable | None#
classmethod get(endpoint_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Endpoint | None[source]#

Get a Endpoint resource

Parameters:
  • endpoint_name – The name of the endpoint.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Endpoint resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Endpoint][source]#

Get all Endpoint resources

Parameters:
  • sort_by – Sorts the list of results. The default is CreationTime.

  • sort_order – The sort order for results. The default is Descending.

  • next_token – If the result of a ListEndpoints request was truncated, the response includes a NextToken. To retrieve the next set of endpoints, use the token in the next request.

  • max_results – The maximum number of endpoints to return in the response. This value defaults to 10.

  • name_contains – A string in endpoint names. This filter returns only endpoints whose name contains the specified string.

  • creation_time_before – A filter that returns only endpoints that were created before the specified time (timestamp).

  • creation_time_after – A filter that returns only endpoints with a creation time greater than or equal to the specified time (timestamp).

  • last_modified_time_before – A filter that returns only endpoints that were modified before the specified timestamp.

  • last_modified_time_after – A filter that returns only endpoints that were modified after the specified timestamp.

  • status_equals – A filter that returns only endpoints with the specified status.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Endpoint resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
graph_config_name: str | PipelineVariable | None#
invoke(body: Any, content_type: str | PipelineVariable | None = Unassigned(), accept: str | PipelineVariable | None = Unassigned(), custom_attributes: str | PipelineVariable | None = Unassigned(), target_model: str | PipelineVariable | None = Unassigned(), target_variant: str | PipelineVariable | None = Unassigned(), target_container_hostname: str | PipelineVariable | None = Unassigned(), inference_id: str | PipelineVariable | None = Unassigned(), enable_explanations: str | PipelineVariable | None = Unassigned(), inference_component_name: str | PipelineVariable | None = Unassigned(), session_id: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) InvokeEndpointOutput | None[source]#

After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.

Parameters:
  • body – Provides input data, in the format specified in the ContentType request header. Amazon SageMaker passes all of the data in the body to the model. For information about the format of the request body, see Common Data Formats-Inference.

  • content_type – The MIME type of the input data in the request body.

  • accept – The desired MIME type of the inference response from the model container.

  • custom_attributes – Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1). The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function. This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.

  • target_model – The model to request for inference when invoking a multi-model endpoint.

  • target_variant – Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights. For information about how to use variant targeting to perform a/b testing, see Test models in production

  • target_container_hostname – If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.

  • inference_id – If you provide a value, it is added to the captured data when you enable data capture on the endpoint. For information about data capture, see Capture Data.

  • enable_explanations – An optional JMESPath expression used to override the EnableExplanations parameter of the ClarifyExplainerConfig API. See the EnableExplanations section in the developer guide for more information.

  • inference_component_name – If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.

  • session_id – Creates a stateful session or identifies an existing one. You can do one of the following: Create a stateful session by specifying the value NEW_SESSION. Send your request to an existing stateful session by specifying the ID of that session. With a stateful session, you can send multiple requests to a stateful model. When you create a session with a stateful model, the model must create the session ID and set the expiration time. The model must also provide that information in the response to your request. You can get the ID and timestamp from the NewSessionId response parameter. For any subsequent request where you specify that session ID, SageMaker routes the request to the same instance that supports the session.

  • session – Boto3 session.

  • region – Region name.

Returns:

InvokeEndpointOutput

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • InternalDependencyException – Your request caused an exception with an internal dependency. Contact customer support.

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ModelError – Model (owned by the customer in the container) returned 4xx or 5xx error code.

  • ModelNotReadyException – Either a serverless endpoint variant’s resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

invoke_async(input_location: str | PipelineVariable, content_type: str | PipelineVariable | None = Unassigned(), accept: str | PipelineVariable | None = Unassigned(), custom_attributes: str | PipelineVariable | None = Unassigned(), inference_id: str | PipelineVariable | None = Unassigned(), request_ttl_seconds: int | None = Unassigned(), invocation_timeout_seconds: int | None = Unassigned(), session: Session | None = None, region: str | None = None) InvokeEndpointAsyncOutput | None[source]#

After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint in an asynchronous manner.

Parameters:
  • input_location – The Amazon S3 URI where the inference request payload is stored.

  • content_type – The MIME type of the input data in the request body.

  • accept – The desired MIME type of the inference response from the model container.

  • custom_attributes – Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1). The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function. This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.

  • inference_id – The identifier for the inference request. Amazon SageMaker will generate an identifier for you if none is specified.

  • request_ttl_seconds – Maximum age in seconds a request can be in the queue before it is marked as expired. The default is 6 hours, or 21,600 seconds.

  • invocation_timeout_seconds – Maximum amount of time in seconds a request can be processed before it is marked as expired. The default is 15 minutes, or 900 seconds.

  • session – Boto3 session.

  • region – Region name.

Returns:

InvokeEndpointAsyncOutput

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

invoke_with_response_stream(body: Any, content_type: str | PipelineVariable | None = Unassigned(), accept: str | PipelineVariable | None = Unassigned(), custom_attributes: str | PipelineVariable | None = Unassigned(), target_variant: str | PipelineVariable | None = Unassigned(), target_container_hostname: str | PipelineVariable | None = Unassigned(), inference_id: str | PipelineVariable | None = Unassigned(), inference_component_name: str | PipelineVariable | None = Unassigned(), session_id: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) InvokeEndpointWithResponseStreamOutput | None[source]#

Invokes a model at the specified endpoint to return the inference response as a stream.

Parameters:
  • body – Provides input data, in the format specified in the ContentType request header. Amazon SageMaker passes all of the data in the body to the model. For information about the format of the request body, see Common Data Formats-Inference.

  • content_type – The MIME type of the input data in the request body.

  • accept – The desired MIME type of the inference response from the model container.

  • custom_attributes – Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components of the Hypertext Transfer Protocol (HTTP/1.1). The code in your model is responsible for setting or updating any custom attributes in the response. If your code does not set this value in the response, an empty value is returned. For example, if a custom attribute represents the trace ID, your model can prepend the custom attribute with Trace ID: in your post-processing function. This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker Python SDK.

  • target_variant – Specify the production variant to send the inference request to when invoking an endpoint that is running two or more variants. Note that this parameter overrides the default behavior for the endpoint, which is to distribute the invocation traffic based on the variant weights. For information about how to use variant targeting to perform a/b testing, see Test models in production

  • target_container_hostname – If the endpoint hosts multiple containers and is configured to use direct invocation, this parameter specifies the host name of the container to invoke.

  • inference_id – An identifier that you assign to your request.

  • inference_component_name – If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke for a streaming response.

  • session_id – The ID of a stateful session to handle your request. You can’t create a stateful session by using the InvokeEndpointWithResponseStream action. Instead, you can create one by using the InvokeEndpoint action. In your request, you specify NEW_SESSION for the SessionId request parameter. The response to that request provides the session ID for the NewSessionId response parameter.

  • session – Boto3 session.

  • region – Region name.

Returns:

InvokeEndpointWithResponseStreamOutput

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • InternalStreamFailure – The stream processing failed because of an unknown error, exception or failure. Try your request again.

  • ModelError – Model (owned by the customer in the container) returned 4xx or 5xx error code.

  • ModelStreamError – An error occurred while streaming the response body. This error can have the following error codes: ModelInvocationTimeExceeded The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker. StreamBroken The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

last_deployment_config: DeploymentConfig | None#
last_modified_time: datetime | None#
metrics_config: MetricsConfig | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pending_deployment_summary: PendingDeploymentSummary | None#
populate_inputs_decorator()[source]#
production_variants: List[ProductionVariantSummary] | None#
refresh() Endpoint | None[source]#

Refresh a Endpoint resource

Returns:

The Endpoint resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

serializer: BaseSerializer | None#
shadow_production_variants: List[ProductionVariantSummary] | None#
update(retain_all_variant_properties: bool | None = Unassigned(), exclude_retained_variant_properties: List[VariantProperty] | None = Unassigned(), deployment_config: DeploymentConfig | None = Unassigned(), retain_deployment_config: bool | None = Unassigned()) Endpoint | None[source]#

Update a Endpoint resource

Parameters:
  • retain_all_variant_properties – When updating endpoint resources, enables or disables the retention of variant properties, such as the instance count or the variant weight. To retain the variant properties of an endpoint when updating it, set RetainAllVariantProperties to true. To use the variant properties specified in a new EndpointConfig call when updating an endpoint, set RetainAllVariantProperties to false. The default is false.

  • exclude_retained_variant_properties – When you are updating endpoint resources with RetainAllVariantProperties, whose value is set to true, ExcludeRetainedVariantProperties specifies the list of type VariantProperty to override with the values provided by EndpointConfig. If you don’t specify a value for ExcludeRetainedVariantProperties, no variant properties are overridden.

  • deployment_config – The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.

  • retain_deployment_config – Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).

Returns:

The Endpoint resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

update_weights_and_capacities(desired_weights_and_capacities: List[DesiredWeightAndCapacity], session: Session | None = None, region: str | None = None) None[source]#

Updates variant weight of one or more variants associated with an existing endpoint, or capacity of one variant associated with an existing endpoint.

Parameters:
  • desired_weights_and_capacities – An object that provides new capacity and weight values for a variant.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Endpoint resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['OutOfService', 'Creating', 'Updating', 'SystemUpdating', 'RollingBack', 'InService', 'Deleting', 'Failed', 'UpdateRollbackFailed'], poll: int = 5, timeout: int | None = None, logs: bool | None = False) None[source]#

Wait for a Endpoint resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

  • logs – Whether to print logs while waiting.

Raises:
class sagemaker.core.resources.EndpointConfig(*, endpoint_config_name: str | PipelineVariable, endpoint_config_arn: str | PipelineVariable | None = Unassigned(), production_variants: List[ProductionVariant] | None = Unassigned(), data_capture_config: DataCaptureConfig | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), async_inference_config: AsyncInferenceConfig | None = Unassigned(), explainer_config: ExplainerConfig | None = Unassigned(), shadow_production_variants: List[ProductionVariant] | None = Unassigned(), execution_role_arn: str | PipelineVariable | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), enable_network_isolation: bool | None = Unassigned(), metrics_config: MetricsConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource EndpointConfig

endpoint_config_name#

Name of the SageMaker endpoint configuration.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

endpoint_config_arn#

The Amazon Resource Name (ARN) of the endpoint configuration.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

production_variants#

An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

Type:

List[sagemaker.core.shapes.shapes.ProductionVariant] | None

creation_time#

A timestamp that shows when the endpoint configuration was created.

Type:

datetime.datetime | None

data_capture_config#
Type:

sagemaker.core.shapes.shapes.DataCaptureConfig | None

kms_key_id#

Amazon Web Services KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

async_inference_config#

Returns the description of an endpoint configuration created using the CreateEndpointConfig API.

Type:

sagemaker.core.shapes.shapes.AsyncInferenceConfig | None

explainer_config#

The configuration parameters for an explainer.

Type:

sagemaker.core.shapes.shapes.ExplainerConfig | None

shadow_production_variants#

An array of ProductionVariant objects, one for each model that you want to host at this endpoint in shadow mode with production traffic replicated from the model specified on ProductionVariants.

Type:

List[sagemaker.core.shapes.shapes.ProductionVariant] | None

execution_role_arn#

The Amazon Resource Name (ARN) of the IAM role that you assigned to the endpoint configuration.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

vpc_config#
Type:

sagemaker.core.shapes.shapes.VpcConfig | None

enable_network_isolation#

Indicates whether all model containers deployed to the endpoint are isolated. If they are, no inbound or outbound network calls can be made to or from the model containers.

Type:

bool | None

metrics_config#

The Configuration parameters for Utilization metrics.

Type:

sagemaker.core.shapes.shapes.MetricsConfig | None

async_inference_config: AsyncInferenceConfig | None#
classmethod create(endpoint_config_name: str | PipelineVariable, production_variants: List[ProductionVariant], data_capture_config: DataCaptureConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), async_inference_config: AsyncInferenceConfig | None = Unassigned(), explainer_config: ExplainerConfig | None = Unassigned(), shadow_production_variants: List[ProductionVariant] | None = Unassigned(), execution_role_arn: str | PipelineVariable | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), enable_network_isolation: bool | None = Unassigned(), metrics_config: MetricsConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) EndpointConfig | None[source]#

Create a EndpointConfig resource

Parameters:
  • endpoint_config_name – The name of the endpoint configuration. You specify this name in a CreateEndpoint request.

  • production_variants – An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

  • data_capture_config

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • kms_key_id – The Amazon Resource Name (ARN) of a Amazon Web Services Key Management Service key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. The KmsKeyId can be any of the following formats: Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab Alias name: alias/ExampleAlias Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias The KMS key policy must grant permission to the IAM role that you specify in your CreateEndpoint, UpdateEndpoint requests. For more information, refer to the Amazon Web Services Key Management Service section Using Key Policies in Amazon Web Services KMS Certain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. You can’t request a KmsKeyId when using an instance type with local storage. If any of the models that you specify in the ProductionVariants parameter use nitro-based instances with local storage, do not specify a value for the KmsKeyId parameter. If you specify a value for KmsKeyId when using any nitro-based instances with local storage, the call to CreateEndpointConfig fails. For a list of instance types that support local instance storage, see Instance Store Volumes. For more information about local instance storage encryption, see SSD Instance Store Volumes.

  • async_inference_config – Specifies configuration for how an endpoint performs asynchronous inference. This is a required field in order for your Endpoint to be invoked using InvokeEndpointAsync.

  • explainer_config – A member of CreateEndpointConfig that enables explainers.

  • shadow_production_variants – An array of ProductionVariant objects, one for each model that you want to host at this endpoint in shadow mode with production traffic replicated from the model specified on ProductionVariants. If you use this field, you can only specify one variant for ProductionVariants and one variant for ShadowProductionVariants.

  • execution_role_arn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform actions on your behalf. For more information, see SageMaker AI Roles. To be able to pass this role to Amazon SageMaker AI, the caller of this action must have the iam:PassRole permission.

  • vpc_config

  • enable_network_isolation – Sets whether all model containers deployed to the endpoint are isolated. If they are, no inbound or outbound network calls can be made to or from the model containers.

  • metrics_config – The Configuration parameters for Utilization metrics.

  • session – Boto3 session.

  • region – Region name.

Returns:

The EndpointConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
data_capture_config: DataCaptureConfig | None#
delete() None[source]#

Delete a EndpointConfig resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

enable_network_isolation: bool | None#
endpoint_config_arn: str | PipelineVariable | None#
endpoint_config_name: str | PipelineVariable#
execution_role_arn: str | PipelineVariable | None#
explainer_config: ExplainerConfig | None#
classmethod get(endpoint_config_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) EndpointConfig | None[source]#

Get a EndpointConfig resource

Parameters:
  • endpoint_config_name – The name of the endpoint configuration.

  • session – Boto3 session.

  • region – Region name.

Returns:

The EndpointConfig resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[EndpointConfig][source]#

Get all EndpointConfig resources

Parameters:
  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Descending.

  • next_token – If the result of the previous ListEndpointConfig request was truncated, the response includes a NextToken. To retrieve the next set of endpoint configurations, use the token in the next request.

  • max_results – The maximum number of training jobs to return in the response.

  • name_contains – A string in the endpoint configuration name. This filter returns only endpoint configurations whose name contains the specified string.

  • creation_time_before – A filter that returns only endpoint configurations created before the specified time (timestamp).

  • creation_time_after – A filter that returns only endpoint configurations with a creation time greater than or equal to the specified time (timestamp).

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed EndpointConfig resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
kms_key_id: str | PipelineVariable | None#
metrics_config: MetricsConfig | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
production_variants: List[ProductionVariant] | None#
refresh() EndpointConfig | None[source]#

Refresh a EndpointConfig resource

Returns:

The EndpointConfig resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

shadow_production_variants: List[ProductionVariant] | None#
vpc_config: VpcConfig | None#
class sagemaker.core.resources.Experiment(*, experiment_name: str | PipelineVariable, experiment_arn: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), source: ExperimentSource | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource Experiment

experiment_name#

The name of the experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

experiment_arn#

The Amazon Resource Name (ARN) of the experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

display_name#

The name of the experiment as displayed. If DisplayName isn’t specified, ExperimentName is displayed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source#

The Amazon Resource Name (ARN) of the source and, optionally, the type.

Type:

sagemaker.core.shapes.shapes.ExperimentSource | None

description#

The description of the experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

When the experiment was created.

Type:

datetime.datetime | None

created_by#

Who created the experiment.

Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

When the experiment was last modified.

Type:

datetime.datetime | None

last_modified_by#

Who last modified the experiment.

Type:

sagemaker.core.shapes.shapes.UserContext | None

classmethod create(experiment_name: str | PipelineVariable, display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Experiment | None[source]#

Create a Experiment resource

Parameters:
  • experiment_name – The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.

  • display_name – The name of the experiment as displayed. The name doesn’t need to be unique. If you don’t specify DisplayName, the value in ExperimentName is displayed.

  • description – The description of the experiment.

  • tags – A list of tags to associate with the experiment. You can use Search API to search on the tags.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Experiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Experiment resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
display_name: str | PipelineVariable | None#
experiment_arn: str | PipelineVariable | None#
experiment_name: str | PipelineVariable#
classmethod get(experiment_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Experiment | None[source]#

Get a Experiment resource

Parameters:
  • experiment_name – The name of the experiment to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Experiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Experiment][source]#

Get all Experiment resources

Parameters:
  • created_after – A filter that returns only experiments created after the specified time.

  • created_before – A filter that returns only experiments created before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • next_token – If the previous call to ListExperiments didn’t return the full set of experiments, the call returns a token for getting the next set of experiments.

  • max_results – The maximum number of experiments to return in the response. The default value is 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Experiment resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() Experiment | None[source]#

Refresh a Experiment resource

Returns:

The Experiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

source: ExperimentSource | None#
update(display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned()) Experiment | None[source]#

Update a Experiment resource

Returns:

The Experiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.ExperimentInternal(*, experiment_name: str | PipelineVariable | object, customer_details: CustomerDetails, display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), source: InputExperimentSource | None = Unassigned(), creation_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned(), experiment_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ExperimentInternal

experiment_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

display_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source#
Type:

sagemaker.core.shapes.shapes.InputExperimentSource | None

creation_time#
Type:

datetime.datetime | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

experiment_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(experiment_name: str | PipelineVariable | object, customer_details: CustomerDetails, display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), source: InputExperimentSource | None = Unassigned(), creation_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) ExperimentInternal | None[source]#

Create a ExperimentInternal resource

Parameters:
  • experiment_name

  • customer_details

  • display_name

  • description

  • source

  • creation_time

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The ExperimentInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails#
description: str | PipelineVariable | None#
display_name: str | PipelineVariable | None#
experiment_arn: str | PipelineVariable | None#
experiment_name: str | PipelineVariable | object#
get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source: InputExperimentSource | None#
tags: List[Tag] | None#
class sagemaker.core.resources.FeatureGroup(*, feature_group_name: str | PipelineVariable, feature_group_arn: str | PipelineVariable | None = Unassigned(), record_identifier_feature_name: str | PipelineVariable | None = Unassigned(), event_time_feature_name: str | PipelineVariable | None = Unassigned(), feature_definitions: List[FeatureDefinition] | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), online_store_config: OnlineStoreConfig | None = Unassigned(), offline_store_config: OfflineStoreConfig | None = Unassigned(), throughput_config: ThroughputConfigDescription | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), feature_group_status: str | PipelineVariable | None = Unassigned(), offline_store_status: OfflineStoreStatus | None = Unassigned(), last_update_status: LastUpdateStatus | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), next_token: str | PipelineVariable | None = Unassigned(), online_store_replicas: List[OnlineStoreReplica] | None = Unassigned(), online_store_read_write_type: str | PipelineVariable | None = Unassigned(), online_store_total_size_bytes: int | None = Unassigned(), online_store_total_item_count: int | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource FeatureGroup

feature_group_arn#

The Amazon Resource Name (ARN) of the FeatureGroup.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

feature_group_name#

he name of the FeatureGroup.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

record_identifier_feature_name#

The name of the Feature used for RecordIdentifier, whose value uniquely identifies a record stored in the feature store.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

event_time_feature_name#

The name of the feature that stores the EventTime of a Record in a FeatureGroup. An EventTime is a point in time when a new event occurs that corresponds to the creation or update of a Record in a FeatureGroup. All Records in the FeatureGroup have a corresponding EventTime.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

feature_definitions#

A list of the Features in the FeatureGroup. Each feature is defined by a FeatureName and FeatureType.

Type:

List[sagemaker.core.shapes.shapes.FeatureDefinition] | None

creation_time#

A timestamp indicating when SageMaker created the FeatureGroup.

Type:

datetime.datetime | None

next_token#

A token to resume pagination of the list of Features (FeatureDefinitions).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

A timestamp indicating when the feature group was last updated.

Type:

datetime.datetime | None

online_store_config#

The configuration for the OnlineStore.

Type:

sagemaker.core.shapes.shapes.OnlineStoreConfig | None

offline_store_config#

The configuration of the offline store. It includes the following configurations: Amazon S3 location of the offline store. Configuration of the Glue data catalog. Table format of the offline store. Option to disable the automatic creation of a Glue table for the offline store. Encryption configuration.

Type:

sagemaker.core.shapes.shapes.OfflineStoreConfig | None

throughput_config#
Type:

sagemaker.core.shapes.shapes.ThroughputConfigDescription | None

role_arn#

The Amazon Resource Name (ARN) of the IAM execution role used to persist data into the OfflineStore if an OfflineStoreConfig is provided.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

feature_group_status#

The status of the feature group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

offline_store_status#

The status of the OfflineStore. Notifies you if replicating data into the OfflineStore has failed. Returns either: Active or Blocked

Type:

sagemaker.core.shapes.shapes.OfflineStoreStatus | None

last_update_status#

A value indicating whether the update made to the feature group was successful.

Type:

sagemaker.core.shapes.shapes.LastUpdateStatus | None

failure_reason#

The reason that the FeatureGroup failed to be replicated in the OfflineStore. This is failure can occur because: The FeatureGroup could not be created in the OfflineStore. The FeatureGroup could not be deleted from the OfflineStore.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

A free form description of the feature group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

online_store_replicas#
Type:

List[sagemaker.core.shapes.shapes.OnlineStoreReplica] | None

online_store_read_write_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

online_store_total_size_bytes#

The size of the OnlineStore in bytes.

Type:

int | None

online_store_total_item_count#
Type:

int | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

batch_get_record(identifiers: List[BatchGetRecordIdentifier], expiration_time_response: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) BatchGetRecordResponse | None[source]#

Retrieves a batch of Records from a FeatureGroup.

Parameters:
  • identifiers – A list containing the name or Amazon Resource Name (ARN) of the FeatureGroup, the list of names of Features to be retrieved, and the corresponding RecordIdentifier values as strings.

  • expiration_time_response – Parameter to request ExpiresAt in response. If Enabled, BatchGetRecord will return the value of ExpiresAt, if it is not null. If Disabled and null, BatchGetRecord will return null.

  • session – Boto3 session.

  • region – Region name.

Returns:

BatchGetRecordResponse

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessForbidden – You do not have permission to perform an action.

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

classmethod create(feature_group_name: str | PipelineVariable, record_identifier_feature_name: str | PipelineVariable, event_time_feature_name: str | PipelineVariable, feature_definitions: List[FeatureDefinition], online_store_config: OnlineStoreConfig | None = Unassigned(), offline_store_config: OfflineStoreConfig | None = Unassigned(), throughput_config: ThroughputConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), use_pre_prod_offline_store_replicator_lambda: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) FeatureGroup | None[source]#

Create a FeatureGroup resource

Parameters:
  • feature_group_name – The name of the FeatureGroup. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account. The name: Must start with an alphanumeric character. Can only include alphanumeric characters, underscores, and hyphens. Spaces are not allowed.

  • record_identifier_feature_name – The name of the Feature whose value uniquely identifies a Record defined in the FeatureStore. Only the latest record per identifier value will be stored in the OnlineStore. RecordIdentifierFeatureName must be one of feature definitions’ names. You use the RecordIdentifierFeatureName to access data in a FeatureStore. This name: Must start with an alphanumeric character. Can only contains alphanumeric characters, hyphens, underscores. Spaces are not allowed.

  • event_time_feature_name – The name of the feature that stores the EventTime of a Record in a FeatureGroup. An EventTime is a point in time when a new event occurs that corresponds to the creation or update of a Record in a FeatureGroup. All Records in the FeatureGroup must have a corresponding EventTime. An EventTime can be a String or Fractional. Fractional: EventTime feature values must be a Unix timestamp in seconds. String: EventTime feature values must be an ISO-8601 string in the format. The following formats are supported yyyy-MM-dd’T’HH:mm:ssZ and yyyy-MM-dd’T’HH:mm:ss.SSSZ where yyyy, MM, and dd represent the year, month, and day respectively and HH, mm, ss, and if applicable, SSS represent the hour, month, second and milliseconds respsectively. ‘T’ and Z are constants.

  • feature_definitions – A list of Feature names and types. Name and Type is compulsory per Feature. Valid feature FeatureTypes are Integral, Fractional and String. FeatureNames cannot be any of the following: is_deleted, write_time, api_invocation_time You can create up to 2,500 FeatureDefinitions per FeatureGroup.

  • online_store_config – You can turn the OnlineStore on or off by specifying True for the EnableOnlineStore flag in OnlineStoreConfig. You can also include an Amazon Web Services KMS key ID (KMSKeyId) for at-rest encryption of the OnlineStore. The default value is False.

  • offline_store_config – Use this to configure an OfflineFeatureStore. This parameter allows you to specify: The Amazon Simple Storage Service (Amazon S3) location of an OfflineStore. A configuration for an Amazon Web Services Glue or Amazon Web Services Hive data catalog. An KMS encryption key to encrypt the Amazon S3 location used for OfflineStore. If KMS encryption key is not specified, by default we encrypt all data at rest using Amazon Web Services KMS key. By defining your bucket-level key for SSE, you can reduce Amazon Web Services KMS requests costs by up to 99 percent. Format for the offline store table. Supported formats are Glue (Default) and Apache Iceberg. To learn more about this parameter, see OfflineStoreConfig.

  • throughput_config

  • role_arn – The Amazon Resource Name (ARN) of the IAM execution role used to persist data into the OfflineStore if an OfflineStoreConfig is provided.

  • description – A free-form description of a FeatureGroup.

  • tags – Tags used to identify Features in each FeatureGroup.

  • use_pre_prod_offline_store_replicator_lambda

  • session – Boto3 session.

  • region – Region name.

Returns:

The FeatureGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a FeatureGroup resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

delete_record(record_identifier_value_as_string: str | PipelineVariable, event_time: str | PipelineVariable, target_stores: List[str | PipelineVariable] | None = Unassigned(), deletion_mode: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Deletes a Record from a FeatureGroup in the OnlineStore.

Parameters:
  • record_identifier_value_as_string – The value for the RecordIdentifier that uniquely identifies the record, in string format.

  • event_time – Timestamp indicating when the deletion event occurred. EventTime can be used to query data at a certain point in time.

  • target_stores – A list of stores from which you’re deleting the record. By default, Feature Store deletes the record from all of the stores that you’re using for the FeatureGroup.

  • deletion_mode – The name of the deletion mode for deleting the record. By default, the deletion mode is set to SoftDelete.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessForbidden – You do not have permission to perform an action.

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

description: str | PipelineVariable | None#
event_time_feature_name: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
feature_definitions: List[FeatureDefinition] | None#
feature_group_arn: str | PipelineVariable | None#
feature_group_name: str | PipelineVariable#
feature_group_status: str | PipelineVariable | None#
classmethod get(feature_group_name: str | PipelineVariable, next_token: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) FeatureGroup | None[source]#

Get a FeatureGroup resource

Parameters:
  • feature_group_name – The name or Amazon Resource Name (ARN) of the FeatureGroup you want described.

  • next_token – A token to resume pagination of the list of Features (FeatureDefinitions). 2,500 Features are returned by default.

  • session – Boto3 session.

  • region – Region name.

Returns:

The FeatureGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), feature_group_status_equals: str | PipelineVariable | None = Unassigned(), offline_store_status_equals: str | PipelineVariable | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[FeatureGroup][source]#

Get all FeatureGroup resources

Parameters:
  • name_contains – A string that partially matches one or more FeatureGroups names. Filters FeatureGroups by name.

  • feature_group_status_equals – A FeatureGroup status. Filters by FeatureGroup status.

  • offline_store_status_equals – An OfflineStore status. Filters by OfflineStore status.

  • creation_time_after – Use this parameter to search for FeatureGroupss created after a specific date and time.

  • creation_time_before – Use this parameter to search for FeatureGroupss created before a specific date and time.

  • sort_order – The order in which feature groups are listed.

  • sort_by – The value on which the feature group list is sorted.

  • max_results – The maximum number of results returned by ListFeatureGroups.

  • next_token – A token to resume pagination of ListFeatureGroups results.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed FeatureGroup resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
get_record(record_identifier_value_as_string: str | PipelineVariable, feature_names: List[str | PipelineVariable] | None = Unassigned(), expiration_time_response: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) GetRecordResponse | None[source]#

Use for OnlineStore serving from a FeatureStore.

Parameters:
  • record_identifier_value_as_string – The value that corresponds to RecordIdentifier type and uniquely identifies the record in the FeatureGroup.

  • feature_names – List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.

  • expiration_time_response – Parameter to request ExpiresAt in response. If Enabled, GetRecord will return the value of ExpiresAt, if it is not null. If Disabled and null, GetRecord will return null.

  • session – Boto3 session.

  • region – Region name.

Returns:

GetRecordResponse

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessForbidden – You do not have permission to perform an action.

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ResourceNotFound – Resource being access is not found.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

last_modified_by: UserContext | None#
last_modified_time: datetime | None#
last_update_status: LastUpdateStatus | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

next_token: str | PipelineVariable | None#
offline_store_config: OfflineStoreConfig | None#
offline_store_status: OfflineStoreStatus | None#
online_store_config: OnlineStoreConfig | None#
online_store_read_write_type: str | PipelineVariable | None#
online_store_replicas: List[OnlineStoreReplica] | None#
online_store_total_item_count: int | None#
online_store_total_size_bytes: int | None#
populate_inputs_decorator()[source]#
put_record(record: List[FeatureValue], target_stores: List[str | PipelineVariable] | None = Unassigned(), ttl_duration: TtlDuration | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

The PutRecord API is used to ingest a list of Records into your feature group.

Parameters:
  • record – List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following: Use GetRecord to retrieve the latest record. Update the record returned from GetRecord. Use PutRecord to update feature values.

  • target_stores – A list of stores to which you’re adding the record. By default, Feature Store adds the record to all of the stores that you’re using for the FeatureGroup.

  • ttl_duration – Time to live duration, where the record is hard deleted after the expiration time is reached; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessForbidden – You do not have permission to perform an action.

  • InternalFailure – An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ServiceUnavailable – The service is currently unavailable.

  • ValidationError – There was an error validating your request.

record_identifier_feature_name: str | PipelineVariable | None#
refresh() FeatureGroup | None[source]#

Refresh a FeatureGroup resource

Returns:

The FeatureGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
throughput_config: ThroughputConfigDescription | None#
update(add_online_store_replica: AddOnlineStoreReplicaAction | None = Unassigned(), feature_additions: List[FeatureDefinition] | None = Unassigned(), online_store_config: OnlineStoreConfigUpdate | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), throughput_config: ThroughputConfigUpdate | None = Unassigned()) FeatureGroup | None[source]#

Update a FeatureGroup resource

Parameters:
  • add_online_store_replica

  • feature_additions – Updates the feature group. Updating a feature group is an asynchronous operation. When you get an HTTP 200 response, you’ve made a valid request. It takes some time after you’ve made a valid request for Feature Store to update the feature group.

Returns:

The FeatureGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a FeatureGroup resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'Created', 'CreateFailed', 'Deleting', 'DeleteFailed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a FeatureGroup resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.FeatureGroupInternal(*, feature_group_name: str | PipelineVariable | object, record_identifier_feature_name: str | PipelineVariable, event_time_feature_name: str | PipelineVariable, feature_definitions: List[FeatureDefinition], feature_group_arn: str | PipelineVariable, online_store_config: OnlineStoreConfig | None = Unassigned(), offline_store_config: OfflineStoreConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), use_pre_prod_offline_store_replicator_lambda: bool | None = Unassigned(), account_id: str | PipelineVariable | None = Unassigned(), aws_payer_token: str | PipelineVariable | None = Unassigned(), fas_credentials: str | PipelineVariable | None = Unassigned(), created_by: UserContext | None = Unassigned(), ignore_sweeper_execution: bool | None = Unassigned(), storage_account_stage_test_override: str | PipelineVariable | None = Unassigned(), online_store_metadata: OnlineStoreMetadata | None = Unassigned(), online_store_replica_metadata: OnlineStoreReplicaMetadata | None = Unassigned())[source]#

Bases: Base

Class representing resource FeatureGroupInternal

feature_group_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

record_identifier_feature_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

event_time_feature_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

feature_definitions#
Type:

List[sagemaker.core.shapes.shapes.FeatureDefinition]

feature_group_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

online_store_config#
Type:

sagemaker.core.shapes.shapes.OnlineStoreConfig | None

offline_store_config#
Type:

sagemaker.core.shapes.shapes.OfflineStoreConfig | None

role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

use_pre_prod_offline_store_replicator_lambda#
Type:

bool | None

account_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

aws_payer_token#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

fas_credentials#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

ignore_sweeper_execution#
Type:

bool | None

storage_account_stage_test_override#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

online_store_metadata#
Type:

sagemaker.core.shapes.shapes.OnlineStoreMetadata | None

online_store_replica_metadata#
Type:

sagemaker.core.shapes.shapes.OnlineStoreReplicaMetadata | None

account_id: str | PipelineVariable | None#
aws_payer_token: str | PipelineVariable | None#
classmethod create(feature_group_name: str | PipelineVariable | object, record_identifier_feature_name: str | PipelineVariable, event_time_feature_name: str | PipelineVariable, feature_definitions: List[FeatureDefinition], online_store_config: OnlineStoreConfig | None = Unassigned(), offline_store_config: OfflineStoreConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), use_pre_prod_offline_store_replicator_lambda: bool | None = Unassigned(), account_id: str | PipelineVariable | None = Unassigned(), aws_payer_token: str | PipelineVariable | None = Unassigned(), fas_credentials: str | PipelineVariable | None = Unassigned(), created_by: UserContext | None = Unassigned(), ignore_sweeper_execution: bool | None = Unassigned(), storage_account_stage_test_override: str | PipelineVariable | None = Unassigned(), online_store_metadata: OnlineStoreMetadata | None = Unassigned(), online_store_replica_metadata: OnlineStoreReplicaMetadata | None = Unassigned(), session: Session | None = None, region: str | None = None) FeatureGroupInternal | None[source]#

Create a FeatureGroupInternal resource

Parameters:
  • feature_group_name

  • record_identifier_feature_name

  • event_time_feature_name

  • feature_definitions

  • online_store_config

  • offline_store_config

  • role_arn

  • description

  • tags

  • use_pre_prod_offline_store_replicator_lambda

  • account_id

  • aws_payer_token

  • fas_credentials

  • created_by

  • ignore_sweeper_execution

  • storage_account_stage_test_override

  • online_store_metadata

  • online_store_replica_metadata

  • session – Boto3 session.

  • region – Region name.

Returns:

The FeatureGroupInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
description: str | PipelineVariable | None#
event_time_feature_name: str | PipelineVariable#
fas_credentials: str | PipelineVariable | None#
feature_definitions: List[FeatureDefinition]#
feature_group_arn: str | PipelineVariable#
feature_group_name: str | PipelineVariable | object#
get_name() str[source]#
ignore_sweeper_execution: bool | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

offline_store_config: OfflineStoreConfig | None#
online_store_config: OnlineStoreConfig | None#
online_store_metadata: OnlineStoreMetadata | None#
online_store_replica_metadata: OnlineStoreReplicaMetadata | None#
record_identifier_feature_name: str | PipelineVariable#
role_arn: str | PipelineVariable | None#
storage_account_stage_test_override: str | PipelineVariable | None#
tags: List[Tag] | None#
use_pre_prod_offline_store_replicator_lambda: bool | None#
class sagemaker.core.resources.FeatureMetadata(*, feature_group_name: str | PipelineVariable, feature_name: str | PipelineVariable, feature_group_arn: str | PipelineVariable | None = Unassigned(), feature_identifier: str | PipelineVariable | None = Unassigned(), feature_type: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), parameters: List[FeatureParameter] | None = Unassigned())[source]#

Bases: Base

Class representing resource FeatureMetadata

feature_group_arn#

The Amazon Resource Number (ARN) of the feature group that contains the feature.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

feature_group_name#

The name of the feature group that you’ve specified.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

feature_name#

The name of the feature that you’ve specified.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

feature_type#

The data type of the feature.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

A timestamp indicating when the feature was created.

Type:

datetime.datetime | None

last_modified_time#

A timestamp indicating when the metadata for the feature group was modified. For example, if you add a parameter describing the feature, the timestamp changes to reflect the last time you

Type:

datetime.datetime | None

feature_identifier#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

The description you added to describe the feature.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

parameters#

The key-value pairs that you added to describe the feature.

Type:

List[sagemaker.core.shapes.shapes.FeatureParameter] | None

creation_time: datetime | None#
description: str | PipelineVariable | None#
feature_group_arn: str | PipelineVariable | None#
feature_group_name: str | PipelineVariable#
feature_identifier: str | PipelineVariable | None#
feature_name: str | PipelineVariable#
feature_type: str | PipelineVariable | None#
classmethod get(feature_group_name: str | PipelineVariable, feature_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) FeatureMetadata | None[source]#

Get a FeatureMetadata resource

Parameters:
  • feature_group_name – The name or Amazon Resource Name (ARN) of the feature group containing the feature.

  • feature_name – The name of the feature.

  • session – Boto3 session.

  • region – Region name.

Returns:

The FeatureMetadata resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parameters: List[FeatureParameter] | None#
refresh() FeatureMetadata | None[source]#

Refresh a FeatureMetadata resource

Returns:

The FeatureMetadata resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

update(description: str | PipelineVariable | None = Unassigned(), parameter_additions: List[FeatureParameter] | None = Unassigned(), parameter_removals: List[str | PipelineVariable] | None = Unassigned()) FeatureMetadata | None[source]#

Update a FeatureMetadata resource

Parameters:
  • parameter_additions – A list of key-value pairs that you can add to better describe the feature.

  • parameter_removals – A list of parameter keys that you can specify to remove parameters that describe your feature.

Returns:

The FeatureMetadata resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.FlowDefinition(*, flow_definition_name: str | PipelineVariable, flow_definition_arn: str | PipelineVariable | None = Unassigned(), flow_definition_status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), human_loop_request_source: HumanLoopRequestSource | None = Unassigned(), human_loop_activation_config: HumanLoopActivationConfig | None = Unassigned(), human_loop_config: HumanLoopConfig | None = Unassigned(), workflow_steps: str | PipelineVariable | None = Unassigned(), output_config: FlowDefinitionOutputConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), task_rendering_role_arn: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource FlowDefinition

flow_definition_arn#

The Amazon Resource Name (ARN) of the flow defintion.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

flow_definition_name#

The Amazon Resource Name (ARN) of the flow definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

flow_definition_status#

The status of the flow definition. Valid values are listed below.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The timestamp when the flow definition was created.

Type:

datetime.datetime | None

output_config#

An object containing information about the output file.

Type:

sagemaker.core.shapes.shapes.FlowDefinitionOutputConfig | None

role_arn#

The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) execution role for the flow definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

human_loop_request_source#

Container for configuring the source of human task requests. Used to specify if Amazon Rekognition or Amazon Textract is used as an integration source.

Type:

sagemaker.core.shapes.shapes.HumanLoopRequestSource | None

human_loop_activation_config#

An object containing information about what triggers a human review workflow.

Type:

sagemaker.core.shapes.shapes.HumanLoopActivationConfig | None

human_loop_config#

An object containing information about who works on the task, the workforce task price, and other task details.

Type:

sagemaker.core.shapes.shapes.HumanLoopConfig | None

workflow_steps#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

task_rendering_role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

kms_key_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

The reason your flow definition failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(flow_definition_name: str | PipelineVariable, output_config: FlowDefinitionOutputConfig, role_arn: str | PipelineVariable, human_loop_request_source: HumanLoopRequestSource | None = Unassigned(), human_loop_activation_config: HumanLoopActivationConfig | None = Unassigned(), human_loop_config: HumanLoopConfig | None = Unassigned(), workflow_steps: str | PipelineVariable | None = Unassigned(), task_rendering_role_arn: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) FlowDefinition | None[source]#

Create a FlowDefinition resource

Parameters:
  • flow_definition_name – The name of your flow definition.

  • output_config – An object containing information about where the human review results will be uploaded.

  • role_arn – The Amazon Resource Name (ARN) of the role needed to call other services on your behalf. For example, arn:aws:iam::1234567890:role/service-role/AmazonSageMaker-ExecutionRole-20180111T151298.

  • human_loop_request_source – Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source.

  • human_loop_activation_config – An object containing information about the events that trigger a human workflow.

  • human_loop_config – An object containing information about the tasks the human reviewers will perform.

  • workflow_steps

  • task_rendering_role_arn

  • kms_key_id

  • tags – An array of key-value pairs that contain metadata to help you categorize and organize a flow definition. Each tag consists of a key and a value, both of which you define.

  • session – Boto3 session.

  • region – Region name.

Returns:

The FlowDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a FlowDefinition resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

failure_reason: str | PipelineVariable | None#
flow_definition_arn: str | PipelineVariable | None#
flow_definition_name: str | PipelineVariable#
flow_definition_status: str | PipelineVariable | None#
classmethod get(flow_definition_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) FlowDefinition | None[source]#

Get a FlowDefinition resource

Parameters:
  • flow_definition_name – The name of the flow definition.

  • session – Boto3 session.

  • region – Region name.

Returns:

The FlowDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[FlowDefinition][source]#

Get all FlowDefinition resources

Parameters:
  • creation_time_after – A filter that returns only flow definitions with a creation time greater than or equal to the specified timestamp.

  • creation_time_before – A filter that returns only flow definitions that were created before the specified timestamp.

  • sort_order – An optional value that specifies whether you want the results sorted in Ascending or Descending order.

  • next_token – A token to resume pagination.

  • max_results – The total number of items to return. If the total number of available items is more than the value specified in MaxResults, then a NextToken will be provided in the output that you can use to resume pagination.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed FlowDefinition resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
human_loop_activation_config: HumanLoopActivationConfig | None#
human_loop_config: HumanLoopConfig | None#
human_loop_request_source: HumanLoopRequestSource | None#
kms_key_id: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_config: FlowDefinitionOutputConfig | None#
populate_inputs_decorator()[source]#
refresh() FlowDefinition | None[source]#

Refresh a FlowDefinition resource

Returns:

The FlowDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
task_rendering_role_arn: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a FlowDefinition resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Initializing', 'Active', 'Failed', 'Deleting'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a FlowDefinition resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
workflow_steps: str | PipelineVariable | None#
class sagemaker.core.resources.GroundTruthJob(*, ground_truth_job_name: str | PipelineVariable, ground_truth_project_arn: str | PipelineVariable | None = Unassigned(), ground_truth_workflow_arn: str | PipelineVariable | None = Unassigned(), ground_truth_job_description: str | PipelineVariable | None = Unassigned(), ground_truth_job_arn: str | PipelineVariable | None = Unassigned(), ground_truth_job_status: str | PipelineVariable | None = Unassigned(), input_config: GroundTruthJobInputConfig | None = Unassigned(), output_config: GroundTruthJobOutputConfig | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), created_at: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource GroundTruthJob

ground_truth_project_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ground_truth_workflow_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ground_truth_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ground_truth_job_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

ground_truth_job_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

input_config#
Type:

sagemaker.core.shapes.shapes.GroundTruthJobInputConfig | None

output_config#
Type:

sagemaker.core.shapes.shapes.GroundTruthJobOutputConfig | None

created_at#
Type:

datetime.datetime | None

ground_truth_job_description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(ground_truth_project_name: str | PipelineVariable | object, ground_truth_workflow_name: str | PipelineVariable | object, ground_truth_job_name: str | PipelineVariable, input_config: GroundTruthJobInputConfig, output_config: GroundTruthJobOutputConfig, ground_truth_job_description: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) GroundTruthJob | None[source]#

Create a GroundTruthJob resource

Parameters:
  • ground_truth_project_name

  • ground_truth_workflow_name

  • ground_truth_job_name

  • input_config

  • output_config

  • ground_truth_job_description

  • session – Boto3 session.

  • region – Region name.

Returns:

The GroundTruthJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_at: datetime | None#
failure_reason: str | PipelineVariable | None#
classmethod get(ground_truth_project_name: str | PipelineVariable, ground_truth_workflow_name: str | PipelineVariable, ground_truth_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) GroundTruthJob | None[source]#

Get a GroundTruthJob resource

Parameters:
  • ground_truth_project_name

  • ground_truth_workflow_name

  • ground_truth_job_name

  • session – Boto3 session.

  • region – Region name.

Returns:

The GroundTruthJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
ground_truth_job_arn: str | PipelineVariable | None#
ground_truth_job_description: str | PipelineVariable | None#
ground_truth_job_name: str | PipelineVariable#
ground_truth_job_status: str | PipelineVariable | None#
ground_truth_project_arn: str | PipelineVariable | None#
ground_truth_workflow_arn: str | PipelineVariable | None#
input_config: GroundTruthJobInputConfig | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_config: GroundTruthJobOutputConfig | None#
refresh(ground_truth_project_name: str | PipelineVariable, ground_truth_workflow_name: str | PipelineVariable) GroundTruthJob | None[source]#

Refresh a GroundTruthJob resource

Returns:

The GroundTruthJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a GroundTruthJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.GroundTruthProject(*, ground_truth_project_name: str | PipelineVariable, ground_truth_project_arn: str | PipelineVariable | None = Unassigned(), ground_truth_project_description: str | PipelineVariable | None = Unassigned(), point_of_contact: GroundTruthProjectPointOfContact | None = Unassigned(), ground_truth_project_status: str | PipelineVariable | None = Unassigned(), created_at: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource GroundTruthProject

ground_truth_project_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ground_truth_project_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

ground_truth_project_description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

point_of_contact#
Type:

sagemaker.core.shapes.shapes.GroundTruthProjectPointOfContact | None

ground_truth_project_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

created_at#
Type:

datetime.datetime | None

classmethod create(ground_truth_project_name: str | PipelineVariable, ground_truth_project_description: str | PipelineVariable | None = Unassigned(), point_of_contact: GroundTruthProjectPointOfContact | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) GroundTruthProject | None[source]#

Create a GroundTruthProject resource

Parameters:
  • ground_truth_project_name

  • ground_truth_project_description

  • point_of_contact

  • session – Boto3 session.

  • region – Region name.

Returns:

The GroundTruthProject resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_at: datetime | None#
classmethod get(ground_truth_project_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) GroundTruthProject | None[source]#

Get a GroundTruthProject resource

Parameters:
  • ground_truth_project_name

  • session – Boto3 session.

  • region – Region name.

Returns:

The GroundTruthProject resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[GroundTruthProject][source]#

Get all GroundTruthProject resources.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed GroundTruthProject resources.

get_name() str[source]#
ground_truth_project_arn: str | PipelineVariable | None#
ground_truth_project_description: str | PipelineVariable | None#
ground_truth_project_name: str | PipelineVariable#
ground_truth_project_status: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

point_of_contact: GroundTruthProjectPointOfContact | None#
refresh() GroundTruthProject | None[source]#

Refresh a GroundTruthProject resource

Returns:

The GroundTruthProject resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Pending', 'Active'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a GroundTruthProject resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.GroundTruthWorkflow(*, ground_truth_workflow_name: str | PipelineVariable, ground_truth_project_arn: str | PipelineVariable | None = Unassigned(), ground_truth_workflow_arn: str | PipelineVariable | None = Unassigned(), ground_truth_workflow_definition_spec: str | PipelineVariable | None = Unassigned(), execution_role_arn: str | PipelineVariable | None = Unassigned(), created_at: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource GroundTruthWorkflow

ground_truth_project_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ground_truth_workflow_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ground_truth_workflow_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

ground_truth_workflow_definition_spec#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

execution_role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

created_at#
Type:

datetime.datetime | None

classmethod create(ground_truth_project_name: str | PipelineVariable | object, ground_truth_workflow_name: str | PipelineVariable, ground_truth_workflow_definition_spec: str | PipelineVariable, execution_role_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) GroundTruthWorkflow | None[source]#

Create a GroundTruthWorkflow resource

Parameters:
  • ground_truth_project_name

  • ground_truth_workflow_name

  • ground_truth_workflow_definition_spec

  • execution_role_arn

  • session – Boto3 session.

  • region – Region name.

Returns:

The GroundTruthWorkflow resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_at: datetime | None#
execution_role_arn: str | PipelineVariable | None#
classmethod get(ground_truth_project_name: str | PipelineVariable, ground_truth_workflow_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) GroundTruthWorkflow | None[source]#

Get a GroundTruthWorkflow resource

Parameters:
  • ground_truth_project_name

  • ground_truth_workflow_name

  • session – Boto3 session.

  • region – Region name.

Returns:

The GroundTruthWorkflow resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
ground_truth_project_arn: str | PipelineVariable | None#
ground_truth_workflow_arn: str | PipelineVariable | None#
ground_truth_workflow_definition_spec: str | PipelineVariable | None#
ground_truth_workflow_name: str | PipelineVariable#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh(ground_truth_project_name: str | PipelineVariable) GroundTruthWorkflow | None[source]#

Refresh a GroundTruthWorkflow resource

Returns:

The GroundTruthWorkflow resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.Hub(*, hub_name: str | PipelineVariable, hub_arn: str | PipelineVariable | None = Unassigned(), hub_display_name: str | PipelineVariable | None = Unassigned(), hub_description: str | PipelineVariable | None = Unassigned(), hub_search_keywords: List[str | PipelineVariable] | None = Unassigned(), s3_storage_config: HubS3StorageConfig | None = Unassigned(), hub_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource Hub

hub_name#

The name of the hub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hub_arn#

The Amazon Resource Name (ARN) of the hub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_status#

The status of the hub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The date and time that the hub was created.

Type:

datetime.datetime | None

last_modified_time#

The date and time that the hub was last modified.

Type:

datetime.datetime | None

hub_display_name#

The display name of the hub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_description#

A description of the hub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_search_keywords#

The searchable keywords for the hub.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

s3_storage_config#

The Amazon S3 storage configuration for the hub.

Type:

sagemaker.core.shapes.shapes.HubS3StorageConfig | None

failure_reason#

The failure reason if importing hub content failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(hub_name: str | PipelineVariable, hub_description: str | PipelineVariable, hub_display_name: str | PipelineVariable | None = Unassigned(), hub_search_keywords: List[str | PipelineVariable] | None = Unassigned(), s3_storage_config: HubS3StorageConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Hub | None[source]#

Create a Hub resource

Parameters:
  • hub_name – The name of the hub to create.

  • hub_description – A description of the hub.

  • hub_display_name – The display name of the hub.

  • hub_search_keywords – The searchable keywords for the hub.

  • s3_storage_config – The Amazon S3 storage configuration for the hub.

  • tags – Any tags to associate with the hub.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Hub resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a Hub resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

failure_reason: str | PipelineVariable | None#
classmethod get(hub_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Hub | None[source]#

Get a Hub resource

Parameters:
  • hub_name – The name of the hub to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Hub resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Hub][source]#

Get all Hub resources

Parameters:
  • name_contains – Only list hubs with names that contain the specified string.

  • creation_time_before – Only list hubs that were created before the time specified.

  • creation_time_after – Only list hubs that were created after the time specified.

  • last_modified_time_before – Only list hubs that were last modified before the time specified.

  • last_modified_time_after – Only list hubs that were last modified after the time specified.

  • sort_by – Sort hubs by either name or creation time.

  • sort_order – Sort hubs by ascending or descending order.

  • max_results – The maximum number of hubs to list.

  • next_token – If the response to a previous ListHubs request was truncated, the response includes a NextToken. To retrieve the next set of hubs, use the token in the next request.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Hub resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
hub_arn: str | PipelineVariable | None#
hub_description: str | PipelineVariable | None#
hub_display_name: str | PipelineVariable | None#
hub_name: str | PipelineVariable#
hub_search_keywords: List[str | PipelineVariable] | None#
hub_status: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() Hub | None[source]#

Refresh a Hub resource

Returns:

The Hub resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

s3_storage_config: HubS3StorageConfig | None#
update(hub_description: str | PipelineVariable | None = Unassigned(), hub_display_name: str | PipelineVariable | None = Unassigned(), hub_search_keywords: List[str | PipelineVariable] | None = Unassigned()) Hub | None[source]#

Update a Hub resource

Returns:

The Hub resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Hub resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['InService', 'Creating', 'Updating', 'Deleting', 'CreateFailed', 'UpdateFailed', 'DeleteFailed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Hub resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.HubContent(*, hub_name: str | None = Unassigned(), hub_content_type: str | PipelineVariable, hub_content_name: str | PipelineVariable, hub_content_arn: str | PipelineVariable | None = Unassigned(), hub_content_version: str | PipelineVariable | None = Unassigned(), document_schema_version: str | PipelineVariable | None = Unassigned(), hub_arn: str | PipelineVariable | None = Unassigned(), hub_content_display_name: str | PipelineVariable | None = Unassigned(), hub_content_description: str | PipelineVariable | None = Unassigned(), hub_content_markdown: str | PipelineVariable | None = Unassigned(), hub_content_document: str | PipelineVariable | None = Unassigned(), sage_maker_public_hub_content_arn: str | PipelineVariable | None = Unassigned(), reference_min_version: str | PipelineVariable | None = Unassigned(), support_status: str | PipelineVariable | None = Unassigned(), hub_content_search_keywords: List[str | PipelineVariable] | None = Unassigned(), hub_content_dependencies: List[HubContentDependency] | None = Unassigned(), hub_content_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource HubContent

hub_content_name#

The name of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hub_content_arn#

The Amazon Resource Name (ARN) of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_version#

The version of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_type#

The type of hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

document_schema_version#

The document schema version for the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_name#

The name of the hub that contains the content.

Type:

str | None

hub_arn#

The Amazon Resource Name (ARN) of the hub that contains the content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_document#

The hub content document that describes information about the hub content such as type, associated containers, scripts, and more.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_status#

The status of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The date and time that hub content was created.

Type:

datetime.datetime | None

hub_content_display_name#

The display name of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_description#

A description of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_markdown#

A string that provides a description of the hub content. This string can include links, tables, and standard markdown formating.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

sage_maker_public_hub_content_arn#

The ARN of the public hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

reference_min_version#

The minimum version of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

support_status#

The support status of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hub_content_search_keywords#

The searchable keywords for the hub content.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

hub_content_dependencies#

The location of any dependencies that the hub content has, such as scripts, model artifacts, datasets, or notebooks.

Type:

List[sagemaker.core.shapes.shapes.HubContentDependency] | None

failure_reason#

The failure reason if importing hub content failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

The last modified time of the hub content.

Type:

datetime.datetime | None

creation_time: datetime | None#
delete() None[source]#

Delete a HubContent resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

document_schema_version: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(hub_name: str | PipelineVariable, hub_content_type: str | PipelineVariable, hub_content_name: str | PipelineVariable, hub_content_version: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) HubContent | None[source]#

Get a HubContent resource

Parameters:
  • hub_name – The name of the hub that contains the content to describe.

  • hub_content_type – The type of content in the hub.

  • hub_content_name – The name of the content to describe.

  • hub_content_version – The version of the content to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HubContent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_all_versions(min_version: str | PipelineVariable | None = Unassigned(), max_schema_version: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[HubContent][source]#

List hub content versions.

Parameters:
  • min_version – The lower bound of the hub content versions to list.

  • max_schema_version – The upper bound of the hub content schema version.

  • creation_time_before – Only list hub content versions that were created before the time specified.

  • creation_time_after – Only list hub content versions that were created after the time specified.

  • sort_by – Sort hub content versions by either name or creation time.

  • sort_order – Sort hub content versions by ascending or descending order.

  • max_results – The maximum number of hub content versions to list.

  • next_token – If the response to a previous ListHubContentVersions request was truncated, the response includes a NextToken. To retrieve the next set of hub content versions, use the token in the next request.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed HubContent.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
hub_arn: str | PipelineVariable | None#
hub_content_arn: str | PipelineVariable | None#
hub_content_dependencies: List[HubContentDependency] | None#
hub_content_description: str | PipelineVariable | None#
hub_content_display_name: str | PipelineVariable | None#
hub_content_document: str | PipelineVariable | None#
hub_content_markdown: str | PipelineVariable | None#
hub_content_name: str | PipelineVariable#
hub_content_search_keywords: List[str | PipelineVariable] | None#
hub_content_status: str | PipelineVariable | None#
hub_content_type: str | PipelineVariable#
hub_content_version: str | PipelineVariable | None#
hub_name: str | None#
last_modified_time: datetime | None#
classmethod load(hub_content_name: str | PipelineVariable, hub_content_type: str | PipelineVariable, document_schema_version: str | PipelineVariable, hub_name: str | PipelineVariable, hub_content_document: str | PipelineVariable, hub_content_version: str | PipelineVariable | None = Unassigned(), hub_content_display_name: str | PipelineVariable | None = Unassigned(), hub_content_description: str | PipelineVariable | None = Unassigned(), hub_content_markdown: str | PipelineVariable | None = Unassigned(), support_status: str | PipelineVariable | None = Unassigned(), hub_content_search_keywords: List[str | PipelineVariable] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) HubContent | None[source]#

Import a HubContent resource

Parameters:
  • hub_content_name – The name of the hub content to import.

  • hub_content_type – The type of hub content to import.

  • document_schema_version – The version of the hub content schema to import.

  • hub_name – The name of the hub to import content into.

  • hub_content_document – The hub content document that describes information about the hub content such as type, associated containers, scripts, and more.

  • hub_content_version – The version of the hub content to import.

  • hub_content_display_name – The display name of the hub content to import.

  • hub_content_description – A description of the hub content to import.

  • hub_content_markdown – A string that provides a description of the hub content. This string can include links, tables, and standard markdown formating.

  • support_status – The status of the hub content resource.

  • hub_content_search_keywords – The searchable keywords of the hub content.

  • tags – Any tags associated with the hub content.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HubContent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

reference_min_version: str | PipelineVariable | None#
refresh() HubContent | None[source]#

Refresh a HubContent resource

Returns:

The HubContent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

sage_maker_public_hub_content_arn: str | PipelineVariable | None#
support_status: str | PipelineVariable | None#
update(hub_content_type: str | PipelineVariable, hub_content_version: str | PipelineVariable, hub_content_display_name: str | PipelineVariable | None = Unassigned(), hub_content_description: str | PipelineVariable | None = Unassigned(), hub_content_markdown: str | PipelineVariable | None = Unassigned(), hub_content_search_keywords: List[str | PipelineVariable] | None = Unassigned(), support_status: str | PipelineVariable | None = Unassigned()) HubContent | None[source]#

Update a HubContent resource

Returns:

The HubContent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Supported', 'Deprecated', 'Restricted'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a HubContent resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.HubContentPresignedUrls(*, hub_name: str | PipelineVariable | object, hub_content_type: str | PipelineVariable, hub_content_name: str | PipelineVariable | object, authorized_url_configs: List[AuthorizedUrl], hub_content_version: str | PipelineVariable | None = Unassigned(), access_config: PresignedUrlAccessConfig | None = Unassigned(), max_results: int | None = Unassigned(), next_token: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource HubContentPresignedUrls

hub_name#

The name or Amazon Resource Name (ARN) of the hub that contains the content. For public content, use SageMakerPublicHub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

hub_content_type#

The type of hub content to access. Valid values include Model, Notebook, and ModelReference.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hub_content_name#

The name of the hub content for which to generate presigned URLs. This identifies the specific model or content within the hub.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

authorized_url_configs#

An array of authorized URL configurations, each containing a presigned URL and its corresponding local file path for proper file organization during download.

Type:

List[sagemaker.core.shapes.shapes.AuthorizedUrl]

hub_content_version#

The version of the hub content. If not specified, the latest version is used.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

access_config#

Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.

Type:

sagemaker.core.shapes.shapes.PresignedUrlAccessConfig | None

max_results#

The maximum number of presigned URLs to return in the response. Default value is 100. Large models may contain hundreds of files, requiring pagination to retrieve all URLs.

Type:

int | None

next_token#

A token for pagination. If present, indicates that more presigned URLs are available. Use this token in a subsequent request to retrieve additional URLs.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

access_config: PresignedUrlAccessConfig | None#
authorized_url_configs: List[AuthorizedUrl]#
classmethod create(hub_name: str | PipelineVariable | object, hub_content_type: str | PipelineVariable, hub_content_name: str | PipelineVariable | object, hub_content_version: str | PipelineVariable | None = Unassigned(), access_config: PresignedUrlAccessConfig | None = Unassigned(), max_results: int | None = Unassigned(), next_token: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) HubContentPresignedUrls | None[source]#

Create a HubContentPresignedUrls resource

Parameters:
  • hub_name – The name or Amazon Resource Name (ARN) of the hub that contains the content. For public content, use SageMakerPublicHub.

  • hub_content_type – The type of hub content to access. Valid values include Model, Notebook, and ModelReference.

  • hub_content_name – The name of the hub content for which to generate presigned URLs. This identifies the specific model or content within the hub.

  • hub_content_version – The version of the hub content. If not specified, the latest version is used.

  • access_config – Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.

  • max_results – The maximum number of presigned URLs to return in the response. Default value is 100. Large models may contain hundreds of files, requiring pagination to retrieve all URLs.

  • next_token – A token for pagination. Use this token to retrieve the next set of presigned URLs when the response is truncated.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HubContentPresignedUrls resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

get_name() str[source]#
hub_content_name: str | PipelineVariable | object#
hub_content_type: str | PipelineVariable#
hub_content_version: str | PipelineVariable | None#
hub_name: str | PipelineVariable | object#
max_results: int | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

next_token: str | PipelineVariable | None#
class sagemaker.core.resources.HubContentReference(*, hub_name: str | PipelineVariable | object, sage_maker_public_hub_content_arn: str | PipelineVariable, hub_arn: str | PipelineVariable, hub_content_arn: str | PipelineVariable, hub_content_name: str | PipelineVariable | object | None = Unassigned(), min_version: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned())[source]#

Bases: Base

Class representing resource HubContentReference

hub_name#

The name of the hub to add the hub content reference to.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

sage_maker_public_hub_content_arn#

The ARN of the public hub content to reference.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hub_arn#

The ARN of the hub that the hub content reference was added to.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hub_content_arn#

The ARN of the hub content.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hub_content_name#

The name of the hub content to reference.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object | None

min_version#

The minimum version of the hub content to reference.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tags#

Any tags associated with the hub content to reference.

Type:

List[sagemaker.core.shapes.shapes.Tag] | None

classmethod create(hub_name: str | PipelineVariable | object, sage_maker_public_hub_content_arn: str | PipelineVariable, hub_content_name: str | PipelineVariable | object | None = Unassigned(), min_version: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) HubContentReference | None[source]#

Create a HubContentReference resource

Parameters:
  • hub_name – The name of the hub to add the hub content reference to.

  • sage_maker_public_hub_content_arn – The ARN of the public hub content to reference.

  • hub_content_name – The name of the hub content to reference.

  • min_version – The minimum version of the hub content to reference.

  • tags – Any tags associated with the hub content to reference.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HubContentReference resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

delete(hub_content_type: str | PipelineVariable) None[source]#

Delete a HubContentReference resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
hub_arn: str | PipelineVariable#
hub_content_arn: str | PipelineVariable#
hub_content_name: str | PipelineVariable | object | None#
hub_name: str | PipelineVariable | object#
min_version: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sage_maker_public_hub_content_arn: str | PipelineVariable#
tags: List[Tag] | None#
update(hub_content_type: str | PipelineVariable, min_version: str | PipelineVariable | None = Unassigned()) HubContentReference | None[source]#

Update a HubContentReference resource

Parameters:

hub_content_type – The content type of the resource that you want to update. Only specify a ModelReference resource for this API. To update a Model or Notebook resource, use the UpdateHubContent API instead.

Returns:

The HubContentReference resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.HumanTaskUi(*, human_task_ui_name: str | PipelineVariable, human_task_ui_arn: str | PipelineVariable | None = Unassigned(), human_task_ui_status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), ui_template: UiTemplateInfo | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource HumanTaskUi

human_task_ui_arn#

The Amazon Resource Name (ARN) of the human task user interface (worker task template).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

human_task_ui_name#

The name of the human task user interface (worker task template).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The timestamp when the human task user interface was created.

Type:

datetime.datetime | None

ui_template#
Type:

sagemaker.core.shapes.shapes.UiTemplateInfo | None

human_task_ui_status#

The status of the human task user interface (worker task template). Valid values are listed below.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

kms_key_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(human_task_ui_name: str | PipelineVariable, ui_template: UiTemplate, kms_key_id: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) HumanTaskUi | None[source]#

Create a HumanTaskUi resource

Parameters:
  • human_task_ui_name – The name of the user interface you are creating.

  • ui_template

  • kms_key_id

  • tags – An array of key-value pairs that contain metadata to help you categorize and organize a human review workflow user interface. Each tag consists of a key and a value, both of which you define.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HumanTaskUi resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a HumanTaskUi resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(human_task_ui_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) HumanTaskUi | None[source]#

Get a HumanTaskUi resource

Parameters:
  • human_task_ui_name – The name of the human task user interface (worker task template) you want information about.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HumanTaskUi resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[HumanTaskUi][source]#

Get all HumanTaskUi resources

Parameters:
  • creation_time_after – A filter that returns only human task user interfaces with a creation time greater than or equal to the specified timestamp.

  • creation_time_before – A filter that returns only human task user interfaces that were created before the specified timestamp.

  • sort_order – An optional value that specifies whether you want the results sorted in Ascending or Descending order.

  • next_token – A token to resume pagination.

  • max_results – The total number of items to return. If the total number of available items is more than the value specified in MaxResults, then a NextToken will be provided in the output that you can use to resume pagination.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed HumanTaskUi resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
human_task_ui_arn: str | PipelineVariable | None#
human_task_ui_name: str | PipelineVariable#
human_task_ui_status: str | PipelineVariable | None#
kms_key_id: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() HumanTaskUi | None[source]#

Refresh a HumanTaskUi resource

Returns:

The HumanTaskUi resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

ui_template: UiTemplateInfo | None#
update(ui_template: UiTemplate) HumanTaskUi | None[source]#

Update a HumanTaskUi resource

Returns:

The HumanTaskUi resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a HumanTaskUi resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Active', 'Deleting'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a HumanTaskUi resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.HyperParameterTuningJob(*, hyper_parameter_tuning_job_name: str | PipelineVariable, hyper_parameter_tuning_job_arn: str | PipelineVariable | None = Unassigned(), hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig | None = Unassigned(), training_job_definition: HyperParameterTrainingJobDefinition | None = Unassigned(), training_job_definitions: List[HyperParameterTrainingJobDefinition] | None = Unassigned(), hyper_parameter_tuning_job_status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), hyper_parameter_tuning_end_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), training_job_status_counters: TrainingJobStatusCounters | None = Unassigned(), objective_status_counters: ObjectiveStatusCounters | None = Unassigned(), best_training_job: HyperParameterTrainingJobSummary | None = Unassigned(), overall_best_training_job: HyperParameterTrainingJobSummary | None = Unassigned(), warm_start_config: HyperParameterTuningJobWarmStartConfig | None = Unassigned(), autotune: Autotune | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), tuning_job_completion_reason: str | PipelineVariable | None = Unassigned(), tuning_job_completion_details: HyperParameterTuningJobCompletionDetails | None = Unassigned(), consumed_resources: HyperParameterTuningJobConsumedResources | None = Unassigned())[source]#

Bases: Base

Class representing resource HyperParameterTuningJob

hyper_parameter_tuning_job_name#

The name of the hyperparameter tuning job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

hyper_parameter_tuning_job_arn#

The Amazon Resource Name (ARN) of the tuning job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hyper_parameter_tuning_job_config#

The HyperParameterTuningJobConfig object that specifies the configuration of the tuning job.

Type:

sagemaker.core.shapes.shapes.HyperParameterTuningJobConfig | None

hyper_parameter_tuning_job_status#

The status of the tuning job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The date and time that the tuning job started.

Type:

datetime.datetime | None

training_job_status_counters#

The TrainingJobStatusCounters object that specifies the number of training jobs, categorized by status, that this tuning job launched.

Type:

sagemaker.core.shapes.shapes.TrainingJobStatusCounters | None

objective_status_counters#

The ObjectiveStatusCounters object that specifies the number of training jobs, categorized by the status of their final objective metric, that this tuning job launched.

Type:

sagemaker.core.shapes.shapes.ObjectiveStatusCounters | None

training_job_definition#

The HyperParameterTrainingJobDefinition object that specifies the definition of the training jobs that this tuning job launches.

Type:

sagemaker.core.shapes.shapes.HyperParameterTrainingJobDefinition | None

training_job_definitions#

A list of the HyperParameterTrainingJobDefinition objects launched for this tuning job.

Type:

List[sagemaker.core.shapes.shapes.HyperParameterTrainingJobDefinition] | None

hyper_parameter_tuning_end_time#

The date and time that the tuning job ended.

Type:

datetime.datetime | None

last_modified_time#

The date and time that the status of the tuning job was modified.

Type:

datetime.datetime | None

best_training_job#

A TrainingJobSummary object that describes the training job that completed with the best current HyperParameterTuningJobObjective.

Type:

sagemaker.core.shapes.shapes.HyperParameterTrainingJobSummary | None

overall_best_training_job#

If the hyperparameter tuning job is an warm start tuning job with a WarmStartType of IDENTICAL_DATA_AND_ALGORITHM, this is the TrainingJobSummary for the training job with the best objective metric value of all training jobs launched by this tuning job and all parent jobs specified for the warm start tuning job.

Type:

sagemaker.core.shapes.shapes.HyperParameterTrainingJobSummary | None

warm_start_config#

The configuration for starting the hyperparameter parameter tuning job using one or more previous tuning jobs as a starting point. The results of previous tuning jobs are used to inform which combinations of hyperparameters to search over in the new tuning job.

Type:

sagemaker.core.shapes.shapes.HyperParameterTuningJobWarmStartConfig | None

autotune#

A flag to indicate if autotune is enabled for the hyperparameter tuning job.

Type:

sagemaker.core.shapes.shapes.Autotune | None

failure_reason#

If the tuning job failed, the reason it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tuning_job_completion_reason#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tuning_job_completion_details#

Tuning job completion information returned as the response from a hyperparameter tuning job. This information tells if your tuning job has or has not converged. It also includes the number of training jobs that have not improved model performance as evaluated against the objective function.

Type:

sagemaker.core.shapes.shapes.HyperParameterTuningJobCompletionDetails | None

consumed_resources#
Type:

sagemaker.core.shapes.shapes.HyperParameterTuningJobConsumedResources | None

autotune: Autotune | None#
best_training_job: HyperParameterTrainingJobSummary | None#
consumed_resources: HyperParameterTuningJobConsumedResources | None#
classmethod create(hyper_parameter_tuning_job_name: str | PipelineVariable, hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig, training_job_definition: HyperParameterTrainingJobDefinition | None = Unassigned(), training_job_definitions: List[HyperParameterTrainingJobDefinition] | None = Unassigned(), warm_start_config: HyperParameterTuningJobWarmStartConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), autotune: Autotune | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) HyperParameterTuningJob | None[source]#

Create a HyperParameterTuningJob resource

Parameters:
  • hyper_parameter_tuning_job_name – The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning job launches. The name must be unique within the same Amazon Web Services account and Amazon Web Services Region. The name must have 1 to 32 characters. Valid characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name is not case sensitive.

  • hyper_parameter_tuning_job_config – The HyperParameterTuningJobConfig object that describes the tuning job, including the search strategy, the objective metric used to evaluate training jobs, ranges of parameters to search, and resource limits for the tuning job. For more information, see How Hyperparameter Tuning Works.

  • training_job_definition – The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning job launches, including static hyperparameters, input data configuration, output data configuration, resource configuration, and stopping condition.

  • training_job_definitions – A list of the HyperParameterTrainingJobDefinition objects launched for this tuning job.

  • warm_start_config – Specifies the configuration for starting the hyperparameter tuning job using one or more previous tuning jobs as a starting point. The results of previous tuning jobs are used to inform which combinations of hyperparameters to search over in the new tuning job. All training jobs launched by the new hyperparameter tuning job are evaluated by using the objective metric. If you specify IDENTICAL_DATA_AND_ALGORITHM as the WarmStartType value for the warm start configuration, the training job that performs the best in the new tuning job is compared to the best training jobs from the parent tuning jobs. From these, the training job that performs the best as measured by the objective metric is returned as the overall best training job. All training jobs launched by parent hyperparameter tuning jobs and the new hyperparameter tuning jobs count against the limit of training jobs for the tuning job.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources. Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.

  • autotune – Configures SageMaker Automatic model tuning (AMT) to automatically find optimal parameters for the following fields: ParameterRanges: The names and ranges of parameters that a hyperparameter tuning job can optimize. ResourceLimits: The maximum resources that can be used for a training job. These resources include the maximum number of training jobs, the maximum runtime of a tuning job, and the maximum number of training jobs to run at the same time. TrainingJobEarlyStoppingType: A flag that specifies whether or not to use early stopping for training jobs launched by a hyperparameter tuning job. RetryStrategy: The number of times to retry a training job. Strategy: Specifies how hyperparameter tuning chooses the combinations of hyperparameter values to use for the training jobs that it launches. ConvergenceDetected: A flag to indicate that Automatic model tuning (AMT) has detected model convergence.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HyperParameterTuningJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a HyperParameterTuningJob resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

failure_reason: str | PipelineVariable | None#
classmethod get(hyper_parameter_tuning_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) HyperParameterTuningJob | None[source]#

Get a HyperParameterTuningJob resource

Parameters:
  • hyper_parameter_tuning_job_name – The name of the tuning job.

  • session – Boto3 session.

  • region – Region name.

Returns:

The HyperParameterTuningJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[HyperParameterTuningJob][source]#

Get all HyperParameterTuningJob resources

Parameters:
  • next_token – If the result of the previous ListHyperParameterTuningJobs request was truncated, the response includes a NextToken. To retrieve the next set of tuning jobs, use the token in the next request.

  • max_results – The maximum number of tuning jobs to return. The default value is 10.

  • sort_by – The field to sort results by. The default is Name.

  • sort_order – The sort order for results. The default is Ascending.

  • name_contains – A string in the tuning job name. This filter returns only tuning jobs whose name contains the specified string.

  • creation_time_after – A filter that returns only tuning jobs that were created after the specified time.

  • creation_time_before – A filter that returns only tuning jobs that were created before the specified time.

  • last_modified_time_after – A filter that returns only tuning jobs that were modified after the specified time.

  • last_modified_time_before – A filter that returns only tuning jobs that were modified before the specified time.

  • status_equals – A filter that returns only tuning jobs with the specified status.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed HyperParameterTuningJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_training_jobs(status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[HyperParameterTrainingJobSummary][source]#

Gets a list of TrainingJobSummary objects that describe the training jobs that a hyperparameter tuning job launched.

Parameters:
  • next_token – If the result of the previous ListTrainingJobsForHyperParameterTuningJob request was truncated, the response includes a NextToken. To retrieve the next set of training jobs, use the token in the next request.

  • max_results – The maximum number of training jobs to return. The default value is 10.

  • status_equals – A filter that returns only training jobs with the specified status.

  • sort_by – The field to sort results by. The default is Name. If the value of this field is FinalObjectiveMetricValue, any training jobs that did not return an objective metric are not listed.

  • sort_order – The sort order for results. The default is Ascending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed HyperParameterTrainingJobSummary.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
hyper_parameter_tuning_end_time: datetime | None#
hyper_parameter_tuning_job_arn: str | PipelineVariable | None#
hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig | None#
hyper_parameter_tuning_job_name: str | PipelineVariable#
hyper_parameter_tuning_job_status: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

objective_status_counters: ObjectiveStatusCounters | None#
overall_best_training_job: HyperParameterTrainingJobSummary | None#
populate_inputs_decorator()[source]#
refresh() HyperParameterTuningJob | None[source]#

Refresh a HyperParameterTuningJob resource

Returns:

The HyperParameterTuningJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stop() None[source]#

Stop a HyperParameterTuningJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

training_job_definition: HyperParameterTrainingJobDefinition | None#
training_job_definitions: List[HyperParameterTrainingJobDefinition] | None#
training_job_status_counters: TrainingJobStatusCounters | None#
tuning_job_completion_details: HyperParameterTuningJobCompletionDetails | None#
tuning_job_completion_reason: str | PipelineVariable | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a HyperParameterTuningJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a HyperParameterTuningJob resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

warm_start_config: HyperParameterTuningJobWarmStartConfig | None#
class sagemaker.core.resources.HyperParameterTuningJobInternal(*, hyper_parameter_tuning_job_name: str | PipelineVariable | object, hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig, customer_details: CustomerDetails, hyper_parameter_tuning_job_arn: str | PipelineVariable, training_job_definition: HyperParameterTrainingJobDefinition | None = Unassigned(), training_job_definitions: List[HyperParameterTrainingJobDefinition] | None = Unassigned(), warm_start_config: HyperParameterTuningJobWarmStartConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), autotune: Autotune | None = Unassigned(), fas_credentials: str | PipelineVariable | None = Unassigned(), auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), billing_mode: str | PipelineVariable | None = Unassigned(), source_identity: str | PipelineVariable | None = Unassigned(), identity_center_user_token: IdentityCenterUserToken | None = Unassigned())[source]#

Bases: Base

Class representing resource HyperParameterTuningJobInternal

hyper_parameter_tuning_job_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

hyper_parameter_tuning_job_config#
Type:

sagemaker.core.shapes.shapes.HyperParameterTuningJobConfig

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

hyper_parameter_tuning_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

training_job_definition#
Type:

sagemaker.core.shapes.shapes.HyperParameterTrainingJobDefinition | None

training_job_definitions#
Type:

List[sagemaker.core.shapes.shapes.HyperParameterTrainingJobDefinition] | None

warm_start_config#
Type:

sagemaker.core.shapes.shapes.HyperParameterTuningJobWarmStartConfig | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

autotune#
Type:

sagemaker.core.shapes.shapes.Autotune | None

fas_credentials#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

billing_mode#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source_identity#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

identity_center_user_token#
Type:

sagemaker.core.shapes.shapes.IdentityCenterUserToken | None

auto_ml_job_arn: str | PipelineVariable | None#
autotune: Autotune | None#
billing_mode: str | PipelineVariable | None#
classmethod create(hyper_parameter_tuning_job_name: str | PipelineVariable | object, hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig, customer_details: CustomerDetails, training_job_definition: HyperParameterTrainingJobDefinition | None = Unassigned(), training_job_definitions: List[HyperParameterTrainingJobDefinition] | None = Unassigned(), warm_start_config: HyperParameterTuningJobWarmStartConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), autotune: Autotune | None = Unassigned(), fas_credentials: str | PipelineVariable | None = Unassigned(), auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), billing_mode: str | PipelineVariable | None = Unassigned(), source_identity: str | PipelineVariable | None = Unassigned(), identity_center_user_token: IdentityCenterUserToken | None = Unassigned(), session: Session | None = None, region: str | None = None) HyperParameterTuningJobInternal | None[source]#

Create a HyperParameterTuningJobInternal resource

Parameters:
  • hyper_parameter_tuning_job_name

  • hyper_parameter_tuning_job_config

  • customer_details

  • training_job_definition

  • training_job_definitions

  • warm_start_config

  • tags

  • autotune

  • fas_credentials

  • auto_ml_job_arn

  • billing_mode

  • source_identity

  • identity_center_user_token

  • session – Boto3 session.

  • region – Region name.

Returns:

The HyperParameterTuningJobInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

customer_details: CustomerDetails#
fas_credentials: str | PipelineVariable | None#
get_name() str[source]#
hyper_parameter_tuning_job_arn: str | PipelineVariable#
hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig#
hyper_parameter_tuning_job_name: str | PipelineVariable | object#
identity_center_user_token: IdentityCenterUserToken | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source_identity: str | PipelineVariable | None#
stop() None[source]#

Stop a HyperParameterTuningJobInternal resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

tags: List[Tag] | None#
training_job_definition: HyperParameterTrainingJobDefinition | None#
training_job_definitions: List[HyperParameterTrainingJobDefinition] | None#
warm_start_config: HyperParameterTuningJobWarmStartConfig | None#
class sagemaker.core.resources.Image(*, image_name: str | PipelineVariable, creation_time: datetime | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), image_arn: str | PipelineVariable | None = Unassigned(), image_status: str | PipelineVariable | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Image

creation_time#

When the image was created.

Type:

datetime.datetime | None

description#

The description of the image.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

display_name#

The name of the image as displayed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

When a create, update, or delete operation fails, the reason for the failure.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

image_arn#

The ARN of the image.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

image_name#

The name of the image.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

image_status#

The status of the image.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

When the image was last modified.

Type:

datetime.datetime | None

role_arn#

The ARN of the IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(image_name: str | PipelineVariable, role_arn: str | PipelineVariable, description: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Image | None[source]#

Create a Image resource

Parameters:
  • image_name – The name of the image. Must be unique to your account.

  • role_arn – The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.

  • description – The description of the image.

  • display_name – The display name of the image. If not provided, ImageName is displayed.

  • tags – A list of tags to apply to the image.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Image resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a Image resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
display_name: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(image_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Image | None[source]#

Get a Image resource

Parameters:
  • image_name – The name of the image to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Image resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Image][source]#

Get all Image resources

Parameters:
  • creation_time_after – A filter that returns only images created on or after the specified time.

  • creation_time_before – A filter that returns only images created on or before the specified time.

  • last_modified_time_after – A filter that returns only images modified on or after the specified time.

  • last_modified_time_before – A filter that returns only images modified on or before the specified time.

  • max_results – The maximum number of images to return in the response. The default value is 10.

  • name_contains – A filter that returns only images whose name contains the specified string.

  • next_token – If the previous call to ListImages didn’t return the full set of images, the call returns a token for getting the next set of images.

  • sort_by – The property used to sort results. The default value is CREATION_TIME.

  • sort_order – The sort order. The default value is DESCENDING.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Image resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_aliases(alias: str | PipelineVariable | None = Unassigned(), version: int | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[str][source]#

Lists the aliases of a specified image or image version.

Parameters:
  • alias – The alias of the image version.

  • version – The version of the image. If image version is not specified, the aliases of all versions of the image are listed.

  • max_results – The maximum number of aliases to return.

  • next_token – If the previous call to ListAliases didn’t return the full set of aliases, the call returns a token for retrieving the next set of aliases.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed str.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
image_arn: str | PipelineVariable | None#
image_name: str | PipelineVariable#
image_status: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() Image | None[source]#

Refresh a Image resource

Returns:

The Image resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
update(delete_properties: List[str | PipelineVariable] | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned()) Image | None[source]#

Update a Image resource

Parameters:

delete_properties – A list of properties to delete. Only the Description and DisplayName properties can be deleted.

Returns:

The Image resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Image resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['CREATING', 'CREATED', 'CREATE_FAILED', 'UPDATING', 'UPDATE_FAILED', 'DELETING', 'DELETE_FAILED'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Image resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ImageVersion(*, image_name: str | PipelineVariable, base_image: str | PipelineVariable | None = Unassigned(), container_image: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), image_arn: str | PipelineVariable | None = Unassigned(), image_version_arn: str | PipelineVariable | None = Unassigned(), image_version_status: str | PipelineVariable | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), version: int | None = Unassigned(), vendor_guidance: str | PipelineVariable | None = Unassigned(), job_type: str | PipelineVariable | None = Unassigned(), ml_framework: str | PipelineVariable | None = Unassigned(), programming_lang: str | PipelineVariable | None = Unassigned(), processor: str | PipelineVariable | None = Unassigned(), horovod: bool | None = Unassigned(), override_alias_image_version: bool | None = Unassigned(), soci_image: bool | None = Unassigned(), release_notes: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ImageVersion

base_image#

The registry path of the container image on which this image version is based.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

container_image#

The registry path of the container image that contains this image version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

When the version was created.

Type:

datetime.datetime | None

failure_reason#

When a create or delete operation fails, the reason for the failure.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

image_arn#

The ARN of the image the version is based on.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

image_version_arn#

The ARN of the version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

image_version_status#

The status of the version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

When the version was last modified.

Type:

datetime.datetime | None

version#

The version number.

Type:

int | None

vendor_guidance#

The stability of the image version specified by the maintainer. NOT_PROVIDED: The maintainers did not provide a status for image version stability. STABLE: The image version is stable. TO_BE_ARCHIVED: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months. ARCHIVED: The image version is archived. Archived image versions are not searchable and are no longer actively supported.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_type#

Indicates SageMaker AI job type compatibility. TRAINING: The image version is compatible with SageMaker AI training jobs. INFERENCE: The image version is compatible with SageMaker AI inference jobs. NOTEBOOK_KERNEL: The image version is compatible with SageMaker AI notebook kernels.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ml_framework#

The machine learning framework vended in the image version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

programming_lang#

The supported programming language and its version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

processor#

Indicates CPU or GPU compatibility. CPU: The image version is compatible with CPU. GPU: The image version is compatible with GPU.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

horovod#

Indicates Horovod compatibility.

Type:

bool | None

override_alias_image_version#
Type:

bool | None

soci_image#
Type:

bool | None

release_notes#

The maintainer description of the image version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

base_image: str | PipelineVariable | None#
container_image: str | PipelineVariable | None#
classmethod create(base_image: str | PipelineVariable, client_token: str | PipelineVariable, image_name: str | PipelineVariable | object, aliases: List[str | PipelineVariable] | None = Unassigned(), vendor_guidance: str | PipelineVariable | None = Unassigned(), job_type: str | PipelineVariable | None = Unassigned(), ml_framework: str | PipelineVariable | None = Unassigned(), programming_lang: str | PipelineVariable | None = Unassigned(), processor: str | PipelineVariable | None = Unassigned(), horovod: bool | None = Unassigned(), override_alias_image_version: bool | None = Unassigned(), release_notes: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ImageVersion | None[source]#

Create a ImageVersion resource

Parameters:
  • base_image – The registry path of the container image to use as the starting point for this version. The path is an Amazon ECR URI in the following format: &lt;acct-id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/&lt;repo-name[:tag] or [@digest]&gt;

  • client_token – A unique ID. If not specified, the Amazon Web Services CLI and Amazon Web Services SDKs, such as the SDK for Python (Boto3), add a unique value to the call.

  • image_name – The ImageName of the Image to create a version of.

  • aliases – A list of aliases created with the image version.

  • vendor_guidance – The stability of the image version, specified by the maintainer. NOT_PROVIDED: The maintainers did not provide a status for image version stability. STABLE: The image version is stable. TO_BE_ARCHIVED: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months. ARCHIVED: The image version is archived. Archived image versions are not searchable and are no longer actively supported.

  • job_type – Indicates SageMaker AI job type compatibility. TRAINING: The image version is compatible with SageMaker AI training jobs. INFERENCE: The image version is compatible with SageMaker AI inference jobs. NOTEBOOK_KERNEL: The image version is compatible with SageMaker AI notebook kernels.

  • ml_framework – The machine learning framework vended in the image version.

  • programming_lang – The supported programming language and its version.

  • processor – Indicates CPU or GPU compatibility. CPU: The image version is compatible with CPU. GPU: The image version is compatible with GPU.

  • horovod – Indicates Horovod compatibility.

  • override_alias_image_version

  • release_notes – The maintainer description of the image version.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ImageVersion resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete(alias: str | PipelineVariable | None = Unassigned()) None[source]#

Delete a ImageVersion resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

failure_reason: str | PipelineVariable | None#
classmethod get(image_name: str | PipelineVariable, version: int | None = Unassigned(), alias: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ImageVersion | None[source]#

Get a ImageVersion resource

Parameters:
  • image_name – The name of the image.

  • version – The version of the image. If not specified, the latest version is described.

  • alias – The alias of the image version.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ImageVersion resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
horovod: bool | None#
image_arn: str | PipelineVariable | None#
image_name: str | PipelineVariable#
image_version_arn: str | PipelineVariable | None#
image_version_status: str | PipelineVariable | None#
job_type: str | PipelineVariable | None#
last_modified_time: datetime | None#
ml_framework: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

override_alias_image_version: bool | None#
processor: str | PipelineVariable | None#
programming_lang: str | PipelineVariable | None#
refresh(alias: str | PipelineVariable | None = Unassigned()) ImageVersion | None[source]#

Refresh a ImageVersion resource

Returns:

The ImageVersion resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

release_notes: str | PipelineVariable | None#
soci_image: bool | None#
update(alias: str | PipelineVariable | None = Unassigned(), version: int | None = Unassigned(), aliases_to_add: List[str | PipelineVariable] | None = Unassigned(), aliases_to_delete: List[str | PipelineVariable] | None = Unassigned(), vendor_guidance: str | PipelineVariable | None = Unassigned(), job_type: str | PipelineVariable | None = Unassigned(), ml_framework: str | PipelineVariable | None = Unassigned(), programming_lang: str | PipelineVariable | None = Unassigned(), processor: str | PipelineVariable | None = Unassigned(), horovod: bool | None = Unassigned(), release_notes: str | PipelineVariable | None = Unassigned()) ImageVersion | None[source]#

Update a ImageVersion resource

Parameters:
  • alias – The alias of the image version.

  • aliases_to_add – A list of aliases to add.

  • aliases_to_delete – A list of aliases to delete.

Returns:

The ImageVersion resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

vendor_guidance: str | PipelineVariable | None#
version: int | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ImageVersion resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['CREATING', 'CREATED', 'CREATE_FAILED', 'DELETING', 'DELETE_FAILED'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ImageVersion resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.InferenceComponent(*, inference_component_name: str | PipelineVariable, inference_component_arn: str | PipelineVariable | None = Unassigned(), endpoint_name: str | PipelineVariable | None = Unassigned(), endpoint_arn: str | PipelineVariable | None = Unassigned(), variant_name: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), specification: InferenceComponentSpecificationSummary | None = Unassigned(), runtime_config: InferenceComponentRuntimeConfigSummary | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), inference_component_status: str | PipelineVariable | None = Unassigned(), last_deployment_config: InferenceComponentDeploymentConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource InferenceComponent

inference_component_name#

The name of the inference component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

inference_component_arn#

The Amazon Resource Name (ARN) of the inference component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

endpoint_name#

The name of the endpoint that hosts the inference component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

endpoint_arn#

The Amazon Resource Name (ARN) of the endpoint that hosts the inference component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time when the inference component was created.

Type:

datetime.datetime | None

last_modified_time#

The time when the inference component was last updated.

Type:

datetime.datetime | None

variant_name#

The name of the production variant that hosts the inference component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

If the inference component status is Failed, the reason for the failure.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

specification#

Details about the resources that are deployed with this inference component.

Type:

sagemaker.core.shapes.shapes.InferenceComponentSpecificationSummary | None

runtime_config#

Details about the runtime settings for the model that is deployed with the inference component.

Type:

sagemaker.core.shapes.shapes.InferenceComponentRuntimeConfigSummary | None

inference_component_status#

The status of the inference component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_deployment_config#

The deployment and rollback settings that you assigned to the inference component.

Type:

sagemaker.core.shapes.shapes.InferenceComponentDeploymentConfig | None

classmethod create(inference_component_name: str | PipelineVariable, endpoint_name: str | PipelineVariable | object, specification: InferenceComponentSpecification, variant_name: str | PipelineVariable | None = Unassigned(), runtime_config: InferenceComponentRuntimeConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) InferenceComponent | None[source]#

Create a InferenceComponent resource

Parameters:
  • inference_component_name – A unique name to assign to the inference component.

  • endpoint_name – The name of an existing endpoint where you host the inference component.

  • specification – Details about the resources to deploy with this inference component, including the model, container, and compute resources.

  • variant_name – The name of an existing production variant where you host the inference component.

  • runtime_config – Runtime settings for a model that is deployed with an inference component.

  • tags – A list of key-value pairs associated with the model. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.

  • session – Boto3 session.

  • region – Region name.

Returns:

The InferenceComponent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a InferenceComponent resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

endpoint_arn: str | PipelineVariable | None#
endpoint_name: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(inference_component_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) InferenceComponent | None[source]#

Get a InferenceComponent resource

Parameters:
  • inference_component_name – The name of the inference component.

  • session – Boto3 session.

  • region – Region name.

Returns:

The InferenceComponent resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), endpoint_name_equals: str | PipelineVariable | None = Unassigned(), variant_name_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[InferenceComponent][source]#

Get all InferenceComponent resources

Parameters:
  • sort_by – The field by which to sort the inference components in the response. The default is CreationTime.

  • sort_order – The sort order for results. The default is Descending.

  • next_token – A token that you use to get the next set of results following a truncated response. If the response to the previous request was truncated, that response provides the value for this token.

  • max_results – The maximum number of inference components to return in the response. This value defaults to 10.

  • name_contains – Filters the results to only those inference components with a name that contains the specified string.

  • creation_time_before – Filters the results to only those inference components that were created before the specified time.

  • creation_time_after – Filters the results to only those inference components that were created after the specified time.

  • last_modified_time_before – Filters the results to only those inference components that were updated before the specified time.

  • last_modified_time_after – Filters the results to only those inference components that were updated after the specified time.

  • status_equals – Filters the results to only those inference components with the specified status.

  • endpoint_name_equals – An endpoint name to filter the listed inference components. The response includes only those inference components that are hosted at the specified endpoint.

  • variant_name_equals – A production variant name to filter the listed inference components. The response includes only those inference components that are hosted at the specified variant.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed InferenceComponent resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
inference_component_arn: str | PipelineVariable | None#
inference_component_name: str | PipelineVariable#
inference_component_status: str | PipelineVariable | None#
last_deployment_config: InferenceComponentDeploymentConfig | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() InferenceComponent | None[source]#

Refresh a InferenceComponent resource

Returns:

The InferenceComponent resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

runtime_config: InferenceComponentRuntimeConfigSummary | None#
specification: InferenceComponentSpecificationSummary | None#
update(specification: InferenceComponentSpecification | None = Unassigned(), runtime_config: InferenceComponentRuntimeConfig | None = Unassigned(), deployment_config: InferenceComponentDeploymentConfig | None = Unassigned()) InferenceComponent | None[source]#

Update a InferenceComponent resource

Parameters:

deployment_config – The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.

Returns:

The InferenceComponent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

update_runtime_configs(desired_runtime_config: InferenceComponentRuntimeConfig, session: Session | None = None, region: str | None = None) None[source]#

Runtime settings for a model that is deployed with an inference component.

Parameters:
  • desired_runtime_config – Runtime settings for a model that is deployed with an inference component.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

variant_name: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a InferenceComponent resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['InService', 'Creating', 'Updating', 'Failed', 'Deleting'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a InferenceComponent resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.InferenceExperiment(*, name: str | PipelineVariable, arn: str | PipelineVariable | None = Unassigned(), type: str | PipelineVariable | None = Unassigned(), schedule: InferenceExperimentSchedule | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), status_reason: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), completion_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), endpoint_metadata: EndpointMetadata | None = Unassigned(), model_variants: List[ModelVariantConfigSummary] | None = Unassigned(), data_storage_config: InferenceExperimentDataStorageConfig | None = Unassigned(), shadow_mode_config: ShadowModeConfig | None = Unassigned(), kms_key: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource InferenceExperiment

arn#

The ARN of the inference experiment being described.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

name#

The name of the inference experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

type#

The type of the inference experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status of the inference experiment. The following are the possible statuses for an inference experiment: Creating - Amazon SageMaker is creating your experiment. Created - Amazon SageMaker has finished the creation of your experiment and will begin the experiment at the scheduled time. Updating - When you make changes to your experiment, your experiment shows as updating. Starting - Amazon SageMaker is beginning your experiment. Running - Your experiment is in progress. Stopping - Amazon SageMaker is stopping your experiment. Completed - Your experiment has completed. Cancelled - When you conclude your experiment early using the StopInferenceExperiment API, or if any operation fails with an unexpected error, it shows as cancelled.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

endpoint_metadata#

The metadata of the endpoint on which the inference experiment ran.

Type:

sagemaker.core.shapes.shapes.EndpointMetadata | None

model_variants#

An array of ModelVariantConfigSummary objects. There is one for each variant in the inference experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure configuration for deploying the corresponding variant.

Type:

List[sagemaker.core.shapes.shapes.ModelVariantConfigSummary] | None

schedule#

The duration for which the inference experiment ran or will run.

Type:

sagemaker.core.shapes.shapes.InferenceExperimentSchedule | None

status_reason#

The error message or client-specified Reason from the StopInferenceExperiment API, that explains the status of the inference experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

The description of the inference experiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The timestamp at which you created the inference experiment.

Type:

datetime.datetime | None

completion_time#

The timestamp at which the inference experiment was completed.

Type:

datetime.datetime | None

last_modified_time#

The timestamp at which you last modified the inference experiment.

Type:

datetime.datetime | None

role_arn#

The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

data_storage_config#

The Amazon S3 location and configuration for storing inference request and response data.

Type:

sagemaker.core.shapes.shapes.InferenceExperimentDataStorageConfig | None

shadow_mode_config#

The configuration of ShadowMode inference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant it also shows the percentage of requests that Amazon SageMaker replicates.

Type:

sagemaker.core.shapes.shapes.ShadowModeConfig | None

kms_key#

The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. For more information, see CreateInferenceExperiment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

arn: str | PipelineVariable | None#
completion_time: datetime | None#
classmethod create(name: str | PipelineVariable, type: str | PipelineVariable, role_arn: str | PipelineVariable, endpoint_name: str | PipelineVariable | object, model_variants: List[ModelVariantConfig], shadow_mode_config: ShadowModeConfig, schedule: InferenceExperimentSchedule | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), data_storage_config: InferenceExperimentDataStorageConfig | None = Unassigned(), kms_key: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) InferenceExperiment | None[source]#

Create a InferenceExperiment resource

Parameters:
  • name – The name for the inference experiment.

  • type – The type of the inference experiment that you want to run. The following types of experiments are possible: ShadowMode: You can use this type to validate a shadow variant. For more information, see Shadow tests.

  • role_arn – The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.

  • endpoint_name – The name of the Amazon SageMaker endpoint on which you want to run the inference experiment.

  • model_variants – An array of ModelVariantConfig objects. There is one for each variant in the inference experiment. Each ModelVariantConfig object in the array describes the infrastructure configuration for the corresponding variant.

  • shadow_mode_config – The configuration of ShadowMode inference experiment type. Use this field to specify a production variant which takes all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant also specify the percentage of requests that Amazon SageMaker replicates.

  • schedule – The duration for which you want the inference experiment to run. If you don’t specify this field, the experiment automatically starts immediately upon creation and concludes after 7 days.

  • description – A description for the inference experiment.

  • data_storage_config – The Amazon S3 location and configuration for storing inference request and response data. This is an optional parameter that you can use for data capture. For more information, see Capture data.

  • kms_key – The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint. The KmsKey can be any of the following formats: KMS key ID “1234abcd-12ab-34cd-56ef-1234567890ab” Amazon Resource Name (ARN) of a KMS key “arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab” KMS key Alias “alias/ExampleAlias” Amazon Resource Name (ARN) of a KMS key Alias “arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias” If you use a KMS key ID or an alias of your KMS key, the Amazon SageMaker execution role must include permissions to call kms:Encrypt. If you don’t provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account. Amazon SageMaker uses server-side encryption with KMS managed keys for OutputDataConfig. If you use a bucket policy with an s3:PutObject permission that only allows objects with server-side encryption, set the condition key of s3:x-amz-server-side-encryption to “aws:kms”. For more information, see KMS managed Encryption Keys in the Amazon Simple Storage Service Developer Guide. The KMS key policy must grant permission to the IAM role that you specify in your CreateEndpoint and UpdateEndpoint requests. For more information, see Using Key Policies in Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.

  • tags – Array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging your Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Returns:

The InferenceExperiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
data_storage_config: InferenceExperimentDataStorageConfig | None#
delete() None[source]#

Delete a InferenceExperiment resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
endpoint_metadata: EndpointMetadata | None#
classmethod get(name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) InferenceExperiment | None[source]#

Get a InferenceExperiment resource

Parameters:
  • name – The name of the inference experiment to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The InferenceExperiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), type: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[InferenceExperiment][source]#

Get all InferenceExperiment resources

Parameters:
  • name_contains – Selects inference experiments whose names contain this name.

  • type – Selects inference experiments of this type. For the possible types of inference experiments, see CreateInferenceExperiment.

  • status_equals – Selects inference experiments which are in this status. For the possible statuses, see DescribeInferenceExperiment.

  • creation_time_after – Selects inference experiments which were created after this timestamp.

  • creation_time_before – Selects inference experiments which were created before this timestamp.

  • last_modified_time_after – Selects inference experiments which were last modified after this timestamp.

  • last_modified_time_before – Selects inference experiments which were last modified before this timestamp.

  • sort_by – The column by which to sort the listed inference experiments.

  • sort_order – The direction of sorting (ascending or descending).

  • next_token – The response from the last list when returning a list large enough to need tokening.

  • max_results – The maximum number of results to select.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed InferenceExperiment resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
kms_key: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_variants: List[ModelVariantConfigSummary] | None#
name: str | PipelineVariable#
populate_inputs_decorator()[source]#
refresh() InferenceExperiment | None[source]#

Refresh a InferenceExperiment resource

Returns:

The InferenceExperiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
schedule: InferenceExperimentSchedule | None#
shadow_mode_config: ShadowModeConfig | None#
start(session: Session | None = None, region: str | None = None) None[source]#

Start a InferenceExperiment resource

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

status: str | PipelineVariable | None#
status_reason: str | PipelineVariable | None#
stop() None[source]#

Stop a InferenceExperiment resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

type: str | PipelineVariable | None#
update(schedule: InferenceExperimentSchedule | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), model_variants: List[ModelVariantConfig] | None = Unassigned(), data_storage_config: InferenceExperimentDataStorageConfig | None = Unassigned(), shadow_mode_config: ShadowModeConfig | None = Unassigned()) InferenceExperiment | None[source]#

Update a InferenceExperiment resource

Returns:

The InferenceExperiment resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Creating', 'Created', 'Updating', 'Running', 'Starting', 'Stopping', 'Completed', 'Cancelled'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a InferenceExperiment resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.InferenceRecommendationsJob(*, job_name: str | PipelineVariable, job_description: str | PipelineVariable | None = Unassigned(), job_type: str | PipelineVariable | None = Unassigned(), job_arn: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), completion_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), input_config: RecommendationJobInputConfig | None = Unassigned(), stopping_conditions: RecommendationJobStoppingConditions | None = Unassigned(), endpoint_configuration_tuning: RecommendationJobEndpointConfigurationTuning | None = Unassigned(), inference_recommendations: List[InferenceRecommendation] | None = Unassigned(), endpoint_performances: List[EndpointPerformance] | None = Unassigned(), output_config: RecommendationJobOutputConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource InferenceRecommendationsJob

job_name#

The name of the job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

job_type#

The job type that you provided when you initiated the job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_arn#

The Amazon Resource Name (ARN) of the job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

role_arn#

The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) role you provided when you initiated the job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status of the job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

A timestamp that shows when the job was created.

Type:

datetime.datetime | None

last_modified_time#

A timestamp that shows when the job was last modified.

Type:

datetime.datetime | None

input_config#

Returns information about the versioned model package Amazon Resource Name (ARN), the traffic pattern, and endpoint configurations you provided when you initiated the job.

Type:

sagemaker.core.shapes.shapes.RecommendationJobInputConfig | None

job_description#

The job description that you provided when you initiated the job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

completion_time#

A timestamp that shows when the job completed.

Type:

datetime.datetime | None

failure_reason#

If the job fails, provides information why the job failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

stopping_conditions#

The stopping conditions that you provided when you initiated the job.

Type:

sagemaker.core.shapes.shapes.RecommendationJobStoppingConditions | None

endpoint_configuration_tuning#
Type:

sagemaker.core.shapes.shapes.RecommendationJobEndpointConfigurationTuning | None

inference_recommendations#

The recommendations made by Inference Recommender.

Type:

List[sagemaker.core.shapes.shapes.InferenceRecommendation] | None

endpoint_performances#

The performance results from running an Inference Recommender job on an existing endpoint.

Type:

List[sagemaker.core.shapes.shapes.EndpointPerformance] | None

output_config#
Type:

sagemaker.core.shapes.shapes.RecommendationJobOutputConfig | None

completion_time: datetime | None#
classmethod create(job_name: str | PipelineVariable, job_type: str | PipelineVariable, role_arn: str | PipelineVariable, input_config: RecommendationJobInputConfig, job_description: str | PipelineVariable | None = Unassigned(), stopping_conditions: RecommendationJobStoppingConditions | None = Unassigned(), endpoint_configuration_tuning: RecommendationJobEndpointConfigurationTuning | None = Unassigned(), output_config: RecommendationJobOutputConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) InferenceRecommendationsJob | None[source]#

Create a InferenceRecommendationsJob resource

Parameters:
  • job_name – A name for the recommendation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account. The job name is passed down to the resources created by the recommendation job. The names of resources (such as the model, endpoint configuration, endpoint, and compilation) that are prefixed with the job name are truncated at 40 characters.

  • job_type – Defines the type of recommendation job. Specify Default to initiate an instance recommendation and Advanced to initiate a load test. If left unspecified, Amazon SageMaker Inference Recommender will run an instance recommendation (DEFAULT) job.

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf.

  • input_config – Provides information about the versioned model package Amazon Resource Name (ARN), the traffic pattern, and endpoint configurations.

  • job_description – Description of the recommendation job.

  • stopping_conditions – A set of conditions for stopping a recommendation job. If any of the conditions are met, the job is automatically stopped.

  • endpoint_configuration_tuning

  • output_config – Provides information about the output artifacts and the KMS key to use for Amazon S3 server-side encryption.

  • tags – The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.

  • session – Boto3 session.

  • region – Region name.

Returns:

The InferenceRecommendationsJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a InferenceRecommendationsJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

endpoint_configuration_tuning: RecommendationJobEndpointConfigurationTuning | None#
endpoint_performances: List[EndpointPerformance] | None#
failure_reason: str | PipelineVariable | None#
classmethod get(job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) InferenceRecommendationsJob | None[source]#

Get a InferenceRecommendationsJob resource

Parameters:
  • job_name – The name of the job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • session – Boto3 session.

  • region – Region name.

Returns:

The InferenceRecommendationsJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), model_name_equals: str | PipelineVariable | None = Unassigned(), model_package_version_arn_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[InferenceRecommendationsJob][source]#

Get all InferenceRecommendationsJob resources

Parameters:
  • creation_time_after – A filter that returns only jobs created after the specified time (timestamp).

  • creation_time_before – A filter that returns only jobs created before the specified time (timestamp).

  • last_modified_time_after – A filter that returns only jobs that were last modified after the specified time (timestamp).

  • last_modified_time_before – A filter that returns only jobs that were last modified before the specified time (timestamp).

  • name_contains – A string in the job name. This filter returns only recommendations whose name contains the specified string.

  • status_equals – A filter that retrieves only inference recommendations jobs with a specific status.

  • sort_by – The parameter by which to sort the results.

  • sort_order – The sort order for the results.

  • next_token – If the response to a previous ListInferenceRecommendationsJobsRequest request was truncated, the response includes a NextToken. To retrieve the next set of recommendations, use the token in the next request.

  • max_results – The maximum number of recommendations to return in the response.

  • model_name_equals – A filter that returns only jobs that were created for this model.

  • model_package_version_arn_equals – A filter that returns only jobs that were created for this versioned model package.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed InferenceRecommendationsJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_steps(step_type: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[InferenceRecommendationsJobStep][source]#

Returns a list of the subtasks for an Inference Recommender job.

Parameters:
  • step_type – A filter to return details about the specified type of subtask. BENCHMARK: Evaluate the performance of your model on different instance types.

  • max_results – The maximum number of results to return.

  • next_token – A token that you can specify to return more results from the list. Specify this field if you have a token that was returned from a previous request.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed InferenceRecommendationsJobStep.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
inference_recommendations: List[InferenceRecommendation] | None#
input_config: RecommendationJobInputConfig | None#
job_arn: str | PipelineVariable | None#
job_description: str | PipelineVariable | None#
job_name: str | PipelineVariable#
job_type: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_config: RecommendationJobOutputConfig | None#
populate_inputs_decorator()[source]#
refresh() InferenceRecommendationsJob | None[source]#

Refresh a InferenceRecommendationsJob resource

Returns:

The InferenceRecommendationsJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
status: str | PipelineVariable | None#
stop() None[source]#

Stop a InferenceRecommendationsJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stopping_conditions: RecommendationJobStoppingConditions | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a InferenceRecommendationsJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a InferenceRecommendationsJob resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

class sagemaker.core.resources.LabelingJob(*, labeling_job_name: str | PipelineVariable, labeling_job_status: str | PipelineVariable | None = Unassigned(), label_counters: LabelCounters | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), job_reference_code: str | PipelineVariable | None = Unassigned(), labeling_job_arn: str | PipelineVariable | None = Unassigned(), label_attribute_name: str | PipelineVariable | None = Unassigned(), input_config: LabelingJobInputConfig | None = Unassigned(), output_config: LabelingJobOutputConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), task_rendering_role_arn: str | PipelineVariable | None = Unassigned(), label_category_config_s3_uri: str | PipelineVariable | None = Unassigned(), stopping_conditions: LabelingJobStoppingConditions | None = Unassigned(), labeling_job_algorithms_config: LabelingJobAlgorithmsConfig | None = Unassigned(), human_task_config: HumanTaskConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), labeling_job_output: LabelingJobOutput | None = Unassigned())[source]#

Bases: Base

Class representing resource LabelingJob

labeling_job_status#

The processing status of the labeling job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

label_counters#

Provides a breakdown of the number of data objects labeled by humans, the number of objects labeled by machine, the number of objects than couldn’t be labeled, and the total number of objects labeled.

Type:

sagemaker.core.shapes.shapes.LabelCounters | None

creation_time#

The date and time that the labeling job was created.

Type:

datetime.datetime | None

last_modified_time#

The date and time that the labeling job was last updated.

Type:

datetime.datetime | None

job_reference_code#

A unique identifier for work done as part of a labeling job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

labeling_job_name#

The name assigned to the labeling job when it was created.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

labeling_job_arn#

The Amazon Resource Name (ARN) of the labeling job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

input_config#

Input configuration information for the labeling job, such as the Amazon S3 location of the data objects and the location of the manifest file that describes the data objects.

Type:

sagemaker.core.shapes.shapes.LabelingJobInputConfig | None

output_config#

The location of the job’s output data and the Amazon Web Services Key Management Service key ID for the key used to encrypt the output data, if any.

Type:

sagemaker.core.shapes.shapes.LabelingJobOutputConfig | None

role_arn#

The Amazon Resource Name (ARN) that SageMaker assumes to perform tasks on your behalf during data labeling.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

human_task_config#

Configuration information required for human workers to complete a labeling task.

Type:

sagemaker.core.shapes.shapes.HumanTaskConfig | None

failure_reason#

If the job failed, the reason that it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

label_attribute_name#

The attribute used as the label in the output manifest file.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

task_rendering_role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

label_category_config_s3_uri#

The S3 location of the JSON file that defines the categories used to label data objects. Please note the following label-category limits: Semantic segmentation labeling jobs using automated labeling: 20 labels Box bounding labeling jobs (all): 10 labels The file is a JSON structure in the following format: { “document-version”: “2018-11-28” “labels”: [ { “label”: “label 1” }, { “label”: “label 2” }, … { “label”: “label n” } ] }

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

stopping_conditions#

A set of conditions for stopping a labeling job. If any of the conditions are met, the job is automatically stopped.

Type:

sagemaker.core.shapes.shapes.LabelingJobStoppingConditions | None

labeling_job_algorithms_config#

Configuration information for automated data labeling.

Type:

sagemaker.core.shapes.shapes.LabelingJobAlgorithmsConfig | None

tags#

An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

Type:

List[sagemaker.core.shapes.shapes.Tag] | None

labeling_job_output#

The location of the output produced by the labeling job.

Type:

sagemaker.core.shapes.shapes.LabelingJobOutput | None

classmethod create(labeling_job_name: str | PipelineVariable, label_attribute_name: str | PipelineVariable, input_config: LabelingJobInputConfig, output_config: LabelingJobOutputConfig, role_arn: str | PipelineVariable, human_task_config: HumanTaskConfig, task_rendering_role_arn: str | PipelineVariable | None = Unassigned(), label_category_config_s3_uri: str | PipelineVariable | None = Unassigned(), stopping_conditions: LabelingJobStoppingConditions | None = Unassigned(), labeling_job_algorithms_config: LabelingJobAlgorithmsConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) LabelingJob | None[source]#

Create a LabelingJob resource

Parameters:
  • labeling_job_name – The name of the labeling job. This name is used to identify the job in a list of labeling jobs. Labeling job names must be unique within an Amazon Web Services account and region. LabelingJobName is not case sensitive. For example, Example-job and example-job are considered the same labeling job name by Ground Truth.

  • label_attribute_name – The attribute name to use for the label in the output manifest file. This is the key for the key/value pair formed with the label that a worker assigns to the object. The LabelAttributeName must meet the following requirements. The name can’t end with “-metadata”. If you are using one of the built-in task types or one of the following, the attribute name must end with “-ref”. Image semantic segmentation (SemanticSegmentation) and adjustment (AdjustmentSemanticSegmentation) labeling jobs for this task type. One exception is that verification (VerificationSemanticSegmentation) must not end with -“ref”. Video frame object detection (VideoObjectDetection), and adjustment and verification (AdjustmentVideoObjectDetection) labeling jobs for this task type. Video frame object tracking (VideoObjectTracking), and adjustment and verification (AdjustmentVideoObjectTracking) labeling jobs for this task type. 3D point cloud semantic segmentation (3DPointCloudSemanticSegmentation), and adjustment and verification (Adjustment3DPointCloudSemanticSegmentation) labeling jobs for this task type. 3D point cloud object tracking (3DPointCloudObjectTracking), and adjustment and verification (Adjustment3DPointCloudObjectTracking) labeling jobs for this task type. If you are creating an adjustment or verification labeling job, you must use a different LabelAttributeName than the one used in the original labeling job. The original labeling job is the Ground Truth labeling job that produced the labels that you want verified or adjusted. To learn more about adjustment and verification labeling jobs, see Verify and Adjust Labels.

  • input_config – Input data for the labeling job, such as the Amazon S3 location of the data objects and the location of the manifest file that describes the data objects. You must specify at least one of the following: S3DataSource or SnsDataSource. Use SnsDataSource to specify an SNS input topic for a streaming labeling job. If you do not specify and SNS input topic ARN, Ground Truth will create a one-time labeling job that stops after all data objects in the input manifest file have been labeled. Use S3DataSource to specify an input manifest file for both streaming and one-time labeling jobs. Adding an S3DataSource is optional if you use SnsDataSource to create a streaming labeling job. If you use the Amazon Mechanical Turk workforce, your input data should not include confidential information, personal information or protected health information. Use ContentClassifiers to specify that your data is free of personally identifiable information and adult content.

  • output_config – The location of the output data and the Amazon Web Services Key Management Service key ID for the key used to encrypt the output data, if any.

  • role_arn – The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform tasks on your behalf during data labeling. You must grant this role the necessary permissions so that Amazon SageMaker can successfully complete data labeling.

  • human_task_config – Configures the labeling task and how it is presented to workers; including, but not limited to price, keywords, and batch size (task count).

  • task_rendering_role_arn

  • label_category_config_s3_uri – The S3 URI of the file, referred to as a label category configuration file, that defines the categories used to label the data objects. For 3D point cloud and video frame task types, you can add label category attributes and frame attributes to your label category configuration file. To learn how, see Create a Labeling Category Configuration File for 3D Point Cloud Labeling Jobs. For named entity recognition jobs, in addition to “labels”, you must provide worker instructions in the label category configuration file using the “instructions” parameter: “instructions”: {“shortInstruction”:”&lt;h1&gt;Add header&lt;/h1&gt;&lt;p&gt;Add Instructions&lt;/p&gt;”, “fullInstruction”:”&lt;p&gt;Add additional instructions.&lt;/p&gt;”}. For details and an example, see Create a Named Entity Recognition Labeling Job (API) . For all other built-in task types and custom tasks, your label category configuration file must be a JSON file in the following format. Identify the labels you want to use by replacing label_1, label_2,…,label_n with your label categories. { “document-version”: “2018-11-28”, “labels”: [{“label”: “label_1”},{“label”: “label_2”},…{“label”: “label_n”}] } Note the following about the label category configuration file: For image classification and text classification (single and multi-label) you must specify at least two label categories. For all other task types, the minimum number of label categories required is one. Each label category must be unique, you cannot specify duplicate label categories. If you create a 3D point cloud or video frame adjustment or verification labeling job, you must include auditLabelAttributeName in the label category configuration. Use this parameter to enter the LabelAttributeName of the labeling job you want to adjust or verify annotations of.

  • stopping_conditions – A set of conditions for stopping the labeling job. If any of the conditions are met, the job is automatically stopped. You can use these conditions to control the cost of data labeling.

  • labeling_job_algorithms_config – Configures the information required to perform automated data labeling.

  • tags – An array of key/value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The LabelingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete(name_reuse_enabled: bool | None = Unassigned()) None[source]#

Delete a LabelingJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

failure_reason: str | PipelineVariable | None#
classmethod get(labeling_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) LabelingJob | None[source]#

Get a LabelingJob resource

Parameters:
  • labeling_job_name – The name of the labeling job to return information for.

  • session – Boto3 session.

  • region – Region name.

Returns:

The LabelingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[LabelingJob][source]#

Get all LabelingJob resources

Parameters:
  • creation_time_after – A filter that returns only labeling jobs created after the specified time (timestamp).

  • creation_time_before – A filter that returns only labeling jobs created before the specified time (timestamp).

  • last_modified_time_after – A filter that returns only labeling jobs modified after the specified time (timestamp).

  • last_modified_time_before – A filter that returns only labeling jobs modified before the specified time (timestamp).

  • max_results – The maximum number of labeling jobs to return in each page of the response.

  • next_token – If the result of the previous ListLabelingJobs request was truncated, the response includes a NextToken. To retrieve the next set of labeling jobs, use the token in the next request.

  • name_contains – A string in the labeling job name. This filter returns only labeling jobs whose name contains the specified string.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • status_equals – A filter that retrieves only labeling jobs with a specific status.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed LabelingJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
human_task_config: HumanTaskConfig | None#
input_config: LabelingJobInputConfig | None#
job_reference_code: str | PipelineVariable | None#
label_attribute_name: str | PipelineVariable | None#
label_category_config_s3_uri: str | PipelineVariable | None#
label_counters: LabelCounters | None#
labeling_job_algorithms_config: LabelingJobAlgorithmsConfig | None#
labeling_job_arn: str | PipelineVariable | None#
labeling_job_name: str | PipelineVariable#
labeling_job_output: LabelingJobOutput | None#
labeling_job_status: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_config: LabelingJobOutputConfig | None#
populate_inputs_decorator()[source]#
refresh() LabelingJob | None[source]#

Refresh a LabelingJob resource

Returns:

The LabelingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stop() None[source]#

Stop a LabelingJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stopping_conditions: LabelingJobStoppingConditions | None#
tags: List[Tag] | None#
task_rendering_role_arn: str | PipelineVariable | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a LabelingJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.LineageGroup(*, lineage_group_name: str | PipelineVariable, lineage_group_arn: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource LineageGroup

lineage_group_name#

The name of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

lineage_group_arn#

The Amazon Resource Name (ARN) of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

display_name#

The display name of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#

The description of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The creation time of lineage group.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

The last modified time of the lineage group.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

classmethod create(lineage_group_name: str | PipelineVariable, display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) LineageGroup | None[source]#

Create a LineageGroup resource

Parameters:
  • lineage_group_name

  • display_name

  • description

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The LineageGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a LineageGroup resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

description: str | PipelineVariable | None#
display_name: str | PipelineVariable | None#
classmethod get(lineage_group_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) LineageGroup | None[source]#

Get a LineageGroup resource

Parameters:
  • lineage_group_name – The name of the lineage group.

  • session – Boto3 session.

  • region – Region name.

Returns:

The LineageGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[LineageGroup][source]#

Get all LineageGroup resources

Parameters:
  • created_after – A timestamp to filter against lineage groups created after a certain point in time.

  • created_before – A timestamp to filter against lineage groups created before a certain point in time.

  • sort_by – The parameter by which to sort the results. The default is CreationTime.

  • sort_order – The sort order for the results. The default is Ascending.

  • next_token – If the response is truncated, SageMaker returns this token. To retrieve the next set of algorithms, use it in the subsequent request.

  • max_results – The maximum number of endpoints to return in the response. This value defaults to 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed LineageGroup resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
get_policy(session: Session | None = None, region: str | None = None) GetLineageGroupPolicyResponse | None[source]#

The resource policy for the lineage group.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

GetLineageGroupPolicyResponse

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

last_modified_by: UserContext | None#
last_modified_time: datetime | None#
lineage_group_arn: str | PipelineVariable | None#
lineage_group_name: str | PipelineVariable#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() LineageGroup | None[source]#

Refresh a LineageGroup resource

Returns:

The LineageGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.LineageGroupInternal(*, lineage_group_name: str | PipelineVariable | object, customer_details: CustomerDetails, display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned(), lineage_group_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource LineageGroupInternal

lineage_group_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

display_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#
Type:

datetime.datetime | None

tags#
Type:

List[sagemaker.core.shapes.shapes.Tag] | None

lineage_group_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(lineage_group_name: str | PipelineVariable | object, customer_details: CustomerDetails, display_name: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) LineageGroupInternal | None[source]#

Create a LineageGroupInternal resource

Parameters:
  • lineage_group_name

  • customer_details

  • display_name

  • description

  • creation_time

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The LineageGroupInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails#
description: str | PipelineVariable | None#
display_name: str | PipelineVariable | None#
get_name() str[source]#
lineage_group_arn: str | PipelineVariable | None#
lineage_group_name: str | PipelineVariable | object#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tags: List[Tag] | None#
class sagemaker.core.resources.MlflowApp(*, arn: str | PipelineVariable, name: str | PipelineVariable | None = Unassigned(), artifact_store_uri: str | PipelineVariable | None = Unassigned(), mlflow_version: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), url: str | PipelineVariable | None = Unassigned(), model_registration_mode: str | PipelineVariable | None = Unassigned(), account_default_status: str | PipelineVariable | None = Unassigned(), default_domain_id_list: List[str | PipelineVariable] | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), weekly_maintenance_window_start: str | PipelineVariable | None = Unassigned(), maintenance_status: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource MlflowApp

arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

artifact_store_uri#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

mlflow_version#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

role_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

url#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_registration_mode#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

account_default_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

default_domain_id_list#
Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

creation_time#
Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#
Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

weekly_maintenance_window_start#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

maintenance_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

account_default_status: str | PipelineVariable | None#
arn: str | PipelineVariable#
artifact_store_uri: str | PipelineVariable | None#
classmethod create(name: str | PipelineVariable, artifact_store_uri: str | PipelineVariable, role_arn: str | PipelineVariable, model_registration_mode: str | PipelineVariable | None = Unassigned(), weekly_maintenance_window_start: str | PipelineVariable | None = Unassigned(), account_default_status: str | PipelineVariable | None = Unassigned(), default_domain_id_list: List[str | PipelineVariable] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) MlflowApp | None[source]#

Create a MlflowApp resource

Parameters:
  • name

  • artifact_store_uri

  • role_arn

  • model_registration_mode

  • weekly_maintenance_window_start

  • account_default_status

  • default_domain_id_list

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The MlflowApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
default_domain_id_list: List[str | PipelineVariable] | None#
delete() None[source]#

Delete a MlflowApp resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) MlflowApp | None[source]#

Get a MlflowApp resource

Parameters:
  • arn

  • session – Boto3 session.

  • region – Region name.

Returns:

The MlflowApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), mlflow_version: str | PipelineVariable | None = Unassigned(), default_for_domain_id: str | PipelineVariable | None = Unassigned(), account_default_status: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[MlflowApp][source]#

Get all MlflowApp resources

Parameters:
  • created_after

  • created_before

  • status

  • mlflow_version

  • default_for_domain_id

  • account_default_status

  • sort_by

  • sort_order

  • next_token

  • max_results

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed MlflowApp resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
maintenance_status: str | PipelineVariable | None#
mlflow_version: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_registration_mode: str | PipelineVariable | None#
name: str | PipelineVariable | None#
refresh() MlflowApp | None[source]#

Refresh a MlflowApp resource

Returns:

The MlflowApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
status: str | PipelineVariable | None#
update(name: str | PipelineVariable | None = Unassigned(), artifact_store_uri: str | PipelineVariable | None = Unassigned(), model_registration_mode: str | PipelineVariable | None = Unassigned(), weekly_maintenance_window_start: str | PipelineVariable | None = Unassigned(), default_domain_id_list: List[str | PipelineVariable] | None = Unassigned(), account_default_status: str | PipelineVariable | None = Unassigned()) MlflowApp | None[source]#

Update a MlflowApp resource

Returns:

The MlflowApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

url: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a MlflowApp resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'Created', 'CreateFailed', 'Updating', 'Updated', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Deleted'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a MlflowApp resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
weekly_maintenance_window_start: str | PipelineVariable | None#
class sagemaker.core.resources.MlflowTrackingServer(*, tracking_server_name: str | PipelineVariable, tracking_server_arn: str | PipelineVariable | None = Unassigned(), artifact_store_uri: str | PipelineVariable | None = Unassigned(), tracking_server_size: str | PipelineVariable | None = Unassigned(), mlflow_version: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), tracking_server_status: str | PipelineVariable | None = Unassigned(), tracking_server_maintenance_status: str | PipelineVariable | None = Unassigned(), is_active: str | PipelineVariable | None = Unassigned(), tracking_server_url: str | PipelineVariable | None = Unassigned(), weekly_maintenance_window_start: str | PipelineVariable | None = Unassigned(), automatic_model_registration: bool | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), upgrade_rollback_version_details: UpgradeRollbackVersionDetails | None = Unassigned())[source]#

Bases: Base

Class representing resource MlflowTrackingServer

tracking_server_arn#

The ARN of the described tracking server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tracking_server_name#

The name of the described tracking server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

artifact_store_uri#

The S3 URI of the general purpose bucket used as the MLflow Tracking Server artifact store.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tracking_server_size#

The size of the described tracking server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

mlflow_version#

The MLflow version used for the described tracking server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

role_arn#

The Amazon Resource Name (ARN) for an IAM role in your account that the described MLflow Tracking Server uses to access the artifact store in Amazon S3.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tracking_server_status#

The current creation status of the described MLflow Tracking Server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tracking_server_maintenance_status#

The current maintenance status of the described MLflow Tracking Server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

is_active#

Whether the described MLflow Tracking Server is currently active.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tracking_server_url#

The URL to connect to the MLflow user interface for the described tracking server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

weekly_maintenance_window_start#

The day and time of the week when weekly maintenance occurs on the described tracking server.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

automatic_model_registration#

Whether automatic registration of new MLflow models to the SageMaker Model Registry is enabled.

Type:

bool | None

creation_time#

The timestamp of when the described MLflow Tracking Server was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

The timestamp of when the described MLflow Tracking Server was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

upgrade_rollback_version_details#
Type:

sagemaker.core.shapes.shapes.UpgradeRollbackVersionDetails | None

artifact_store_uri: str | PipelineVariable | None#
automatic_model_registration: bool | None#
classmethod create(tracking_server_name: str | PipelineVariable, artifact_store_uri: str | PipelineVariable, role_arn: str | PipelineVariable, tracking_server_size: str | PipelineVariable | None = Unassigned(), mlflow_version: str | PipelineVariable | None = Unassigned(), automatic_model_registration: bool | None = Unassigned(), weekly_maintenance_window_start: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) MlflowTrackingServer | None[source]#

Create a MlflowTrackingServer resource

Parameters:
  • tracking_server_name – A unique string identifying the tracking server name. This string is part of the tracking server ARN.

  • artifact_store_uri – The S3 URI for a general purpose bucket to use as the MLflow Tracking Server artifact store.

  • role_arn – The Amazon Resource Name (ARN) for an IAM role in your account that the MLflow Tracking Server uses to access the artifact store in Amazon S3. The role should have AmazonS3FullAccess permissions. For more information on IAM permissions for tracking server creation, see Set up IAM permissions for MLflow.

  • tracking_server_size – The size of the tracking server you want to create. You can choose between “Small”, “Medium”, and “Large”. The default MLflow Tracking Server configuration size is “Small”. You can choose a size depending on the projected use of the tracking server such as the volume of data logged, number of users, and frequency of use. We recommend using a small tracking server for teams of up to 25 users, a medium tracking server for teams of up to 50 users, and a large tracking server for teams of up to 100 users.

  • mlflow_version – The version of MLflow that the tracking server uses. To see which MLflow versions are available to use, see How it works.

  • automatic_model_registration – Whether to enable or disable automatic registration of new MLflow models to the SageMaker Model Registry. To enable automatic model registration, set this value to True. To disable automatic model registration, set this value to False. If not specified, AutomaticModelRegistration defaults to False.

  • weekly_maintenance_window_start – The day and time of the week in Coordinated Universal Time (UTC) 24-hour standard time that weekly maintenance updates are scheduled. For example: TUE:03:30.

  • tags – Tags consisting of key-value pairs used to manage metadata for the tracking server.

  • session – Boto3 session.

  • region – Region name.

Returns:

The MlflowTrackingServer resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a MlflowTrackingServer resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(tracking_server_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) MlflowTrackingServer | None[source]#

Get a MlflowTrackingServer resource

Parameters:
  • tracking_server_name – The name of the MLflow Tracking Server to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The MlflowTrackingServer resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), tracking_server_status: str | PipelineVariable | None = Unassigned(), mlflow_version: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[MlflowTrackingServer][source]#

Get all MlflowTrackingServer resources

Parameters:
  • created_after – Use the CreatedAfter filter to only list tracking servers created after a specific date and time. Listed tracking servers are shown with a date and time such as “2024-03-16T01:46:56+00:00”. The CreatedAfter parameter takes in a Unix timestamp. To convert a date and time into a Unix timestamp, see EpochConverter.

  • created_before – Use the CreatedBefore filter to only list tracking servers created before a specific date and time. Listed tracking servers are shown with a date and time such as “2024-03-16T01:46:56+00:00”. The CreatedBefore parameter takes in a Unix timestamp. To convert a date and time into a Unix timestamp, see EpochConverter.

  • tracking_server_status – Filter for tracking servers with a specified creation status.

  • mlflow_version – Filter for tracking servers using the specified MLflow version.

  • sort_by – Filter for trackings servers sorting by name, creation time, or creation status.

  • sort_order – Change the order of the listed tracking servers. By default, tracking servers are listed in Descending order by creation time. To change the list order, you can specify SortOrder to be Ascending.

  • next_token – If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

  • max_results – The maximum number of tracking servers to list.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed MlflowTrackingServer resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
is_active: str | PipelineVariable | None#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
mlflow_version: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() MlflowTrackingServer | None[source]#

Refresh a MlflowTrackingServer resource

Returns:

The MlflowTrackingServer resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
start(session: Session | None = None, region: str | None = None) None[source]#

Start a MlflowTrackingServer resource

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

stop() None[source]#

Stop a MlflowTrackingServer resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

tracking_server_arn: str | PipelineVariable | None#
tracking_server_maintenance_status: str | PipelineVariable | None#
tracking_server_name: str | PipelineVariable#
tracking_server_size: str | PipelineVariable | None#
tracking_server_status: str | PipelineVariable | None#
tracking_server_url: str | PipelineVariable | None#
update(artifact_store_uri: str | PipelineVariable | None = Unassigned(), tracking_server_size: str | PipelineVariable | None = Unassigned(), automatic_model_registration: bool | None = Unassigned(), weekly_maintenance_window_start: str | PipelineVariable | None = Unassigned()) MlflowTrackingServer | None[source]#

Update a MlflowTrackingServer resource

Returns:

The MlflowTrackingServer resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

upgrade_rollback_version_details: UpgradeRollbackVersionDetails | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a MlflowTrackingServer resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'Created', 'CreateFailed', 'Updating', 'Updated', 'UpdateFailed', 'Deleting', 'DeleteFailed', 'Stopping', 'Stopped', 'StopFailed', 'Starting', 'Started', 'StartFailed', 'MaintenanceInProgress', 'MaintenanceComplete', 'MaintenanceFailed', 'Upgrading', 'Upgraded', 'UpgradeFailed', 'RollingBack', 'RolledBack', 'RollbackFailed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a MlflowTrackingServer resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
weekly_maintenance_window_start: str | PipelineVariable | None#
class sagemaker.core.resources.Model(*, model_name: str | PipelineVariable, primary_container: ContainerDefinition | None = Unassigned(), containers: List[ContainerDefinition] | None = Unassigned(), inference_execution_config: InferenceExecutionConfig | None = Unassigned(), execution_role_arn: str | PipelineVariable | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), creation_time: datetime | None = Unassigned(), model_arn: str | PipelineVariable | None = Unassigned(), enable_network_isolation: bool | None = Unassigned(), deployment_recommendation: DeploymentRecommendation | None = Unassigned())[source]#

Bases: Base

Class representing resource Model

model_name#

Name of the SageMaker model.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

A timestamp that shows when the model was created.

Type:

datetime.datetime | None

model_arn#

The Amazon Resource Name (ARN) of the model.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

primary_container#

The location of the primary inference code, associated artifacts, and custom environment map that the inference code uses when it is deployed in production.

Type:

sagemaker.core.shapes.shapes.ContainerDefinition | None

containers#

The containers in the inference pipeline.

Type:

List[sagemaker.core.shapes.shapes.ContainerDefinition] | None

inference_execution_config#

Specifies details of how containers in a multi-container endpoint are called.

Type:

sagemaker.core.shapes.shapes.InferenceExecutionConfig | None

execution_role_arn#

The Amazon Resource Name (ARN) of the IAM role that you specified for the model.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

vpc_config#

A VpcConfig object that specifies the VPC that this model has access to. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud

Type:

sagemaker.core.shapes.shapes.VpcConfig | None

enable_network_isolation#

If True, no inbound or outbound network calls can be made to or from the model container.

Type:

bool | None

deployment_recommendation#

A set of recommended deployment configurations for the model.

Type:

sagemaker.core.shapes.shapes.DeploymentRecommendation | None

containers: List[ContainerDefinition] | None#
classmethod create(model_name: str | PipelineVariable, primary_container: ContainerDefinition | None = Unassigned(), containers: List[ContainerDefinition] | None = Unassigned(), inference_execution_config: InferenceExecutionConfig | None = Unassigned(), execution_role_arn: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), enable_network_isolation: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Model | None[source]#

Create a Model resource

Parameters:
  • model_name – The name of the new model.

  • primary_container – The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.

  • containers – Specifies the containers in the inference pipeline.

  • inference_execution_config – Specifies details of how containers in a multi-container endpoint are called.

  • execution_role_arn – The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs. Deploying on ML compute instances is part of model hosting. For more information, see SageMaker Roles. To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole permission.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • vpc_config – A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. VpcConfig is used in hosting services and in batch transform. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud.

  • enable_network_isolation – Isolates the model container. No inbound or outbound network calls can be made to or from the model container.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Model resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a Model resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

deployment_recommendation: DeploymentRecommendation | None#
enable_network_isolation: bool | None#
execution_role_arn: str | PipelineVariable | None#
classmethod get(model_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Model | None[source]#

Get a Model resource

Parameters:
  • model_name – The name of the model.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Model resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Model][source]#

Get all Model resources

Parameters:
  • sort_by – Sorts the list of results. The default is CreationTime.

  • sort_order – The sort order for results. The default is Descending.

  • next_token – If the response to a previous ListModels request was truncated, the response includes a NextToken. To retrieve the next set of models, use the token in the next request.

  • max_results – The maximum number of models to return in the response.

  • name_contains – A string in the model name. This filter returns only models whose name contains the specified string.

  • creation_time_before – A filter that returns only models created before the specified time (timestamp).

  • creation_time_after – A filter that returns only models with a creation time greater than or equal to the specified time (timestamp).

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Model resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_metadata(search_expression: ModelMetadataSearchExpression | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[ModelMetadataSummary][source]#

Lists the domain, framework, task, and model name of standard machine learning models found in common model zoos.

Parameters:
  • search_expression – One or more filters that searches for the specified resource or resources in a search. All resource objects that satisfy the expression’s condition are included in the search results. Specify the Framework, FrameworkVersion, Domain or Task to filter supported. Filter names and values are case-sensitive.

  • next_token – If the response to a previous ListModelMetadataResponse request was truncated, the response includes a NextToken. To retrieve the next set of model metadata, use the token in the next request.

  • max_results – The maximum number of models to return in the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelMetadataSummary.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
inference_execution_config: InferenceExecutionConfig | None#
model_arn: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_name: str | PipelineVariable#
populate_inputs_decorator()[source]#
primary_container: ContainerDefinition | None#
refresh() Model | None[source]#

Refresh a Model resource

Returns:

The Model resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

vpc_config: VpcConfig | None#
class sagemaker.core.resources.ModelBiasJobDefinition(*, job_definition_name: str | PipelineVariable, job_definition_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), model_bias_baseline_config: ModelBiasBaselineConfig | None = Unassigned(), model_bias_app_specification: ModelBiasAppSpecification | None = Unassigned(), model_bias_job_input: ModelBiasJobInput | None = Unassigned(), model_bias_job_output_config: MonitoringOutputConfig | None = Unassigned(), job_resources: MonitoringResources | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelBiasJobDefinition

job_definition_arn#

The Amazon Resource Name (ARN) of the model bias job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_definition_name#

The name of the bias job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The time at which the model bias job was created.

Type:

datetime.datetime | None

model_bias_app_specification#

Configures the model bias job to run a specified Docker container image.

Type:

sagemaker.core.shapes.shapes.ModelBiasAppSpecification | None

model_bias_job_input#

Inputs for the model bias job.

Type:

sagemaker.core.shapes.shapes.ModelBiasJobInput | None

model_bias_job_output_config#
Type:

sagemaker.core.shapes.shapes.MonitoringOutputConfig | None

job_resources#
Type:

sagemaker.core.shapes.shapes.MonitoringResources | None

role_arn#

The Amazon Resource Name (ARN) of the IAM role that has read permission to the input data location and write permission to the output data location in Amazon S3.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_bias_baseline_config#

The baseline configuration for a model bias job.

Type:

sagemaker.core.shapes.shapes.ModelBiasBaselineConfig | None

network_config#

Networking options for a model bias job.

Type:

sagemaker.core.shapes.shapes.MonitoringNetworkConfig | None

stopping_condition#
Type:

sagemaker.core.shapes.shapes.MonitoringStoppingCondition | None

classmethod create(job_definition_name: str | PipelineVariable, model_bias_app_specification: ModelBiasAppSpecification, model_bias_job_input: ModelBiasJobInput, model_bias_job_output_config: MonitoringOutputConfig, job_resources: MonitoringResources, role_arn: str | PipelineVariable, model_bias_baseline_config: ModelBiasBaselineConfig | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelBiasJobDefinition | None[source]#

Create a ModelBiasJobDefinition resource

Parameters:
  • job_definition_name – The name of the bias job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • model_bias_app_specification – Configures the model bias job to run a specified Docker container image.

  • model_bias_job_input – Inputs for the model bias job.

  • model_bias_job_output_config

  • job_resources

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.

  • model_bias_baseline_config – The baseline configuration for a model bias job.

  • network_config – Networking options for a model bias job.

  • stopping_condition

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelBiasJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a ModelBiasJobDefinition resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(job_definition_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ModelBiasJobDefinition | None[source]#

Get a ModelBiasJobDefinition resource

Parameters:
  • job_definition_name – The name of the model bias job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelBiasJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelBiasJobDefinition][source]#

Get all ModelBiasJobDefinition resources

Parameters:
  • endpoint_name – Name of the endpoint to monitor for model bias.

  • sort_by – Whether to sort results by the Name or CreationTime field. The default is CreationTime.

  • sort_order – Whether to sort the results in Ascending or Descending order. The default is Descending.

  • next_token – The token returned if the response is truncated. To retrieve the next set of job executions, use it in the next request.

  • max_results – The maximum number of model bias jobs to return in the response. The default value is 10.

  • name_contains – Filter for model bias jobs whose name contains a specified string.

  • creation_time_before – A filter that returns only model bias jobs created before a specified time.

  • creation_time_after – A filter that returns only model bias jobs created after a specified time.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelBiasJobDefinition resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
job_definition_arn: str | PipelineVariable | None#
job_definition_name: str | PipelineVariable#
job_resources: MonitoringResources | None#
model_bias_app_specification: ModelBiasAppSpecification | None#
model_bias_baseline_config: ModelBiasBaselineConfig | None#
model_bias_job_input: ModelBiasJobInput | None#
model_bias_job_output_config: MonitoringOutputConfig | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_config: MonitoringNetworkConfig | None#
populate_inputs_decorator()[source]#
refresh() ModelBiasJobDefinition | None[source]#

Refresh a ModelBiasJobDefinition resource

Returns:

The ModelBiasJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stopping_condition: MonitoringStoppingCondition | None#
class sagemaker.core.resources.ModelCard(*, model_card_name: str | PipelineVariable, model_card_arn: str | PipelineVariable | None = Unassigned(), model_card_version: int | None = Unassigned(), content: str | PipelineVariable | None = Unassigned(), model_card_status: str | PipelineVariable | None = Unassigned(), security_config: ModelCardSecurityConfig | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), model_card_processing_status: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelCard

model_card_arn#

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

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_card_name#

The name of the model card.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

model_card_version#

The version of the model card.

Type:

int | None

content#

The content of the model card.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_card_status#

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.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The date and time the model card was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

security_config#

The security configuration used to protect model card content.

Type:

sagemaker.core.shapes.shapes.ModelCardSecurityConfig | None

last_modified_time#

The date and time the model card was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

model_card_processing_status#

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.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

content: str | PipelineVariable | None#
classmethod create(model_card_name: str | PipelineVariable, content: str | PipelineVariable, model_card_status: str | PipelineVariable, security_config: ModelCardSecurityConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelCard | None[source]#

Create a ModelCard resource

Parameters:
  • model_card_name – The unique name of the model card.

  • content – The content of the model card. Content must be in model card JSON schema and provided as a string.

  • model_card_status – 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.

  • security_config – An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.

  • tags – Key-value pairs used to manage metadata for model cards.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelCard resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a ModelCard resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

classmethod get(model_card_name: str | PipelineVariable, model_card_version: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelCard | None[source]#

Get a ModelCard resource

Parameters:
  • model_card_name – The name or Amazon Resource Name (ARN) of the model card to describe.

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

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelCard resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), model_card_status: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelCard][source]#

Get all ModelCard resources

Parameters:
  • creation_time_after – Only list model cards that were created after the time specified.

  • creation_time_before – Only list model cards that were created before the time specified.

  • max_results – The maximum number of model cards to list.

  • name_contains – Only list model cards with names that contain the specified string.

  • model_card_status – Only list model cards with the specified approval status.

  • next_token – If the response to a previous ListModelCards request was truncated, the response includes a NextToken. To retrieve the next set of model cards, use the token in the next request.

  • sort_by – Sort model cards by either name or creation time. Sorts by creation time by default.

  • sort_order – Sort model cards by ascending or descending order.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelCard resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_versions(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[ModelCardVersionSummary][source]#

List existing versions of an Amazon SageMaker Model Card.

Parameters:
  • creation_time_after – Only list model card versions that were created after the time specified.

  • creation_time_before – Only list model card versions that were created before the time specified.

  • max_results – The maximum number of model card versions to list.

  • next_token – If the response to a previous ListModelCardVersions request was truncated, the response includes a NextToken. To retrieve the next set of model card versions, use the token in the next request.

  • sort_by – Sort listed model card versions by version. Sorts by version by default.

  • sort_order – Sort model card versions by ascending or descending order.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelCardVersionSummary.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_card_arn: str | PipelineVariable | None#
model_card_name: str | PipelineVariable#
model_card_processing_status: str | PipelineVariable | None#
model_card_status: str | PipelineVariable | None#
model_card_version: int | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() ModelCard | None[source]#

Refresh a ModelCard resource

Returns:

The ModelCard resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

security_config: ModelCardSecurityConfig | None#
update(content: str | PipelineVariable | None = Unassigned(), model_card_status: str | PipelineVariable | None = Unassigned()) ModelCard | None[source]#

Update a ModelCard resource

Returns:

The ModelCard resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Draft', 'PendingReview', 'Approved', 'Archived'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ModelCard resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ModelCardExportJob(*, model_card_export_job_arn: str | PipelineVariable, model_card_export_job_name: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), model_card_name: str | PipelineVariable | None = Unassigned(), model_card_version: int | None = Unassigned(), output_config: ModelCardExportOutputConfig | None = Unassigned(), created_at: datetime | None = Unassigned(), last_modified_at: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), export_artifacts: ModelCardExportArtifacts | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelCardExportJob

model_card_export_job_name#

The name of the model card export job to describe.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_card_export_job_arn#

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

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

status#

The completion status of the model card export job. InProgress: The model card export job is in progress. Completed: The model card export job is complete. Failed: The model card export job failed. To see the reason for the failure, see the FailureReason field in the response to a DescribeModelCardExportJob call.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_card_name#

The name or Amazon Resource Name (ARN) of the model card that the model export job exports.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_card_version#

The version of the model card that the model export job exports.

Type:

int | None

output_config#

The export output details for the model card.

Type:

sagemaker.core.shapes.shapes.ModelCardExportOutputConfig | None

created_at#

The date and time that the model export job was created.

Type:

datetime.datetime | None

last_modified_at#

The date and time that the model export job was last modified.

Type:

datetime.datetime | None

failure_reason#

The failure reason if the model export job fails.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

export_artifacts#

The exported model card artifacts.

Type:

sagemaker.core.shapes.shapes.ModelCardExportArtifacts | None

classmethod create(model_card_name: str | PipelineVariable | object, model_card_export_job_name: str | PipelineVariable, output_config: ModelCardExportOutputConfig, model_card_version: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelCardExportJob | None[source]#

Create a ModelCardExportJob resource

Parameters:
  • model_card_name – The name or Amazon Resource Name (ARN) of the model card to export.

  • model_card_export_job_name – The name of the model card export job.

  • output_config – The model card output configuration that specifies the Amazon S3 path for exporting.

  • model_card_version – The version of the model card to export. If a version is not provided, then the latest version of the model card is exported.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelCardExportJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_at: datetime | None#
export_artifacts: ModelCardExportArtifacts | None#
failure_reason: str | PipelineVariable | None#
classmethod get(model_card_export_job_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ModelCardExportJob | None[source]#

Get a ModelCardExportJob resource

Parameters:
  • model_card_export_job_arn – The Amazon Resource Name (ARN) of the model card export job to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelCardExportJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(model_card_name: str | PipelineVariable, model_card_version: int | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), model_card_export_job_name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelCardExportJob][source]#

Get all ModelCardExportJob resources

Parameters:
  • model_card_name – List export jobs for the model card with the specified name.

  • model_card_version – List export jobs for the model card with the specified version.

  • creation_time_after – Only list model card export jobs that were created after the time specified.

  • creation_time_before – Only list model card export jobs that were created before the time specified.

  • model_card_export_job_name_contains – Only list model card export jobs with names that contain the specified string.

  • status_equals – Only list model card export jobs with the specified status.

  • sort_by – Sort model card export jobs by either name or creation time. Sorts by creation time by default.

  • sort_order – Sort model card export jobs by ascending or descending order.

  • next_token – If the response to a previous ListModelCardExportJobs request was truncated, the response includes a NextToken. To retrieve the next set of model card export jobs, use the token in the next request.

  • max_results – The maximum number of model card export jobs to list.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelCardExportJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_at: datetime | None#
model_card_export_job_arn: str | PipelineVariable#
model_card_export_job_name: str | PipelineVariable | None#
model_card_name: str | PipelineVariable | None#
model_card_version: int | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_config: ModelCardExportOutputConfig | None#
populate_inputs_decorator()[source]#
refresh() ModelCardExportJob | None[source]#

Refresh a ModelCardExportJob resource

Returns:

The ModelCardExportJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

status: str | PipelineVariable | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ModelCardExportJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ModelExplainabilityJobDefinition(*, job_definition_name: str | PipelineVariable, job_definition_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), model_explainability_baseline_config: ModelExplainabilityBaselineConfig | None = Unassigned(), model_explainability_app_specification: ModelExplainabilityAppSpecification | None = Unassigned(), model_explainability_job_input: ModelExplainabilityJobInput | None = Unassigned(), model_explainability_job_output_config: MonitoringOutputConfig | None = Unassigned(), job_resources: MonitoringResources | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelExplainabilityJobDefinition

job_definition_arn#

The Amazon Resource Name (ARN) of the model explainability job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_definition_name#

The name of the explainability job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The time at which the model explainability job was created.

Type:

datetime.datetime | None

model_explainability_app_specification#

Configures the model explainability job to run a specified Docker container image.

Type:

sagemaker.core.shapes.shapes.ModelExplainabilityAppSpecification | None

model_explainability_job_input#

Inputs for the model explainability job.

Type:

sagemaker.core.shapes.shapes.ModelExplainabilityJobInput | None

model_explainability_job_output_config#
Type:

sagemaker.core.shapes.shapes.MonitoringOutputConfig | None

job_resources#
Type:

sagemaker.core.shapes.shapes.MonitoringResources | None

role_arn#

The Amazon Resource Name (ARN) of the IAM role that has read permission to the input data location and write permission to the output data location in Amazon S3.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_explainability_baseline_config#

The baseline configuration for a model explainability job.

Type:

sagemaker.core.shapes.shapes.ModelExplainabilityBaselineConfig | None

network_config#

Networking options for a model explainability job.

Type:

sagemaker.core.shapes.shapes.MonitoringNetworkConfig | None

stopping_condition#
Type:

sagemaker.core.shapes.shapes.MonitoringStoppingCondition | None

classmethod create(job_definition_name: str | PipelineVariable, model_explainability_app_specification: ModelExplainabilityAppSpecification, model_explainability_job_input: ModelExplainabilityJobInput, model_explainability_job_output_config: MonitoringOutputConfig, job_resources: MonitoringResources, role_arn: str | PipelineVariable, model_explainability_baseline_config: ModelExplainabilityBaselineConfig | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelExplainabilityJobDefinition | None[source]#

Create a ModelExplainabilityJobDefinition resource

Parameters:
  • job_definition_name – The name of the model explainability job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • model_explainability_app_specification – Configures the model explainability job to run a specified Docker container image.

  • model_explainability_job_input – Inputs for the model explainability job.

  • model_explainability_job_output_config

  • job_resources

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.

  • model_explainability_baseline_config – The baseline configuration for a model explainability job.

  • network_config – Networking options for a model explainability job.

  • stopping_condition

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelExplainabilityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a ModelExplainabilityJobDefinition resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(job_definition_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ModelExplainabilityJobDefinition | None[source]#

Get a ModelExplainabilityJobDefinition resource

Parameters:
  • job_definition_name – The name of the model explainability job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelExplainabilityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelExplainabilityJobDefinition][source]#

Get all ModelExplainabilityJobDefinition resources

Parameters:
  • endpoint_name – Name of the endpoint to monitor for model explainability.

  • sort_by – Whether to sort results by the Name or CreationTime field. The default is CreationTime.

  • sort_order – Whether to sort the results in Ascending or Descending order. The default is Descending.

  • next_token – The token returned if the response is truncated. To retrieve the next set of job executions, use it in the next request.

  • max_results – The maximum number of jobs to return in the response. The default value is 10.

  • name_contains – Filter for model explainability jobs whose name contains a specified string.

  • creation_time_before – A filter that returns only model explainability jobs created before a specified time.

  • creation_time_after – A filter that returns only model explainability jobs created after a specified time.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelExplainabilityJobDefinition resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
job_definition_arn: str | PipelineVariable | None#
job_definition_name: str | PipelineVariable#
job_resources: MonitoringResources | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_explainability_app_specification: ModelExplainabilityAppSpecification | None#
model_explainability_baseline_config: ModelExplainabilityBaselineConfig | None#
model_explainability_job_input: ModelExplainabilityJobInput | None#
model_explainability_job_output_config: MonitoringOutputConfig | None#
network_config: MonitoringNetworkConfig | None#
populate_inputs_decorator()[source]#
refresh() ModelExplainabilityJobDefinition | None[source]#

Refresh a ModelExplainabilityJobDefinition resource

Returns:

The ModelExplainabilityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stopping_condition: MonitoringStoppingCondition | None#
class sagemaker.core.resources.ModelPackage(*, model_package_name: str | None = Unassigned(), model_package_group_name: str | PipelineVariable | None = Unassigned(), model_package_version: int | None = Unassigned(), model_package_registration_type: str | PipelineVariable | None = Unassigned(), model_package_arn: str | PipelineVariable | None = Unassigned(), model_package_description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), inference_specification: InferenceSpecification | None = Unassigned(), source_algorithm_specification: SourceAlgorithmSpecification | None = Unassigned(), validation_specification: ModelPackageValidationSpecification | None = Unassigned(), model_package_status: str | PipelineVariable | None = Unassigned(), model_package_status_details: ModelPackageStatusDetails | None = Unassigned(), certify_for_marketplace: bool | None = Unassigned(), model_approval_status: str | PipelineVariable | None = Unassigned(), created_by: UserContext | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), model_metrics: ModelMetrics | None = Unassigned(), deployment_specification: DeploymentSpecification | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), approval_description: str | PipelineVariable | None = Unassigned(), domain: str | PipelineVariable | None = Unassigned(), task: str | PipelineVariable | None = Unassigned(), sample_payload_url: str | PipelineVariable | None = Unassigned(), sample_payload_content_type: str | PipelineVariable | None = Unassigned(), customer_metadata_properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), drift_check_baselines: DriftCheckBaselines | None = Unassigned(), additional_inference_specifications: List[AdditionalInferenceSpecificationDefinition] | None = Unassigned(), skip_model_validation: str | PipelineVariable | None = Unassigned(), source_uri: str | PipelineVariable | None = Unassigned(), security_config: ModelPackageSecurityConfig | None = Unassigned(), model_card: ModelPackageModelCard | None = Unassigned(), model_life_cycle: ModelLifeCycle | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelPackage

model_package_name#

The name of the model package being described.

Type:

str | None

model_package_arn#

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

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

A timestamp specifying when the model package was created.

Type:

datetime.datetime | None

model_package_status#

The current status of the model package.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_package_status_details#

Details about the current status of the model package.

Type:

sagemaker.core.shapes.shapes.ModelPackageStatusDetails | None

model_package_group_name#

If the model is a versioned model, the name of the model group that the versioned model belongs to.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_package_version#

The version of the model package.

Type:

int | None

model_package_registration_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_package_description#

A brief summary of the model package.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

inference_specification#

Details about inference jobs that you can run with models based on this model package.

Type:

sagemaker.core.shapes.model_card_shapes.InferenceSpecification | None

source_algorithm_specification#

Details about the algorithm that was used to create the model package.

Type:

sagemaker.core.shapes.shapes.SourceAlgorithmSpecification | None

validation_specification#

Configurations for one or more transform jobs that SageMaker runs to test the model package.

Type:

sagemaker.core.shapes.shapes.ModelPackageValidationSpecification | None

certify_for_marketplace#

Whether the model package is certified for listing on Amazon Web Services Marketplace.

Type:

bool | None

model_approval_status#

The approval status of the model package.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

model_metrics#

Metrics for the model.

Type:

sagemaker.core.shapes.shapes.ModelMetrics | None

deployment_specification#
Type:

sagemaker.core.shapes.shapes.DeploymentSpecification | None

last_modified_time#

The last time that the model package was modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

approval_description#

A description provided for the model approval.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

domain#

The machine learning domain of the model package you specified. Common machine learning domains include computer vision and natural language processing.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

task#

The machine learning task you specified that your model package accomplishes. Common machine learning tasks include object detection and image classification.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

sample_payload_url#

The Amazon Simple Storage Service (Amazon S3) path where the sample payload are stored. This path points to a single gzip compressed tar archive (.tar.gz suffix).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

sample_payload_content_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

customer_metadata_properties#

The metadata properties associated with the model package versions.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

drift_check_baselines#

Represents the drift check baselines that can be used when the model monitor is set using the model package. For more information, see the topic on Drift Detection against Previous Baselines in SageMaker Pipelines in the Amazon SageMaker Developer Guide.

Type:

sagemaker.core.shapes.shapes.DriftCheckBaselines | None

additional_inference_specifications#

An array of additional Inference Specification objects. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.

Type:

List[sagemaker.core.shapes.shapes.AdditionalInferenceSpecificationDefinition] | None

skip_model_validation#

Indicates if you want to skip model validation.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source_uri#

The URI of the source for the model package.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

security_config#

The KMS Key ID (KMSKeyId) used for encryption of model package information.

Type:

sagemaker.core.shapes.shapes.ModelPackageSecurityConfig | None

model_card#

The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model package model card schema, see Model package model card schema. For more information about the model card associated with the model package, see View the Details of a Model Version.

Type:

sagemaker.core.shapes.shapes.ModelPackageModelCard | None

model_life_cycle#

A structure describing the current state of the model in its life cycle.

Type:

sagemaker.core.shapes.shapes.ModelLifeCycle | None

additional_inference_specifications: List[AdditionalInferenceSpecificationDefinition] | None#
approval_description: str | PipelineVariable | None#
batch_get(model_package_arn_list: List[str | PipelineVariable], session: Session | None = None, region: str | None = None) BatchDescribeModelPackageOutput | None[source]#

This action batch describes a list of versioned model packages.

Parameters:
  • model_package_arn_list – The list of Amazon Resource Name (ARN) of the model package groups.

  • session – Boto3 session.

  • region – Region name.

Returns:

BatchDescribeModelPackageOutput

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

certify_for_marketplace: bool | None#
classmethod create(model_package_name: str | PipelineVariable | None = Unassigned(), model_package_group_name: str | PipelineVariable | object | None = Unassigned(), model_package_description: str | PipelineVariable | None = Unassigned(), model_package_registration_type: str | PipelineVariable | None = Unassigned(), inference_specification: InferenceSpecification | None = Unassigned(), validation_specification: ModelPackageValidationSpecification | None = Unassigned(), source_algorithm_specification: SourceAlgorithmSpecification | None = Unassigned(), certify_for_marketplace: bool | None = Unassigned(), require_image_scan: bool | None = Unassigned(), workflow_disabled: bool | None = Unassigned(), tags: List[Tag] | None = Unassigned(), model_approval_status: str | PipelineVariable | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), model_metrics: ModelMetrics | None = Unassigned(), deployment_specification: DeploymentSpecification | None = Unassigned(), client_token: str | PipelineVariable | None = Unassigned(), domain: str | PipelineVariable | None = Unassigned(), task: str | PipelineVariable | None = Unassigned(), sample_payload_url: str | PipelineVariable | None = Unassigned(), sample_payload_content_type: str | PipelineVariable | None = Unassigned(), customer_metadata_properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), drift_check_baselines: DriftCheckBaselines | None = Unassigned(), additional_inference_specifications: List[AdditionalInferenceSpecificationDefinition] | None = Unassigned(), skip_model_validation: str | PipelineVariable | None = Unassigned(), source_uri: str | PipelineVariable | None = Unassigned(), security_config: ModelPackageSecurityConfig | None = Unassigned(), model_card: ModelPackageModelCard | None = Unassigned(), model_life_cycle: ModelLifeCycle | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelPackage | None[source]#

Create a ModelPackage resource

Parameters:
  • model_package_name – The name of the model package. The name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen). This parameter is required for unversioned models. It is not applicable to versioned models.

  • model_package_group_name – The name or Amazon Resource Name (ARN) of the model package group that this model version belongs to. This parameter is required for versioned models, and does not apply to unversioned models.

  • model_package_description – A description of the model package.

  • model_package_registration_type

  • inference_specification – Specifies details about inference jobs that you can run with models based on this model package, including the following information: The Amazon ECR paths of containers that contain the inference code and model artifacts. The instance types that the model package supports for transform jobs and real-time endpoints used for inference. The input and output content formats that the model package supports for inference.

  • validation_specification – Specifies configurations for one or more transform jobs that SageMaker runs to test the model package.

  • source_algorithm_specification – Details about the algorithm that was used to create the model package.

  • certify_for_marketplace – Whether to certify the model package for listing on Amazon Web Services Marketplace. This parameter is optional for unversioned models, and does not apply to versioned models.

  • require_image_scan

  • workflow_disabled

  • tags – A list of key value pairs associated with the model. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide. If you supply ModelPackageGroupName, your model package belongs to the model group you specify and uses the tags associated with the model group. In this case, you cannot supply a tag argument.

  • model_approval_status – Whether the model is approved for deployment. This parameter is optional for versioned models, and does not apply to unversioned models. For versioned models, the value of this parameter must be set to Approved to deploy the model.

  • metadata_properties

  • model_metrics – A structure that contains model metrics reports.

  • deployment_specification

  • client_token – A unique token that guarantees that the call to this API is idempotent.

  • domain – The machine learning domain of your model package and its components. Common machine learning domains include computer vision and natural language processing.

  • task – The machine learning task your model package accomplishes. Common machine learning tasks include object detection and image classification. The following tasks are supported by Inference Recommender: “IMAGE_CLASSIFICATION” | “OBJECT_DETECTION” | “TEXT_GENERATION” |”IMAGE_SEGMENTATION” | “FILL_MASK” | “CLASSIFICATION” | “REGRESSION” | “OTHER”. Specify “OTHER” if none of the tasks listed fit your use case.

  • sample_payload_url – The Amazon Simple Storage Service (Amazon S3) path where the sample payload is stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix). This archive can hold multiple files that are all equally used in the load test. Each file in the archive must satisfy the size constraints of the InvokeEndpoint call.

  • sample_payload_content_type

  • customer_metadata_properties – The metadata properties associated with the model package versions.

  • drift_check_baselines – Represents the drift check baselines that can be used when the model monitor is set using the model package. For more information, see the topic on Drift Detection against Previous Baselines in SageMaker Pipelines in the Amazon SageMaker Developer Guide.

  • additional_inference_specifications – An array of additional Inference Specification objects. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.

  • skip_model_validation – Indicates if you want to skip model validation.

  • source_uri – The URI of the source for the model package. If you want to clone a model package, set it to the model package Amazon Resource Name (ARN). If you want to register a model, set it to the model ARN.

  • security_config – The KMS Key ID (KMSKeyId) used for encryption of model package information.

  • model_card – The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model package model card schema, see Model package model card schema. For more information about the model card associated with the model package, see View the Details of a Model Version.

  • model_life_cycle – A structure describing the current state of the model in its life cycle.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelPackage resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
customer_metadata_properties: Dict[str | PipelineVariable, str | PipelineVariable] | None#
delete() None[source]#

Delete a ModelPackage resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

deployment_specification: DeploymentSpecification | None#
domain: str | PipelineVariable | None#
drift_check_baselines: DriftCheckBaselines | None#
classmethod get(model_package_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ModelPackage | None[source]#

Get a ModelPackage resource

Parameters:
  • model_package_name – 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).

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelPackage resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), model_approval_status: str | PipelineVariable | None = Unassigned(), model_package_group_name: str | PipelineVariable | None = Unassigned(), model_package_type: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelPackage][source]#

Get all ModelPackage resources

Parameters:
  • creation_time_after – A filter that returns only model packages created after the specified time (timestamp).

  • creation_time_before – A filter that returns only model packages created before the specified time (timestamp).

  • max_results – The maximum number of model packages to return in the response.

  • name_contains – A string in the model package name. This filter returns only model packages whose name contains the specified string.

  • model_approval_status – A filter that returns only the model packages with the specified approval status.

  • model_package_group_name – A filter that returns only model versions that belong to the specified model group.

  • model_package_type – A filter that returns only the model packages of the specified type. This can be one of the following values. UNVERSIONED - List only unversioined models. This is the default value if no ModelPackageType is specified. VERSIONED - List only versioned models. BOTH - List both versioned and unversioned models.

  • next_token – If the response to a previous ListModelPackages request was truncated, the response includes a NextToken. To retrieve the next set of model packages, use the token in the next request.

  • sort_by – The parameter by which to sort the results. The default is CreationTime.

  • sort_order – The sort order for the results. The default is Ascending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelPackage resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
inference_specification: InferenceSpecification | None#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
metadata_properties: MetadataProperties | None#
model_approval_status: str | PipelineVariable | None#
model_card: ModelPackageModelCard | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_life_cycle: ModelLifeCycle | None#
model_metrics: ModelMetrics | None#
model_package_arn: str | PipelineVariable | None#
model_package_description: str | PipelineVariable | None#
model_package_group_name: str | PipelineVariable | None#
model_package_name: str | None#
model_package_registration_type: str | PipelineVariable | None#
model_package_status: str | PipelineVariable | None#
model_package_status_details: ModelPackageStatusDetails | None#
model_package_version: int | None#
populate_inputs_decorator()[source]#
refresh() ModelPackage | None[source]#

Refresh a ModelPackage resource

Returns:

The ModelPackage resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

sample_payload_content_type: str | PipelineVariable | None#
sample_payload_url: str | PipelineVariable | None#
security_config: ModelPackageSecurityConfig | None#
skip_model_validation: str | PipelineVariable | None#
source_algorithm_specification: SourceAlgorithmSpecification | None#
source_uri: str | PipelineVariable | None#
task: str | PipelineVariable | None#
update(model_approval_status: str | PipelineVariable | None = Unassigned(), model_package_registration_type: str | PipelineVariable | None = Unassigned(), approval_description: str | PipelineVariable | None = Unassigned(), customer_metadata_properties: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), customer_metadata_properties_to_remove: List[str | PipelineVariable] | None = Unassigned(), additional_inference_specifications_to_add: List[AdditionalInferenceSpecificationDefinition] | None = Unassigned(), inference_specification: InferenceSpecification | None = Unassigned(), source_uri: str | PipelineVariable | None = Unassigned(), model_card: ModelPackageModelCard | None = Unassigned(), model_life_cycle: ModelLifeCycle | None = Unassigned(), client_token: str | PipelineVariable | None = Unassigned()) ModelPackage | None[source]#

Update a ModelPackage resource

Parameters:
  • customer_metadata_properties_to_remove – The metadata properties associated with the model package versions to remove.

  • additional_inference_specifications_to_add – An array of additional Inference Specification objects to be added to the existing array additional Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.

  • client_token – A unique token that guarantees that the call to this API is idempotent.

Returns:

The ModelPackage resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

validation_specification: ModelPackageValidationSpecification | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ModelPackage resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Pending', 'InProgress', 'Completed', 'Failed', 'Deleting'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ModelPackage resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ModelPackageGroup(*, model_package_group_name: str | PipelineVariable, model_package_group_arn: str | PipelineVariable | None = Unassigned(), model_package_group_description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), model_package_group_status: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelPackageGroup

model_package_group_name#

The name of the model group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

model_package_group_arn#

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

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time that the model group was created.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

model_package_group_status#

The status of the model group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_package_group_description#

A description of the model group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(model_package_group_name: str | PipelineVariable, model_package_group_description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelPackageGroup | None[source]#

Create a ModelPackageGroup resource

Parameters:
  • model_package_group_name – The name of the model group.

  • model_package_group_description – A description for the model group.

  • tags – A list of key value pairs associated with the model group. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelPackageGroup resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a ModelPackageGroup resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

delete_policy(session: Session | None = None, region: str | None = None) None[source]#

Deletes a model group resource policy.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get(model_package_group_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ModelPackageGroup | None[source]#

Get a ModelPackageGroup resource

Parameters:
  • model_package_group_name – The name of the model group to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelPackageGroup resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), cross_account_filter_option: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelPackageGroup][source]#

Get all ModelPackageGroup resources

Parameters:
  • creation_time_after – A filter that returns only model groups created after the specified time.

  • creation_time_before – A filter that returns only model groups created before the specified time.

  • max_results – The maximum number of results to return in the response.

  • name_contains – A string in the model group name. This filter returns only model groups whose name contains the specified string.

  • next_token – If the result of the previous ListModelPackageGroups request was truncated, the response includes a NextToken. To retrieve the next set of model groups, use the token in the next request.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • cross_account_filter_option – A filter that returns either model groups shared with you or model groups in your own account. When the value is CrossAccount, the results show the resources made discoverable to you from other accounts. When the value is SameAccount or null, the results show resources from your account. The default is SameAccount.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelPackageGroup resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
get_policy(session: Session | None = None, region: str | None = None) str | None[source]#

Gets a resource policy that manages access for a model group.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

str

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_package_group_arn: str | PipelineVariable | None#
model_package_group_description: str | PipelineVariable | None#
model_package_group_name: str | PipelineVariable#
model_package_group_status: str | PipelineVariable | None#
put_policy(resource_policy: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Adds a resouce policy to control access to a model group.

Parameters:
  • resource_policy – The resource policy for the model group.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

refresh() ModelPackageGroup | None[source]#

Refresh a ModelPackageGroup resource

Returns:

The ModelPackageGroup resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ModelPackageGroup resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Pending', 'InProgress', 'Completed', 'Failed', 'Deleting', 'DeleteFailed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a ModelPackageGroup resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ModelQualityJobDefinition(*, job_definition_name: str | PipelineVariable, job_definition_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), model_quality_baseline_config: ModelQualityBaselineConfig | None = Unassigned(), model_quality_app_specification: ModelQualityAppSpecification | None = Unassigned(), model_quality_job_input: ModelQualityJobInput | None = Unassigned(), model_quality_job_output_config: MonitoringOutputConfig | None = Unassigned(), job_resources: MonitoringResources | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned())[source]#

Bases: Base

Class representing resource ModelQualityJobDefinition

job_definition_arn#

The Amazon Resource Name (ARN) of the model quality job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

job_definition_name#

The name of the quality job definition. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The time at which the model quality job was created.

Type:

datetime.datetime | None

model_quality_app_specification#

Configures the model quality job to run a specified Docker container image.

Type:

sagemaker.core.shapes.shapes.ModelQualityAppSpecification | None

model_quality_job_input#

Inputs for the model quality job.

Type:

sagemaker.core.shapes.shapes.ModelQualityJobInput | None

model_quality_job_output_config#
Type:

sagemaker.core.shapes.shapes.MonitoringOutputConfig | None

job_resources#
Type:

sagemaker.core.shapes.shapes.MonitoringResources | None

role_arn#

The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_quality_baseline_config#

The baseline configuration for a model quality job.

Type:

sagemaker.core.shapes.shapes.ModelQualityBaselineConfig | None

network_config#

Networking options for a model quality job.

Type:

sagemaker.core.shapes.shapes.MonitoringNetworkConfig | None

stopping_condition#
Type:

sagemaker.core.shapes.shapes.MonitoringStoppingCondition | None

classmethod create(job_definition_name: str | PipelineVariable, model_quality_app_specification: ModelQualityAppSpecification, model_quality_job_input: ModelQualityJobInput, model_quality_job_output_config: MonitoringOutputConfig, job_resources: MonitoringResources, role_arn: str | PipelineVariable, model_quality_baseline_config: ModelQualityBaselineConfig | None = Unassigned(), network_config: MonitoringNetworkConfig | None = Unassigned(), stopping_condition: MonitoringStoppingCondition | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ModelQualityJobDefinition | None[source]#

Create a ModelQualityJobDefinition resource

Parameters:
  • job_definition_name – The name of the monitoring job definition.

  • model_quality_app_specification – The container that runs the monitoring job.

  • model_quality_job_input – A list of the inputs that are monitored. Currently endpoints are supported.

  • model_quality_job_output_config

  • job_resources

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your behalf.

  • model_quality_baseline_config – Specifies the constraints and baselines for the monitoring job.

  • network_config – Specifies the network configuration for the monitoring job.

  • stopping_condition

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelQualityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a ModelQualityJobDefinition resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get(job_definition_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ModelQualityJobDefinition | None[source]#

Get a ModelQualityJobDefinition resource

Parameters:
  • job_definition_name – The name of the model quality job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ModelQualityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), variant_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ModelQualityJobDefinition][source]#

Get all ModelQualityJobDefinition resources

Parameters:
  • endpoint_name – A filter that returns only model quality monitoring job definitions that are associated with the specified endpoint.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – Whether to sort the results in Ascending or Descending order. The default is Descending.

  • next_token – If the result of the previous ListModelQualityJobDefinitions request was truncated, the response includes a NextToken. To retrieve the next set of model quality monitoring job definitions, use the token in the next request.

  • max_results – The maximum number of results to return in a call to ListModelQualityJobDefinitions.

  • name_contains – A string in the transform job name. This filter returns only model quality monitoring job definitions whose name contains the specified string.

  • creation_time_before – A filter that returns only model quality monitoring job definitions created before the specified time.

  • creation_time_after – A filter that returns only model quality monitoring job definitions created after the specified time.

  • variant_name

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ModelQualityJobDefinition resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
job_definition_arn: str | PipelineVariable | None#
job_definition_name: str | PipelineVariable#
job_resources: MonitoringResources | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_quality_app_specification: ModelQualityAppSpecification | None#
model_quality_baseline_config: ModelQualityBaselineConfig | None#
model_quality_job_input: ModelQualityJobInput | None#
model_quality_job_output_config: MonitoringOutputConfig | None#
network_config: MonitoringNetworkConfig | None#
populate_inputs_decorator()[source]#
refresh() ModelQualityJobDefinition | None[source]#

Refresh a ModelQualityJobDefinition resource

Returns:

The ModelQualityJobDefinition resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stopping_condition: MonitoringStoppingCondition | None#
class sagemaker.core.resources.MonitoringAlert(*, monitoring_alert_name: str | PipelineVariable, creation_time: datetime, last_modified_time: datetime, alert_status: str | PipelineVariable, datapoints_to_alert: int, evaluation_period: int, actions: MonitoringAlertActions)[source]#

Bases: Base

Class representing resource MonitoringAlert

monitoring_alert_name#

The name of a monitoring alert.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

A timestamp that indicates when a monitor alert was created.

Type:

datetime.datetime

last_modified_time#

A timestamp that indicates when a monitor alert was last updated.

Type:

datetime.datetime

alert_status#

The current status of an alert.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

datapoints_to_alert#

Within EvaluationPeriod, how many execution failures will raise an alert.

Type:

int

evaluation_period#

The number of most recent monitoring executions to consider when evaluating alert status.

Type:

int

actions#

A list of alert actions taken in response to an alert going into InAlert status.

Type:

sagemaker.core.shapes.shapes.MonitoringAlertActions

actions: MonitoringAlertActions#
alert_status: str | PipelineVariable#
creation_time: datetime#
datapoints_to_alert: int#
evaluation_period: int#
classmethod get_all(monitoring_schedule_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[MonitoringAlert][source]#

Get all MonitoringAlert resources

Parameters:
  • monitoring_schedule_name – The name of a monitoring schedule.

  • next_token – If the result of the previous ListMonitoringAlerts request was truncated, the response includes a NextToken. To retrieve the next set of alerts in the history, use the token in the next request.

  • max_results – The maximum number of results to display. The default is 100.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed MonitoringAlert resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_time: datetime#
list_history(monitoring_schedule_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), next_token: str | PipelineVariable | None = Unassigned(), max_results: int | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) MonitoringAlertHistorySummary | None[source]#

Gets a list of past alerts in a model monitoring schedule.

Parameters:
  • monitoring_schedule_name – The name of a monitoring schedule.

  • sort_by – The field used to sort results. The default is CreationTime.

  • sort_order – The sort order, whether Ascending or Descending, of the alert history. The default is Descending.

  • next_token – If the result of the previous ListMonitoringAlertHistory request was truncated, the response includes a NextToken. To retrieve the next set of alerts in the history, use the token in the next request.

  • max_results – The maximum number of results to display. The default is 100.

  • creation_time_before – A filter that returns only alerts created on or before the specified time.

  • creation_time_after – A filter that returns only alerts created on or after the specified time.

  • status_equals – A filter that retrieves only alerts with a specific status.

  • session – Boto3 session.

  • region – Region name.

Returns:

MonitoringAlertHistorySummary

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

monitoring_alert_name: str | PipelineVariable#
update(monitoring_schedule_name: str | PipelineVariable, datapoints_to_alert: int, evaluation_period: int) MonitoringAlert | None[source]#

Update a MonitoringAlert resource

Parameters:

monitoring_schedule_name – The name of a monitoring schedule.

Returns:

The MonitoringAlert resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.MonitoringExecution(*, monitoring_execution_id: str | PipelineVariable, monitoring_schedule_name: str | PipelineVariable | None = Unassigned(), scheduled_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), monitoring_execution_status: str | PipelineVariable | None = Unassigned(), processing_job_arn: str | PipelineVariable | None = Unassigned(), endpoint_name: str | PipelineVariable | None = Unassigned(), monitoring_job_definition_name: str | PipelineVariable | None = Unassigned(), monitoring_type: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource MonitoringExecution

monitoring_execution_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

monitoring_schedule_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

scheduled_time#
Type:

datetime.datetime | None

creation_time#
Type:

datetime.datetime | None

last_modified_time#
Type:

datetime.datetime | None

monitoring_execution_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

processing_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

endpoint_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

monitoring_job_definition_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

monitoring_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time: datetime | None#
endpoint_name: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(monitoring_execution_id: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) MonitoringExecution | None[source]#

Get a MonitoringExecution resource

Parameters:
  • monitoring_execution_id

  • session – Boto3 session.

  • region – Region name.

Returns:

The MonitoringExecution resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(monitoring_schedule_name: str | PipelineVariable | None = Unassigned(), endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), scheduled_time_before: datetime | None = Unassigned(), scheduled_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), monitoring_job_definition_name: str | PipelineVariable | None = Unassigned(), monitoring_type_equals: str | PipelineVariable | None = Unassigned(), variant_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[MonitoringExecution][source]#

Get all MonitoringExecution resources

Parameters:
  • monitoring_schedule_name – Name of a specific schedule to fetch jobs for.

  • endpoint_name – Name of a specific endpoint to fetch jobs for.

  • sort_by – Whether to sort the results by the Status, CreationTime, or ScheduledTime field. The default is CreationTime.

  • sort_order – Whether to sort the results in Ascending or Descending order. The default is Descending.

  • next_token – The token returned if the response is truncated. To retrieve the next set of job executions, use it in the next request.

  • max_results – The maximum number of jobs to return in the response. The default value is 10.

  • scheduled_time_before – Filter for jobs scheduled before a specified time.

  • scheduled_time_after – Filter for jobs scheduled after a specified time.

  • creation_time_before – A filter that returns only jobs created before a specified time.

  • creation_time_after – A filter that returns only jobs created after a specified time.

  • last_modified_time_before – A filter that returns only jobs modified after a specified time.

  • last_modified_time_after – A filter that returns only jobs modified before a specified time.

  • status_equals – A filter that retrieves only jobs with a specific status.

  • monitoring_job_definition_name – Gets a list of the monitoring job runs of the specified monitoring job definitions.

  • monitoring_type_equals – A filter that returns only the monitoring job runs of the specified monitoring type.

  • variant_name

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed MonitoringExecution resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

monitoring_execution_id: str | PipelineVariable#
monitoring_execution_status: str | PipelineVariable | None#
monitoring_job_definition_name: str | PipelineVariable | None#
monitoring_schedule_name: str | PipelineVariable | None#
monitoring_type: str | PipelineVariable | None#
processing_job_arn: str | PipelineVariable | None#
refresh() MonitoringExecution | None[source]#

Refresh a MonitoringExecution resource

Returns:

The MonitoringExecution resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

scheduled_time: datetime | None#
wait_for_status(target_status: Literal['Pending', 'Completed', 'CompletedWithViolations', 'InProgress', 'Failed', 'Stopping', 'Stopped'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a MonitoringExecution resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.MonitoringSchedule(*, monitoring_schedule_name: str | PipelineVariable, monitoring_schedule_arn: str | PipelineVariable | None = Unassigned(), monitoring_schedule_status: str | PipelineVariable | None = Unassigned(), monitoring_type: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), monitoring_schedule_config: MonitoringScheduleConfig | None = Unassigned(), endpoint_name: str | PipelineVariable | None = Unassigned(), last_monitoring_execution_summary: MonitoringExecutionSummary | None = Unassigned(), custom_monitoring_job_definition: CustomMonitoringJobDefinition | None = Unassigned(), data_quality_job_definition: DataQualityJobDefinition | None = Unassigned(), model_quality_job_definition: ModelQualityJobDefinition | None = Unassigned(), model_bias_job_definition: ModelBiasJobDefinition | None = Unassigned(), model_explainability_job_definition: ModelExplainabilityJobDefinition | None = Unassigned(), variant_name: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource MonitoringSchedule

monitoring_schedule_arn#

The Amazon Resource Name (ARN) of the monitoring schedule.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

monitoring_schedule_name#

Name of the monitoring schedule.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

monitoring_schedule_status#

The status of an monitoring job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time at which the monitoring job was created.

Type:

datetime.datetime | None

last_modified_time#

The time at which the monitoring job was last modified.

Type:

datetime.datetime | None

monitoring_schedule_config#

The configuration object that specifies the monitoring schedule and defines the monitoring job.

Type:

sagemaker.core.shapes.shapes.MonitoringScheduleConfig | None

monitoring_type#

The type of the monitoring job that this schedule runs. This is one of the following values. DATA_QUALITY - The schedule is for a data quality monitoring job. MODEL_QUALITY - The schedule is for a model quality monitoring job. MODEL_BIAS - The schedule is for a bias monitoring job. MODEL_EXPLAINABILITY - The schedule is for an explainability monitoring job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

A string, up to one KB in size, that contains the reason a monitoring job failed, if it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

endpoint_name#

The name of the endpoint for the monitoring job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_monitoring_execution_summary#

Describes metadata on the last execution to run, if there was one.

Type:

sagemaker.core.shapes.shapes.MonitoringExecutionSummary | None

custom_monitoring_job_definition#
Type:

sagemaker.core.resources.CustomMonitoringJobDefinition | None

data_quality_job_definition#
Type:

sagemaker.core.resources.DataQualityJobDefinition | None

model_quality_job_definition#
Type:

sagemaker.core.resources.ModelQualityJobDefinition | None

model_bias_job_definition#
Type:

sagemaker.core.resources.ModelBiasJobDefinition | None

model_explainability_job_definition#
Type:

sagemaker.core.resources.ModelExplainabilityJobDefinition | None

variant_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(monitoring_schedule_name: str | PipelineVariable, monitoring_schedule_config: MonitoringScheduleConfig, tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) MonitoringSchedule | None[source]#

Create a MonitoringSchedule resource

Parameters:
  • monitoring_schedule_name – The name of the monitoring schedule. The name must be unique within an Amazon Web Services Region within an Amazon Web Services account.

  • monitoring_schedule_config – The configuration object that specifies the monitoring schedule and defines the monitoring job.

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The MonitoringSchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
custom_monitoring_job_definition: CustomMonitoringJobDefinition | None#
data_quality_job_definition: DataQualityJobDefinition | None#
delete() None[source]#

Delete a MonitoringSchedule resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

endpoint_name: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(monitoring_schedule_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) MonitoringSchedule | None[source]#

Get a MonitoringSchedule resource

Parameters:
  • monitoring_schedule_name – Name of a previously created monitoring schedule.

  • session – Boto3 session.

  • region – Region name.

Returns:

The MonitoringSchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(endpoint_name: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), monitoring_job_definition_name: str | PipelineVariable | None = Unassigned(), monitoring_type_equals: str | PipelineVariable | None = Unassigned(), variant_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[MonitoringSchedule][source]#

Get all MonitoringSchedule resources

Parameters:
  • endpoint_name – Name of a specific endpoint to fetch schedules for.

  • sort_by – Whether to sort the results by the Status, CreationTime, or ScheduledTime field. The default is CreationTime.

  • sort_order – Whether to sort the results in Ascending or Descending order. The default is Descending.

  • next_token – The token returned if the response is truncated. To retrieve the next set of job executions, use it in the next request.

  • max_results – The maximum number of jobs to return in the response. The default value is 10.

  • name_contains – Filter for monitoring schedules whose name contains a specified string.

  • creation_time_before – A filter that returns only monitoring schedules created before a specified time.

  • creation_time_after – A filter that returns only monitoring schedules created after a specified time.

  • last_modified_time_before – A filter that returns only monitoring schedules modified before a specified time.

  • last_modified_time_after – A filter that returns only monitoring schedules modified after a specified time.

  • status_equals – A filter that returns only monitoring schedules modified before a specified time.

  • monitoring_job_definition_name – Gets a list of the monitoring schedules for the specified monitoring job definition.

  • monitoring_type_equals – A filter that returns only the monitoring schedules for the specified monitoring type.

  • variant_name

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed MonitoringSchedule resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_time: datetime | None#
last_monitoring_execution_summary: MonitoringExecutionSummary | None#
model_bias_job_definition: ModelBiasJobDefinition | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_explainability_job_definition: ModelExplainabilityJobDefinition | None#
model_quality_job_definition: ModelQualityJobDefinition | None#
monitoring_schedule_arn: str | PipelineVariable | None#
monitoring_schedule_config: MonitoringScheduleConfig | None#
monitoring_schedule_name: str | PipelineVariable#
monitoring_schedule_status: str | PipelineVariable | None#
monitoring_type: str | PipelineVariable | None#
populate_inputs_decorator()[source]#
refresh() MonitoringSchedule | None[source]#

Refresh a MonitoringSchedule resource

Returns:

The MonitoringSchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

start(session: Session | None = None, region: str | None = None) None[source]#

Start a MonitoringSchedule resource

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stop() None[source]#

Stop a MonitoringSchedule resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

update(monitoring_schedule_config: MonitoringScheduleConfig) MonitoringSchedule | None[source]#

Update a MonitoringSchedule resource

Returns:

The MonitoringSchedule resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

variant_name: str | PipelineVariable | None#
wait_for_status(target_status: Literal['Pending', 'Failed', 'Scheduled', 'Stopped'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a MonitoringSchedule resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.NotebookInstance(*, notebook_instance_name: str | PipelineVariable, notebook_instance_arn: str | PipelineVariable | None = Unassigned(), notebook_instance_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), url: str | PipelineVariable | None = Unassigned(), instance_type: str | PipelineVariable | None = Unassigned(), ip_address_type: str | PipelineVariable | None = Unassigned(), subnet_id: str | PipelineVariable | None = Unassigned(), security_groups: List[str | PipelineVariable] | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), network_interface_id: str | PipelineVariable | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), notebook_instance_lifecycle_config_name: str | PipelineVariable | None = Unassigned(), direct_internet_access: str | PipelineVariable | None = Unassigned(), volume_size_in_gb: int | None = Unassigned(), accelerator_types: List[str | PipelineVariable] | None = Unassigned(), default_code_repository: str | PipelineVariable | None = Unassigned(), additional_code_repositories: List[str | PipelineVariable] | None = Unassigned(), root_access: str | PipelineVariable | None = Unassigned(), platform_identifier: str | PipelineVariable | None = Unassigned(), instance_metadata_service_configuration: InstanceMetadataServiceConfiguration | None = Unassigned())[source]#

Bases: Base

Class representing resource NotebookInstance

notebook_instance_arn#

The Amazon Resource Name (ARN) of the notebook instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

notebook_instance_name#

The name of the SageMaker AI notebook instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

notebook_instance_status#

The status of the notebook instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

If status is Failed, the reason it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

url#

The URL that you use to connect to the Jupyter notebook that is running in your notebook instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

instance_type#

The type of ML compute instance running on the notebook instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

ip_address_type#

The IP address type configured for the notebook instance. Returns ipv4 for IPv4-only connectivity or dualstack for both IPv4 and IPv6 connectivity.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

subnet_id#

The ID of the VPC subnet.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

security_groups#

The IDs of the VPC security groups.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

role_arn#

The Amazon Resource Name (ARN) of the IAM role associated with the instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

kms_key_id#

The Amazon Web Services KMS key ID SageMaker AI uses to encrypt data when storing it on the ML storage volume attached to the instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

network_interface_id#

The network interface IDs that SageMaker AI created at the time of creating the instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

A timestamp. Use this parameter to retrieve the time when the notebook instance was last modified.

Type:

datetime.datetime | None

creation_time#

A timestamp. Use this parameter to return the time when the notebook instance was created

Type:

datetime.datetime | None

notebook_instance_lifecycle_config_name#

Returns the name of a notebook instance lifecycle configuration. For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

direct_internet_access#

Describes whether SageMaker AI provides internet access to the notebook instance. If this value is set to Disabled, the notebook instance does not have internet access, and cannot connect to SageMaker AI training and endpoint services. For more information, see Notebook Instances Are Internet-Enabled by Default.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

volume_size_in_gb#

The size, in GB, of the ML storage volume attached to the notebook instance.

Type:

int | None

accelerator_types#

This parameter is no longer supported. Elastic Inference (EI) is no longer available. This parameter was used to specify a list of the EI instance types associated with this notebook instance.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

default_code_repository#

The Git repository associated with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

additional_code_repositories#

An array of up to three Git repositories associated with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

root_access#

Whether root access is enabled or disabled for users of the notebook instance. Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

platform_identifier#

The platform identifier of the notebook instance runtime environment.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

instance_metadata_service_configuration#

Information on the IMDS configuration of the notebook instance

Type:

sagemaker.core.shapes.shapes.InstanceMetadataServiceConfiguration | None

accelerator_types: List[str | PipelineVariable] | None#
additional_code_repositories: List[str | PipelineVariable] | None#
classmethod create(notebook_instance_name: str | PipelineVariable, instance_type: str | PipelineVariable, role_arn: str | PipelineVariable, subnet_id: str | PipelineVariable | None = Unassigned(), security_group_ids: List[str | PipelineVariable] | None = Unassigned(), ip_address_type: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), lifecycle_config_name: str | PipelineVariable | None = Unassigned(), direct_internet_access: str | PipelineVariable | None = Unassigned(), volume_size_in_gb: int | None = Unassigned(), accelerator_types: List[str | PipelineVariable] | None = Unassigned(), default_code_repository: str | PipelineVariable | None = Unassigned(), additional_code_repositories: List[str | PipelineVariable] | None = Unassigned(), root_access: str | PipelineVariable | None = Unassigned(), platform_identifier: str | PipelineVariable | None = Unassigned(), instance_metadata_service_configuration: InstanceMetadataServiceConfiguration | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) NotebookInstance | None[source]#

Create a NotebookInstance resource

Parameters:
  • notebook_instance_name – The name of the new notebook instance.

  • instance_type – The type of ML compute instance to launch for the notebook instance.

  • role_arn – When you send any requests to Amazon Web Services resources from the notebook instance, SageMaker AI assumes this role to perform tasks on your behalf. You must grant this role necessary permissions so SageMaker AI can perform these tasks. The policy must allow the SageMaker AI service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see SageMaker AI Roles. To be able to pass this role to SageMaker AI, the caller of this API must have the iam:PassRole permission.

  • subnet_id – The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.

  • security_group_ids – The VPC security group IDs, in the form sg-xxxxxxxx. The security groups must be for the same VPC as specified in the subnet.

  • ip_address_type – The IP address type for the notebook instance. Specify ipv4 for IPv4-only connectivity or dualstack for both IPv4 and IPv6 connectivity. When you specify dualstack, the subnet must support IPv6 CIDR blocks. If not specified, defaults to ipv4.

  • kms_key_id – The Amazon Resource Name (ARN) of a Amazon Web Services Key Management Service key that SageMaker AI uses to encrypt data on the storage volume attached to your notebook instance. The KMS key you provide must be enabled. For information, see Enabling and Disabling Keys in the Amazon Web Services Key Management Service Developer Guide.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • lifecycle_config_name – The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

  • direct_internet_access – Sets whether SageMaker AI provides internet access to the notebook instance. If you set this to Disabled this notebook instance is able to access resources only in your VPC, and is not be able to connect to SageMaker AI training and endpoint services unless you configure a NAT Gateway in your VPC. For more information, see Notebook Instances Are Internet-Enabled by Default. You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.

  • volume_size_in_gb – The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.

  • accelerator_types – This parameter is no longer supported. Elastic Inference (EI) is no longer available. This parameter was used to specify a list of EI instance types to associate with this notebook instance.

  • default_code_repository – A Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

  • additional_code_repositories – An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances.

  • root_access – Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled. Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.

  • platform_identifier – The platform identifier of the notebook instance runtime environment. The default value is notebook-al2-v2.

  • instance_metadata_service_configuration – Information on the IMDS configuration of the notebook instance

  • session – Boto3 session.

  • region – Region name.

Returns:

The NotebookInstance resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
default_code_repository: str | PipelineVariable | None#
delete() None[source]#

Delete a NotebookInstance resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

direct_internet_access: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(notebook_instance_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) NotebookInstance | None[source]#

Get a NotebookInstance resource

Parameters:
  • notebook_instance_name – The name of the notebook instance that you want information about.

  • session – Boto3 session.

  • region – Region name.

Returns:

The NotebookInstance resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), notebook_instance_lifecycle_config_name_contains: str | PipelineVariable | None = Unassigned(), default_code_repository_contains: str | PipelineVariable | None = Unassigned(), additional_code_repository_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[NotebookInstance][source]#

Get all NotebookInstance resources

Parameters:
  • next_token – If the previous call to the ListNotebookInstances is truncated, the response includes a NextToken. You can use this token in your subsequent ListNotebookInstances request to fetch the next set of notebook instances. You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.

  • max_results – The maximum number of notebook instances to return.

  • sort_by – The field to sort results by. The default is Name.

  • sort_order – The sort order for results.

  • name_contains – A string in the notebook instances’ name. This filter returns only notebook instances whose name contains the specified string.

  • creation_time_before – A filter that returns only notebook instances that were created before the specified time (timestamp).

  • creation_time_after – A filter that returns only notebook instances that were created after the specified time (timestamp).

  • last_modified_time_before – A filter that returns only notebook instances that were modified before the specified time (timestamp).

  • last_modified_time_after – A filter that returns only notebook instances that were modified after the specified time (timestamp).

  • status_equals – A filter that returns only notebook instances with the specified status.

  • notebook_instance_lifecycle_config_name_contains – A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.

  • default_code_repository_contains – A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.

  • additional_code_repository_equals – A filter that returns only notebook instances with associated with the specified git repository.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed NotebookInstance resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
instance_metadata_service_configuration: InstanceMetadataServiceConfiguration | None#
instance_type: str | PipelineVariable | None#
ip_address_type: str | PipelineVariable | None#
kms_key_id: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_interface_id: str | PipelineVariable | None#
notebook_instance_arn: str | PipelineVariable | None#
notebook_instance_lifecycle_config_name: str | PipelineVariable | None#
notebook_instance_name: str | PipelineVariable#
notebook_instance_status: str | PipelineVariable | None#
platform_identifier: str | PipelineVariable | None#
populate_inputs_decorator()[source]#
refresh() NotebookInstance | None[source]#

Refresh a NotebookInstance resource

Returns:

The NotebookInstance resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

role_arn: str | PipelineVariable | None#
root_access: str | PipelineVariable | None#
security_groups: List[str | PipelineVariable] | None#
start(session: Session | None = None, region: str | None = None) None[source]#

Start a NotebookInstance resource

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

stop() None[source]#

Stop a NotebookInstance resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

subnet_id: str | PipelineVariable | None#
update(instance_type: str | PipelineVariable | None = Unassigned(), ip_address_type: str | PipelineVariable | None = Unassigned(), platform_identifier: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), lifecycle_config_name: str | PipelineVariable | None = Unassigned(), disassociate_lifecycle_config: bool | None = Unassigned(), volume_size_in_gb: int | None = Unassigned(), default_code_repository: str | PipelineVariable | None = Unassigned(), additional_code_repositories: List[str | PipelineVariable] | None = Unassigned(), accelerator_types: List[str | PipelineVariable] | None = Unassigned(), disassociate_accelerator_types: bool | None = Unassigned(), disassociate_default_code_repository: bool | None = Unassigned(), disassociate_additional_code_repositories: bool | None = Unassigned(), root_access: str | PipelineVariable | None = Unassigned(), instance_metadata_service_configuration: InstanceMetadataServiceConfiguration | None = Unassigned()) NotebookInstance | None[source]#

Update a NotebookInstance resource

Parameters:
  • lifecycle_config_name – The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

  • disassociate_lifecycle_config – Set to true to remove the notebook instance lifecycle configuration currently associated with the notebook instance. This operation is idempotent. If you specify a lifecycle configuration that is not associated with the notebook instance when you call this method, it does not throw an error.

  • disassociate_accelerator_types – This parameter is no longer supported. Elastic Inference (EI) is no longer available. This parameter was used to specify a list of the EI instance types to remove from this notebook instance.

  • disassociate_default_code_repository – The name or URL of the default Git repository to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.

  • disassociate_additional_code_repositories – A list of names or URLs of the default Git repositories to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.

Returns:

The NotebookInstance resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

url: str | PipelineVariable | None#
volume_size_in_gb: int | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a NotebookInstance resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Pending', 'InService', 'Stopping', 'Stopped', 'Failed', 'Deleting', 'Updating'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a NotebookInstance resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.NotebookInstanceLifecycleConfig(*, notebook_instance_lifecycle_config_name: str | PipelineVariable, notebook_instance_lifecycle_config_arn: str | PipelineVariable | None = Unassigned(), on_create: List[NotebookInstanceLifecycleHook] | None = Unassigned(), on_start: List[NotebookInstanceLifecycleHook] | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned())[source]#

Bases: Base

Class representing resource NotebookInstanceLifecycleConfig

notebook_instance_lifecycle_config_arn#

The Amazon Resource Name (ARN) of the lifecycle configuration.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

notebook_instance_lifecycle_config_name#

The name of the lifecycle configuration.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

on_create#

The shell script that runs only once, when you create a notebook instance.

Type:

List[sagemaker.core.shapes.shapes.NotebookInstanceLifecycleHook] | None

on_start#

The shell script that runs every time you start a notebook instance, including when you create the notebook instance.

Type:

List[sagemaker.core.shapes.shapes.NotebookInstanceLifecycleHook] | None

last_modified_time#

A timestamp that tells when the lifecycle configuration was last modified.

Type:

datetime.datetime | None

creation_time#

A timestamp that tells when the lifecycle configuration was created.

Type:

datetime.datetime | None

classmethod create(notebook_instance_lifecycle_config_name: str | PipelineVariable, on_create: List[NotebookInstanceLifecycleHook] | None = Unassigned(), on_start: List[NotebookInstanceLifecycleHook] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) NotebookInstanceLifecycleConfig | None[source]#

Create a NotebookInstanceLifecycleConfig resource

Parameters:
  • notebook_instance_lifecycle_config_name – The name of the lifecycle configuration.

  • on_create – A shell script that runs only once, when you create a notebook instance. The shell script must be a base64-encoded string.

  • on_start – A shell script that runs every time you start a notebook instance, including when you create the notebook instance. The shell script must be a base64-encoded string.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Returns:

The NotebookInstanceLifecycleConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a NotebookInstanceLifecycleConfig resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get(notebook_instance_lifecycle_config_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) NotebookInstanceLifecycleConfig | None[source]#

Get a NotebookInstanceLifecycleConfig resource

Parameters:
  • notebook_instance_lifecycle_config_name – The name of the lifecycle configuration to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The NotebookInstanceLifecycleConfig resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[NotebookInstanceLifecycleConfig][source]#

Get all NotebookInstanceLifecycleConfig resources

Parameters:
  • next_token – If the result of a ListNotebookInstanceLifecycleConfigs request was truncated, the response includes a NextToken. To get the next set of lifecycle configurations, use the token in the next request.

  • max_results – The maximum number of lifecycle configurations to return in the response.

  • sort_by – Sorts the list of results. The default is CreationTime.

  • sort_order – The sort order for results.

  • name_contains – A string in the lifecycle configuration name. This filter returns only lifecycle configurations whose name contains the specified string.

  • creation_time_before – A filter that returns only lifecycle configurations that were created before the specified time (timestamp).

  • creation_time_after – A filter that returns only lifecycle configurations that were created after the specified time (timestamp).

  • last_modified_time_before – A filter that returns only lifecycle configurations that were modified before the specified time (timestamp).

  • last_modified_time_after – A filter that returns only lifecycle configurations that were modified after the specified time (timestamp).

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed NotebookInstanceLifecycleConfig resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

notebook_instance_lifecycle_config_arn: str | PipelineVariable | None#
notebook_instance_lifecycle_config_name: str | PipelineVariable#
on_create: List[NotebookInstanceLifecycleHook] | None#
on_start: List[NotebookInstanceLifecycleHook] | None#
refresh() NotebookInstanceLifecycleConfig | None[source]#

Refresh a NotebookInstanceLifecycleConfig resource

Returns:

The NotebookInstanceLifecycleConfig resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

update(on_create: List[NotebookInstanceLifecycleHook] | None = Unassigned(), on_start: List[NotebookInstanceLifecycleHook] | None = Unassigned()) NotebookInstanceLifecycleConfig | None[source]#

Update a NotebookInstanceLifecycleConfig resource

Returns:

The NotebookInstanceLifecycleConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

class sagemaker.core.resources.OptimizationJob(*, optimization_job_name: str | PipelineVariable, optimization_job_arn: str | PipelineVariable | None = Unassigned(), optimization_job_status: str | PipelineVariable | None = Unassigned(), optimization_start_time: datetime | None = Unassigned(), optimization_end_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), model_source: OptimizationJobModelSource | None = Unassigned(), optimization_environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), deployment_instance_type: str | PipelineVariable | None = Unassigned(), max_instance_count: int | None = Unassigned(), optimization_configs: List[OptimizationConfig] | None = Unassigned(), output_config: OptimizationJobOutputConfig | None = Unassigned(), optimization_output: OptimizationOutput | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), stopping_condition: StoppingCondition | None = Unassigned(), vpc_config: OptimizationVpcConfig | None = Unassigned())[source]#

Bases: Base

Class representing resource OptimizationJob

optimization_job_arn#

The Amazon Resource Name (ARN) of the optimization job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

optimization_job_status#

The current status of the optimization job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time when you created the optimization job.

Type:

datetime.datetime | None

last_modified_time#

The time when the optimization job was last updated.

Type:

datetime.datetime | None

optimization_job_name#

The name that you assigned to the optimization job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

model_source#

The location of the source model to optimize with an optimization job.

Type:

sagemaker.core.shapes.shapes.OptimizationJobModelSource | None

deployment_instance_type#

The type of instance that hosts the optimized model that you create with the optimization job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

optimization_configs#

Settings for each of the optimization techniques that the job applies.

Type:

List[sagemaker.core.shapes.shapes.OptimizationConfig] | None

output_config#

Details for where to store the optimized model that you create with the optimization job.

Type:

sagemaker.core.shapes.shapes.OptimizationJobOutputConfig | None

role_arn#

The ARN of the IAM role that you assigned to the optimization job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

stopping_condition#
Type:

sagemaker.core.shapes.shapes.StoppingCondition | None

optimization_start_time#

The time when the optimization job started.

Type:

datetime.datetime | None

optimization_end_time#

The time when the optimization job finished processing.

Type:

datetime.datetime | None

failure_reason#

If the optimization job status is FAILED, the reason for the failure.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

optimization_environment#

The environment variables to set in the model container.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

max_instance_count#
Type:

int | None

optimization_output#

Output values produced by an optimization job.

Type:

sagemaker.core.shapes.shapes.OptimizationOutput | None

vpc_config#

A VPC in Amazon VPC that your optimized model has access to.

Type:

sagemaker.core.shapes.shapes.OptimizationVpcConfig | None

classmethod create(optimization_job_name: str | PipelineVariable, role_arn: str | PipelineVariable, model_source: OptimizationJobModelSource, deployment_instance_type: str | PipelineVariable, optimization_configs: List[OptimizationConfig], output_config: OptimizationJobOutputConfig, stopping_condition: StoppingCondition, max_instance_count: int | None = Unassigned(), optimization_environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), tags: List[Tag] | None = Unassigned(), vpc_config: OptimizationVpcConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) OptimizationJob | None[source]#

Create a OptimizationJob resource

Parameters:
  • optimization_job_name – A custom name for the new optimization job.

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf. During model optimization, Amazon SageMaker AI needs your permission to: Read input data from an S3 bucket Write model artifacts to an S3 bucket Write logs to Amazon CloudWatch Logs Publish metrics to Amazon CloudWatch You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker AI Roles.

  • model_source – The location of the source model to optimize with an optimization job.

  • deployment_instance_type – The type of instance that hosts the optimized model that you create with the optimization job.

  • optimization_configs – Settings for each of the optimization techniques that the job applies.

  • output_config – Details for where to store the optimized model that you create with the optimization job.

  • stopping_condition

  • max_instance_count

  • optimization_environment – The environment variables to set in the model container.

  • tags – A list of key-value pairs associated with the optimization job. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.

  • vpc_config – A VPC in Amazon VPC that your optimized model has access to.

  • session – Boto3 session.

  • region – Region name.

Returns:

The OptimizationJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a OptimizationJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

deployment_instance_type: str | PipelineVariable | None#
failure_reason: str | PipelineVariable | None#
classmethod get(optimization_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) OptimizationJob | None[source]#

Get a OptimizationJob resource

Parameters:
  • optimization_job_name – The name that you assigned to the optimization job.

  • session – Boto3 session.

  • region – Region name.

Returns:

The OptimizationJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), optimization_contains: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[OptimizationJob][source]#

Get all OptimizationJob resources

Parameters:
  • next_token – A token that you use to get the next set of results following a truncated response. If the response to the previous request was truncated, that response provides the value for this token.

  • max_results – The maximum number of optimization jobs to return in the response. The default is 50.

  • creation_time_after – Filters the results to only those optimization jobs that were created after the specified time.

  • creation_time_before – Filters the results to only those optimization jobs that were created before the specified time.

  • last_modified_time_after – Filters the results to only those optimization jobs that were updated after the specified time.

  • last_modified_time_before – Filters the results to only those optimization jobs that were updated before the specified time.

  • optimization_contains – Filters the results to only those optimization jobs that apply the specified optimization techniques. You can specify either Quantization or Compilation.

  • name_contains – Filters the results to only those optimization jobs with a name that contains the specified string.

  • status_equals – Filters the results to only those optimization jobs with the specified status.

  • sort_by – The field by which to sort the optimization jobs in the response. The default is CreationTime

  • sort_order – The sort order for results. The default is Ascending

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed OptimizationJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_time: datetime | None#
max_instance_count: int | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_source: OptimizationJobModelSource | None#
optimization_configs: List[OptimizationConfig] | None#
optimization_end_time: datetime | None#
optimization_environment: Dict[str | PipelineVariable, str | PipelineVariable] | None#
optimization_job_arn: str | PipelineVariable | None#
optimization_job_name: str | PipelineVariable#
optimization_job_status: str | PipelineVariable | None#
optimization_output: OptimizationOutput | None#
optimization_start_time: datetime | None#
output_config: OptimizationJobOutputConfig | None#
populate_inputs_decorator()[source]#
refresh() OptimizationJob | None[source]#

Refresh a OptimizationJob resource

Returns:

The OptimizationJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stop() None[source]#

Stop a OptimizationJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stopping_condition: StoppingCondition | None#
vpc_config: OptimizationVpcConfig | None#
wait(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a OptimizationJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.PartnerApp(*, arn: str | PipelineVariable, name: str | PipelineVariable | None = Unassigned(), type: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), execution_role_arn: str | PipelineVariable | None = Unassigned(), kms_key_id: str | PipelineVariable | None = Unassigned(), sdk_url: str | PipelineVariable | None = Unassigned(), base_url: str | PipelineVariable | None = Unassigned(), maintenance_config: PartnerAppMaintenanceConfig | None = Unassigned(), tier: str | PipelineVariable | None = Unassigned(), version: str | PipelineVariable | None = Unassigned(), application_config: PartnerAppConfig | None = Unassigned(), auth_type: str | PipelineVariable | None = Unassigned(), enable_iam_session_based_identity: bool | None = Unassigned(), error: ErrorInfo | None = Unassigned(), enable_auto_minor_version_upgrade: bool | None = Unassigned(), current_version_eol_date: datetime | None = Unassigned(), available_upgrade: AvailableUpgrade | None = Unassigned())[source]#

Bases: Base

Class representing resource PartnerApp

arn#

The ARN of the SageMaker Partner AI App that was described.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

name#

The name of the SageMaker Partner AI App.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

type#

The type of SageMaker Partner AI App. Must be one of the following: lakera-guard, comet, deepchecks-llm-evaluation, or fiddler.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status of the SageMaker Partner AI App. Creating: SageMaker AI is creating the partner AI app. The partner AI app is not available during creation. Updating: SageMaker AI is updating the partner AI app. The partner AI app is not available when updating. Deleting: SageMaker AI is deleting the partner AI app. The partner AI app is not available during deletion. Available: The partner AI app is provisioned and accessible. Failed: The partner AI app is in a failed state and isn’t available. SageMaker AI is investigating the issue. For further guidance, contact Amazon Web Services Support. UpdateFailed: The partner AI app couldn’t be updated but is available. Deleted: The partner AI app is permanently deleted and not available.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time that the SageMaker Partner AI App was created.

Type:

datetime.datetime | None

last_modified_time#

The time that the SageMaker Partner AI App was last modified.

Type:

datetime.datetime | None

execution_role_arn#

The ARN of the IAM role associated with the SageMaker Partner AI App.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

kms_key_id#

The Amazon Web Services KMS customer managed key used to encrypt the data at rest associated with SageMaker Partner AI Apps.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

sdk_url#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

base_url#

The URL of the SageMaker Partner AI App that the Application SDK uses to support in-app calls for the user.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

maintenance_config#

Maintenance configuration settings for the SageMaker Partner AI App.

Type:

sagemaker.core.shapes.shapes.PartnerAppMaintenanceConfig | None

tier#

The instance type and size of the cluster attached to the SageMaker Partner AI App.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

version#

The version of the SageMaker Partner AI App.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

application_config#

Configuration settings for the SageMaker Partner AI App.

Type:

sagemaker.core.shapes.shapes.PartnerAppConfig | None

auth_type#

The authorization type that users use to access the SageMaker Partner AI App.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

enable_iam_session_based_identity#

When set to TRUE, the SageMaker Partner AI App sets the Amazon Web Services IAM session name or the authenticated IAM user as the identity of the SageMaker Partner AI App user.

Type:

bool | None

error#

This is an error field object that contains the error code and the reason for an operation failure.

Type:

sagemaker.core.shapes.shapes.ErrorInfo | None

enable_auto_minor_version_upgrade#

Indicates whether the SageMaker Partner AI App is configured for automatic minor version upgrades during scheduled maintenance windows.

Type:

bool | None

current_version_eol_date#

The end-of-life date for the current version of the SageMaker Partner AI App.

Type:

datetime.datetime | None

available_upgrade#

A map of available minor version upgrades for the SageMaker Partner AI App. The key is the semantic version number, and the value is a list of release notes for that version. A null value indicates no upgrades are available.

Type:

sagemaker.core.shapes.shapes.AvailableUpgrade | None

application_config: PartnerAppConfig | None#
arn: str | PipelineVariable#
auth_type: str | PipelineVariable | None#
available_upgrade: AvailableUpgrade | None#
base_url: str | PipelineVariable | None#
classmethod create(name: str | PipelineVariable, type: str | PipelineVariable, execution_role_arn: str | PipelineVariable, tier: str | PipelineVariable, auth_type: str | PipelineVariable, kms_key_id: str | PipelineVariable | None = Unassigned(), maintenance_config: PartnerAppMaintenanceConfig | None = Unassigned(), version: str | PipelineVariable | None = Unassigned(), application_config: PartnerAppConfig | None = Unassigned(), enable_iam_session_based_identity: bool | None = Unassigned(), enable_auto_minor_version_upgrade: bool | None = Unassigned(), client_token: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) PartnerApp | None[source]#

Create a PartnerApp resource

Parameters:
  • name – The name to give the SageMaker Partner AI App.

  • type – The type of SageMaker Partner AI App to create. Must be one of the following: lakera-guard, comet, deepchecks-llm-evaluation, or fiddler.

  • execution_role_arn – The ARN of the IAM role that the partner application uses.

  • tier – Indicates the instance type and size of the cluster attached to the SageMaker Partner AI App.

  • auth_type – The authorization type that users use to access the SageMaker Partner AI App.

  • kms_key_id – SageMaker Partner AI Apps uses Amazon Web Services KMS to encrypt data at rest using an Amazon Web Services managed key by default. For more control, specify a customer managed key.

  • maintenance_config – Maintenance configuration settings for the SageMaker Partner AI App.

  • version

  • application_config – Configuration settings for the SageMaker Partner AI App.

  • enable_iam_session_based_identity – When set to TRUE, the SageMaker Partner AI App sets the Amazon Web Services IAM session name or the authenticated IAM user as the identity of the SageMaker Partner AI App user.

  • enable_auto_minor_version_upgrade – When set to TRUE, the SageMaker Partner AI App is automatically upgraded to the latest minor version during the next scheduled maintenance window, if one is available. Default is FALSE.

  • client_token – A unique token that guarantees that the call to this API is idempotent.

  • tags – Each tag consists of a key and an optional value. Tag keys must be unique per resource.

  • session – Boto3 session.

  • region – Region name.

Returns:

The PartnerApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
current_version_eol_date: datetime | None#
delete(client_token: str | PipelineVariable | None = Unassigned()) None[source]#

Delete a PartnerApp resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

enable_auto_minor_version_upgrade: bool | None#
enable_iam_session_based_identity: bool | None#
error: ErrorInfo | None#
execution_role_arn: str | PipelineVariable | None#
classmethod get(arn: str | PipelineVariable, include_available_upgrade: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) PartnerApp | None[source]#

Get a PartnerApp resource

Parameters:
  • arn – The ARN of the SageMaker Partner AI App to describe.

  • include_available_upgrade – When set to TRUE, the response includes available upgrade information for the SageMaker Partner AI App. Default is FALSE.

  • session – Boto3 session.

  • region – Region name.

Returns:

The PartnerApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[PartnerApp][source]#

Get all PartnerApp resources.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed PartnerApp resources.

get_name() str[source]#
kms_key_id: str | PipelineVariable | None#
last_modified_time: datetime | None#
maintenance_config: PartnerAppMaintenanceConfig | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str | PipelineVariable | None#
populate_inputs_decorator()[source]#
refresh(include_available_upgrade: bool | None = Unassigned()) PartnerApp | None[source]#

Refresh a PartnerApp resource

Returns:

The PartnerApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

sdk_url: str | PipelineVariable | None#
start(partner_app_arn: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Start a PartnerApp resource

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

status: str | PipelineVariable | None#
stop() None[source]#

Stop a PartnerApp resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

tier: str | PipelineVariable | None#
type: str | PipelineVariable | None#
update(maintenance_config: PartnerAppMaintenanceConfig | None = Unassigned(), tier: str | PipelineVariable | None = Unassigned(), application_config: PartnerAppConfig | None = Unassigned(), enable_iam_session_based_identity: bool | None = Unassigned(), enable_auto_minor_version_upgrade: bool | None = Unassigned(), app_version: str | PipelineVariable | None = Unassigned(), client_token: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned()) PartnerApp | None[source]#

Update a PartnerApp resource

Parameters:
  • app_version – The semantic version to upgrade the SageMaker Partner AI App to. Must be the same semantic version returned in the AvailableUpgrade field from DescribePartnerApp. Version skipping and downgrades are not supported.

  • client_token – A unique token that guarantees that the call to this API is idempotent.

  • tags – Each tag consists of a key and an optional value. Tag keys must be unique per resource.

Returns:

The PartnerApp resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

version: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a PartnerApp resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'Updating', 'Deleting', 'Available', 'Failed', 'UpdateFailed', 'Deleted'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a PartnerApp resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.PartnerAppPresignedUrl(*, arn: str | PipelineVariable, expires_in_seconds: int | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PartnerAppPresignedUrl

arn#

The ARN of the SageMaker Partner AI App to create the presigned URL for.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

expires_in_seconds#

The time that will pass before the presigned URL expires.

Type:

int | None

session_expiration_duration_in_seconds#

Indicates how long the Amazon SageMaker Partner AI App session can be accessed for after logging in.

Type:

int | None

url#

The presigned URL that you can use to access the SageMaker Partner AI App.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

arn: str | PipelineVariable#
classmethod create(arn: str | PipelineVariable, expires_in_seconds: int | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), session: Session | None = None, region: str | None = None) PartnerAppPresignedUrl | None[source]#

Create a PartnerAppPresignedUrl resource

Parameters:
  • arn – The ARN of the SageMaker Partner AI App to create the presigned URL for.

  • expires_in_seconds – The time that will pass before the presigned URL expires.

  • session_expiration_duration_in_seconds – Indicates how long the Amazon SageMaker Partner AI App session can be accessed for after logging in.

  • session – Boto3 session.

  • region – Region name.

Returns:

The PartnerAppPresignedUrl resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessDeniedException

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

expires_in_seconds: int | None#
get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_expiration_duration_in_seconds: int | None#
url: str | PipelineVariable | None#
class sagemaker.core.resources.PersistentVolume(*, persistent_volume_name: str | PipelineVariable, domain_id: str | PipelineVariable, persistent_volume_arn: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), persistent_volume_configuration: PersistentVolumeConfiguration | None = Unassigned(), owning_entity_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PersistentVolume

persistent_volume_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

persistent_volume_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

domain_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

persistent_volume_configuration#
Type:

sagemaker.core.shapes.shapes.PersistentVolumeConfiguration | None

owning_entity_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#
Type:

datetime.datetime | None

last_modified_time#
Type:

datetime.datetime | None

failure_reason#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(persistent_volume_name: str | PipelineVariable, domain_id: str | PipelineVariable, persistent_volume_configuration: PersistentVolumeConfiguration, tags: List[Tag] | None = Unassigned(), owning_entity_arn: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) PersistentVolume | None[source]#

Create a PersistentVolume resource

Parameters:
  • persistent_volume_name

  • domain_id

  • persistent_volume_configuration

  • tags

  • owning_entity_arn

  • session – Boto3 session.

  • region – Region name.

Returns:

The PersistentVolume resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a PersistentVolume resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

domain_id: str | PipelineVariable#
failure_reason: str | PipelineVariable | None#
classmethod get(persistent_volume_name: str | PipelineVariable, domain_id: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) PersistentVolume | None[source]#

Get a PersistentVolume resource

Parameters:
  • persistent_volume_name

  • domain_id

  • session – Boto3 session.

  • region – Region name.

Returns:

The PersistentVolume resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

owning_entity_arn: str | PipelineVariable | None#
persistent_volume_arn: str | PipelineVariable | None#
persistent_volume_configuration: PersistentVolumeConfiguration | None#
persistent_volume_name: str | PipelineVariable#
refresh() PersistentVolume | None[source]#

Refresh a PersistentVolume resource

Returns:

The PersistentVolume resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

status: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a PersistentVolume resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'Available', 'Attaching', 'InUse', 'Deleting', 'Failed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a PersistentVolume resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.Pipeline(*, pipeline_name: str | PipelineVariable, pipeline_arn: str | PipelineVariable | None = Unassigned(), pipeline_display_name: str | PipelineVariable | None = Unassigned(), pipeline_definition: str | PipelineVariable | None = Unassigned(), pipeline_description: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), pipeline_status: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_run_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), parallelism_configuration: ParallelismConfiguration | None = Unassigned(), pipeline_version_display_name: str | PipelineVariable | None = Unassigned(), pipeline_version_description: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Pipeline

pipeline_arn#

The Amazon Resource Name (ARN) of the pipeline.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_name#

The name of the pipeline.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

pipeline_display_name#

The display name of the pipeline.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_definition#

The JSON pipeline definition.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_description#

The description of the pipeline.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

role_arn#

The Amazon Resource Name (ARN) that the pipeline uses to execute.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_status#

The status of the pipeline execution.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time when the pipeline was created.

Type:

datetime.datetime | None

last_modified_time#

The time when the pipeline was last modified.

Type:

datetime.datetime | None

last_run_time#

The time when the pipeline was last run.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

parallelism_configuration#

Lists the parallelism configuration applied to the pipeline.

Type:

sagemaker.core.shapes.shapes.ParallelismConfiguration | None

pipeline_version_display_name#

The display name of the pipeline version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_version_description#

The description of the pipeline version.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(pipeline_name: str | PipelineVariable, client_request_token: str | PipelineVariable, role_arn: str | PipelineVariable, pipeline_display_name: str | PipelineVariable | None = Unassigned(), pipeline_definition: str | PipelineVariable | None = Unassigned(), pipeline_definition_s3_location: PipelineDefinitionS3Location | None = Unassigned(), pipeline_description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), parallelism_configuration: ParallelismConfiguration | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Pipeline | None[source]#

Create a Pipeline resource

Parameters:
  • pipeline_name – The name of the pipeline.

  • client_request_token – A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.

  • role_arn – The Amazon Resource Name (ARN) of the role used by the pipeline to access and create resources.

  • pipeline_display_name – The display name of the pipeline.

  • pipeline_definition – The JSON pipeline definition of the pipeline.

  • pipeline_definition_s3_location – The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location.

  • pipeline_description – A description of the pipeline.

  • tags – A list of tags to apply to the created pipeline.

  • parallelism_configuration – This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Pipeline resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete(client_request_token: str | PipelineVariable) None[source]#

Delete a Pipeline resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

classmethod get(pipeline_name: str | PipelineVariable, pipeline_version_id: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Pipeline | None[source]#

Get a Pipeline resource

Parameters:
  • pipeline_name – The name or Amazon Resource Name (ARN) of the pipeline to describe.

  • pipeline_version_id – The ID of the pipeline version to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Pipeline resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(pipeline_name_prefix: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Pipeline][source]#

Get all Pipeline resources

Parameters:
  • pipeline_name_prefix – The prefix of the pipeline name.

  • created_after – A filter that returns the pipelines that were created after a specified time.

  • created_before – A filter that returns the pipelines that were created before a specified time.

  • sort_by – The field by which to sort results. The default is CreatedTime.

  • sort_order – The sort order for results.

  • next_token – If the result of the previous ListPipelines request was truncated, the response includes a NextToken. To retrieve the next set of pipelines, use the token in the next request.

  • max_results – The maximum number of pipelines to return in the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Pipeline resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
last_run_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parallelism_configuration: ParallelismConfiguration | None#
pipeline_arn: str | PipelineVariable | None#
pipeline_definition: str | PipelineVariable | None#
pipeline_description: str | PipelineVariable | None#
pipeline_display_name: str | PipelineVariable | None#
pipeline_name: str | PipelineVariable#
pipeline_status: str | PipelineVariable | None#
pipeline_version_description: str | PipelineVariable | None#
pipeline_version_display_name: str | PipelineVariable | None#
populate_inputs_decorator()[source]#
refresh(pipeline_version_id: int | None = Unassigned()) Pipeline | None[source]#

Refresh a Pipeline resource

Returns:

The Pipeline resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
update(pipeline_display_name: str | PipelineVariable | None = Unassigned(), pipeline_definition: str | PipelineVariable | None = Unassigned(), pipeline_definition_s3_location: PipelineDefinitionS3Location | None = Unassigned(), pipeline_description: str | PipelineVariable | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), parallelism_configuration: ParallelismConfiguration | None = Unassigned()) Pipeline | None[source]#

Update a Pipeline resource

Parameters:

pipeline_definition_s3_location – The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location.

Returns:

The Pipeline resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Pipeline resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Active', 'Deleting'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Pipeline resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.PipelineExecution(*, pipeline_execution_arn: str | PipelineVariable, pipeline_arn: str | PipelineVariable | None = Unassigned(), pipeline_execution_display_name: str | PipelineVariable | None = Unassigned(), pipeline_execution_status: str | PipelineVariable | None = Unassigned(), pipeline_execution_description: str | PipelineVariable | None = Unassigned(), pipeline_experiment_config: PipelineExperimentConfig | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), parallelism_configuration: ParallelismConfiguration | None = Unassigned(), selective_execution_config: SelectiveExecutionConfig | None = Unassigned(), pipeline_version_id: int | None = Unassigned(), m_lflow_config: MLflowConfiguration | None = Unassigned())[source]#

Bases: Base

Class representing resource PipelineExecution

pipeline_arn#

The Amazon Resource Name (ARN) of the pipeline.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_execution_arn#

The Amazon Resource Name (ARN) of the pipeline execution.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

pipeline_execution_display_name#

The display name of the pipeline execution.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_execution_status#

The status of the pipeline execution.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_execution_description#

The description of the pipeline execution.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

pipeline_experiment_config#
Type:

sagemaker.core.shapes.shapes.PipelineExperimentConfig | None

failure_reason#

If the execution failed, a message describing why.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time when the pipeline execution was created.

Type:

datetime.datetime | None

last_modified_time#

The time when the pipeline execution was modified last.

Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

parallelism_configuration#

The parallelism configuration applied to the pipeline.

Type:

sagemaker.core.shapes.shapes.ParallelismConfiguration | None

selective_execution_config#

The selective execution configuration applied to the pipeline run.

Type:

sagemaker.core.shapes.shapes.SelectiveExecutionConfig | None

pipeline_version_id#

The ID of the pipeline version.

Type:

int | None

m_lflow_config#
Type:

sagemaker.core.shapes.shapes.MLflowConfiguration | None

created_by: UserContext | None#
creation_time: datetime | None#
failure_reason: str | PipelineVariable | None#
classmethod get(pipeline_execution_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) PipelineExecution | None[source]#

Get a PipelineExecution resource

Parameters:
  • pipeline_execution_arn – The Amazon Resource Name (ARN) of the pipeline execution.

  • session – Boto3 session.

  • region – Region name.

Returns:

The PipelineExecution resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(pipeline_name: str | PipelineVariable, created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[PipelineExecution][source]#

Get all PipelineExecution resources

Parameters:
  • pipeline_name – The name or Amazon Resource Name (ARN) of the pipeline.

  • created_after – A filter that returns the pipeline executions that were created after a specified time.

  • created_before – A filter that returns the pipeline executions that were created before a specified time.

  • sort_by – The field by which to sort results. The default is CreatedTime.

  • sort_order – The sort order for results.

  • next_token – If the result of the previous ListPipelineExecutions request was truncated, the response includes a NextToken. To retrieve the next set of pipeline executions, use the token in the next request.

  • max_results – The maximum number of pipeline executions to return in the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed PipelineExecution resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_all_parameters(session: Session | None = None, region: str | None = None) ResourceIterator[Parameter][source]#

Gets a list of parameters for a pipeline execution.

Parameters:
  • next_token – If the result of the previous ListPipelineParametersForExecution request was truncated, the response includes a NextToken. To retrieve the next set of parameters, use the token in the next request.

  • max_results – The maximum number of parameters to return in the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Parameter.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_all_steps(sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[PipelineExecutionStep][source]#

Gets a list of PipeLineExecutionStep objects.

Parameters:
  • next_token – If the result of the previous ListPipelineExecutionSteps request was truncated, the response includes a NextToken. To retrieve the next set of pipeline execution steps, use the token in the next request.

  • max_results – The maximum number of pipeline execution steps to return in the response.

  • sort_order – The field by which to sort results. The default is CreatedTime.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed PipelineExecutionStep.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
get_pipeline_definition(session: Session | None = None, region: str | None = None) DescribePipelineDefinitionForExecutionResponse | None[source]#

Describes the details of an execution’s pipeline definition.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

DescribePipelineDefinitionForExecutionResponse

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

last_modified_by: UserContext | None#
last_modified_time: datetime | None#
m_lflow_config: MLflowConfiguration | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parallelism_configuration: ParallelismConfiguration | None#
pipeline_arn: str | PipelineVariable | None#
pipeline_execution_arn: str | PipelineVariable#
pipeline_execution_description: str | PipelineVariable | None#
pipeline_execution_display_name: str | PipelineVariable | None#
pipeline_execution_status: str | PipelineVariable | None#
pipeline_experiment_config: PipelineExperimentConfig | None#
pipeline_version_id: int | None#
refresh() PipelineExecution | None[source]#

Refresh a PipelineExecution resource

Returns:

The PipelineExecution resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

retry(client_request_token: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Retry the execution of the pipeline.

Parameters:
  • client_request_token – A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

selective_execution_config: SelectiveExecutionConfig | None#
send_execution_step_failure(callback_token: str | PipelineVariable, client_request_token: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Notifies the pipeline that the execution of a callback step failed, along with a message describing why.

Parameters:
  • callback_token – The pipeline generated token from the Amazon SQS queue.

  • client_request_token – A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

send_execution_step_success(callback_token: str | PipelineVariable, output_parameters: List[OutputParameter] | None = Unassigned(), client_request_token: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Notifies the pipeline that the execution of a callback step succeeded and provides a list of the step’s output parameters.

Parameters:
  • callback_token – The pipeline generated token from the Amazon SQS queue.

  • output_parameters – A list of the output parameters of the callback step.

  • client_request_token – A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

start(pipeline_name: str | PipelineVariable, client_request_token: str | PipelineVariable, pipeline_parameters: List[Parameter] | None = Unassigned(), mlflow_experiment_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) None[source]#

Start a PipelineExecution resource

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

stop() None[source]#

Stop a PipelineExecution resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

update(pipeline_execution_description: str | PipelineVariable | None = Unassigned(), pipeline_execution_display_name: str | PipelineVariable | None = Unassigned(), parallelism_configuration: ParallelismConfiguration | None = Unassigned()) PipelineExecution | None[source]#

Update a PipelineExecution resource

Returns:

The PipelineExecution resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

wait_for_status(target_status: Literal['Executing', 'Stopping', 'Stopped', 'Failed', 'Succeeded'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a PipelineExecution resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.PresignedDomainUrl(*, domain_id: str | PipelineVariable, user_profile_name: str | PipelineVariable | object, session_expiration_duration_in_seconds: int | None = Unassigned(), expires_in_seconds: int | None = Unassigned(), app_type: str | PipelineVariable | None = Unassigned(), app_redirection_relative_path: str | PipelineVariable | None = Unassigned(), space_name: str | PipelineVariable | object | None = Unassigned(), landing_uri: str | PipelineVariable | None = Unassigned(), is_dual_stack_endpoint: bool | None = Unassigned(), authorized_url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PresignedDomainUrl

domain_id#

The domain ID.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

user_profile_name#

The name of the UserProfile to sign-in as.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

session_expiration_duration_in_seconds#

The session expiration duration in seconds. This value defaults to 43200.

Type:

int | None

expires_in_seconds#

The number of seconds until the pre-signed URL expires. This value defaults to 300.

Type:

int | None

app_type#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_redirection_relative_path#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

space_name#

The name of the space.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object | None

landing_uri#

The landing page that the user is directed to when accessing the presigned URL. Using this value, users can access Studio or Studio Classic, even if it is not the default experience for the domain. The supported values are: studio::relative/path: Directs users to the relative path in Studio. app:JupyterServer:relative/path: Directs users to the relative path in the Studio Classic application. app:JupyterLab:relative/path: Directs users to the relative path in the JupyterLab application. app:RStudioServerPro:relative/path: Directs users to the relative path in the RStudio application. app:CodeEditor:relative/path: Directs users to the relative path in the Code Editor, based on Code-OSS, Visual Studio Code - Open Source application. app:Canvas:relative/path: Directs users to the relative path in the Canvas application.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

is_dual_stack_endpoint#
Type:

bool | None

authorized_url#

The presigned URL.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_redirection_relative_path: str | PipelineVariable | None#
app_type: str | PipelineVariable | None#
authorized_url: str | PipelineVariable | None#
classmethod create(domain_id: str | PipelineVariable, user_profile_name: str | PipelineVariable | object, session_expiration_duration_in_seconds: int | None = Unassigned(), expires_in_seconds: int | None = Unassigned(), app_type: str | PipelineVariable | None = Unassigned(), app_redirection_relative_path: str | PipelineVariable | None = Unassigned(), space_name: str | PipelineVariable | object | None = Unassigned(), landing_uri: str | PipelineVariable | None = Unassigned(), is_dual_stack_endpoint: bool | None = Unassigned(), session: Session | None = None, region: str | None = None) PresignedDomainUrl | None[source]#

Create a PresignedDomainUrl resource

Parameters:
  • domain_id – The domain ID.

  • user_profile_name – The name of the UserProfile to sign-in as.

  • session_expiration_duration_in_seconds – The session expiration duration in seconds. This value defaults to 43200.

  • expires_in_seconds – The number of seconds until the pre-signed URL expires. This value defaults to 300.

  • app_type

  • app_redirection_relative_path

  • space_name – The name of the space.

  • landing_uri – The landing page that the user is directed to when accessing the presigned URL. Using this value, users can access Studio or Studio Classic, even if it is not the default experience for the domain. The supported values are: studio::relative/path: Directs users to the relative path in Studio. app:JupyterServer:relative/path: Directs users to the relative path in the Studio Classic application. app:JupyterLab:relative/path: Directs users to the relative path in the JupyterLab application. app:RStudioServerPro:relative/path: Directs users to the relative path in the RStudio application. app:CodeEditor:relative/path: Directs users to the relative path in the Code Editor, based on Code-OSS, Visual Studio Code - Open Source application. app:Canvas:relative/path: Directs users to the relative path in the Canvas application.

  • is_dual_stack_endpoint

  • session – Boto3 session.

  • region – Region name.

Returns:

The PresignedDomainUrl resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

domain_id: str | PipelineVariable#
expires_in_seconds: int | None#
get_name() str[source]#
is_dual_stack_endpoint: bool | None#
landing_uri: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_expiration_duration_in_seconds: int | None#
space_name: str | PipelineVariable | object | None#
user_profile_name: str | PipelineVariable | object#
class sagemaker.core.resources.PresignedDomainUrlWithPrincipalTag(*, domain_id: str | PipelineVariable | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), expires_in_seconds: int | None = Unassigned(), landing_uri: str | PipelineVariable | None = Unassigned(), is_dual_stack_endpoint: bool | None = Unassigned(), authorized_url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PresignedDomainUrlWithPrincipalTag

domain_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

session_expiration_duration_in_seconds#
Type:

int | None

expires_in_seconds#
Type:

int | None

landing_uri#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

is_dual_stack_endpoint#
Type:

bool | None

authorized_url#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

authorized_url: str | PipelineVariable | None#
classmethod create(domain_id: str | PipelineVariable | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), expires_in_seconds: int | None = Unassigned(), landing_uri: str | PipelineVariable | None = Unassigned(), is_dual_stack_endpoint: bool | None = Unassigned(), session: Session | None = None, region: str | None = None) PresignedDomainUrlWithPrincipalTag | None[source]#

Create a PresignedDomainUrlWithPrincipalTag resource

Parameters:
  • domain_id

  • session_expiration_duration_in_seconds

  • expires_in_seconds

  • landing_uri

  • is_dual_stack_endpoint

  • session – Boto3 session.

  • region – Region name.

Returns:

The PresignedDomainUrlWithPrincipalTag resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

domain_id: str | PipelineVariable | None#
expires_in_seconds: int | None#
get_name() str[source]#
is_dual_stack_endpoint: bool | None#
landing_uri: str | PipelineVariable | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_expiration_duration_in_seconds: int | None#
class sagemaker.core.resources.PresignedMlflowAppUrl(*, arn: str | PipelineVariable, expires_in_seconds: int | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), authorized_url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PresignedMlflowAppUrl

arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

expires_in_seconds#
Type:

int | None

session_expiration_duration_in_seconds#
Type:

int | None

authorized_url#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

arn: str | PipelineVariable#
authorized_url: str | PipelineVariable | None#
classmethod create(arn: str | PipelineVariable, expires_in_seconds: int | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), session: Session | None = None, region: str | None = None) PresignedMlflowAppUrl | None[source]#

Create a PresignedMlflowAppUrl resource

Parameters:
  • arn

  • expires_in_seconds

  • session_expiration_duration_in_seconds

  • session – Boto3 session.

  • region – Region name.

Returns:

The PresignedMlflowAppUrl resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

expires_in_seconds: int | None#
get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_expiration_duration_in_seconds: int | None#
class sagemaker.core.resources.PresignedMlflowTrackingServerUrl(*, tracking_server_name: str | PipelineVariable, expires_in_seconds: int | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), authorized_url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PresignedMlflowTrackingServerUrl

tracking_server_name#

The name of the tracking server to connect to your MLflow UI.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

expires_in_seconds#

The duration in seconds that your presigned URL is valid. The presigned URL can be used only once.

Type:

int | None

session_expiration_duration_in_seconds#

The duration in seconds that your MLflow UI session is valid.

Type:

int | None

authorized_url#

A presigned URL with an authorization token.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

authorized_url: str | PipelineVariable | None#
classmethod create(tracking_server_name: str | PipelineVariable, expires_in_seconds: int | None = Unassigned(), session_expiration_duration_in_seconds: int | None = Unassigned(), session: Session | None = None, region: str | None = None) PresignedMlflowTrackingServerUrl | None[source]#

Create a PresignedMlflowTrackingServerUrl resource

Parameters:
  • tracking_server_name – The name of the tracking server to connect to your MLflow UI.

  • expires_in_seconds – The duration in seconds that your presigned URL is valid. The presigned URL can be used only once.

  • session_expiration_duration_in_seconds – The duration in seconds that your MLflow UI session is valid.

  • session – Boto3 session.

  • region – Region name.

Returns:

The PresignedMlflowTrackingServerUrl resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

expires_in_seconds: int | None#
get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

session_expiration_duration_in_seconds: int | None#
tracking_server_name: str | PipelineVariable#
class sagemaker.core.resources.PresignedNotebookInstanceUrl(*, notebook_instance_name: str | PipelineVariable | object, session_expiration_duration_in_seconds: int | None = Unassigned(), authorized_url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource PresignedNotebookInstanceUrl

notebook_instance_name#

The name of the notebook instance.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

session_expiration_duration_in_seconds#

The duration of the session, in seconds. The default is 12 hours.

Type:

int | None

authorized_url#

A JSON object that contains the URL string.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

authorized_url: str | PipelineVariable | None#
classmethod create(notebook_instance_name: str | PipelineVariable | object, session_expiration_duration_in_seconds: int | None = Unassigned(), session: Session | None = None, region: str | None = None) PresignedNotebookInstanceUrl | None[source]#

Create a PresignedNotebookInstanceUrl resource

Parameters:
  • notebook_instance_name – The name of the notebook instance.

  • session_expiration_duration_in_seconds – The duration of the session, in seconds. The default is 12 hours.

  • session – Boto3 session.

  • region – Region name.

Returns:

The PresignedNotebookInstanceUrl resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

notebook_instance_name: str | PipelineVariable | object#
session_expiration_duration_in_seconds: int | None#
class sagemaker.core.resources.ProcessingJob(*, processing_job_name: str | PipelineVariable, processing_inputs: List[ProcessingInput] | None = Unassigned(), processing_output_config: ProcessingOutputConfig | None = Unassigned(), processing_resources: ProcessingResources | None = Unassigned(), stopping_condition: ProcessingStoppingCondition | None = Unassigned(), app_specification: AppSpecification | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), network_config: NetworkConfig | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), experiment_config: ExperimentConfig | None = Unassigned(), processing_job_arn: str | PipelineVariable | None = Unassigned(), processing_job_status: str | PipelineVariable | None = Unassigned(), exit_message: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), processing_end_time: datetime | None = Unassigned(), processing_start_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), created_by: UserContext | None = Unassigned(), monitoring_schedule_arn: str | PipelineVariable | None = Unassigned(), auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), training_job_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource ProcessingJob

processing_job_name#

The name of the processing job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

processing_resources#

Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job. In distributed training, you specify more than one instance.

Type:

sagemaker.core.shapes.shapes.ProcessingResources | None

app_specification#

Configures the processing job to run a specified container image.

Type:

sagemaker.core.shapes.shapes.AppSpecification | None

processing_job_arn#

The Amazon Resource Name (ARN) of the processing job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

processing_job_status#

Provides the status of a processing job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time at which the processing job was created.

Type:

datetime.datetime | None

processing_inputs#

The inputs for a processing job.

Type:

List[sagemaker.core.shapes.shapes.ProcessingInput] | None

processing_output_config#

Output configuration for the processing job.

Type:

sagemaker.core.shapes.shapes.ProcessingOutputConfig | None

stopping_condition#

The time limit for how long the processing job is allowed to run.

Type:

sagemaker.core.shapes.shapes.ProcessingStoppingCondition | None

environment#

The environment variables set in the Docker container.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

network_config#

Networking options for a processing job.

Type:

sagemaker.core.shapes.shapes.NetworkConfig | None

role_arn#

The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

experiment_config#

The configuration information used to create an experiment.

Type:

sagemaker.core.shapes.shapes.ExperimentConfig | None

exit_message#

An optional string, up to one KB in size, that contains metadata from the processing container when the processing job exits.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

failure_reason#

A string, up to one KB in size, that contains the reason a processing job failed, if it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

processing_end_time#

The time at which the processing job completed.

Type:

datetime.datetime | None

processing_start_time#

The time at which the processing job started.

Type:

datetime.datetime | None

last_modified_time#

The time at which the processing job was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

monitoring_schedule_arn#

The ARN of a monitoring schedule for an endpoint associated with this processing job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_arn#

The ARN of an AutoML job associated with this processing job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

training_job_arn#

The ARN of a training job associated with this processing job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

app_specification: AppSpecification | None#
auto_ml_job_arn: str | PipelineVariable | None#
classmethod create(processing_job_name: str | PipelineVariable, processing_resources: ProcessingResources, app_specification: AppSpecification, role_arn: str | PipelineVariable, processing_inputs: List[ProcessingInput] | None = Unassigned(), processing_output_config: ProcessingOutputConfig | None = Unassigned(), stopping_condition: ProcessingStoppingCondition | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), network_config: NetworkConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), workflow_type: str | PipelineVariable | None = Unassigned(), experiment_config: ExperimentConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ProcessingJob | None[source]#

Create a ProcessingJob resource

Parameters:
  • processing_job_name – The name of the processing job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • processing_resources – Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job. In distributed training, you specify more than one instance.

  • app_specification – Configures the processing job to run a specified Docker container image.

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.

  • processing_inputs – An array of inputs configuring the data to download into the processing container.

  • processing_output_config – Output configuration for the processing job.

  • stopping_condition – The time limit for how long the processing job is allowed to run.

  • environment – The environment variables to set in the Docker container. Up to 100 key and values entries in the map are supported. Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.

  • network_config – Networking options for a processing job, such as whether to allow inbound and outbound network calls to and from processing containers, and the VPC subnets and security groups to use for VPC-enabled processing jobs.

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide. Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request tag variable or plain text fields.

  • workflow_type

  • experiment_config

  • session – Boto3 session.

  • region – Region name.

Returns:

The ProcessingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a ProcessingJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

environment: Dict[str | PipelineVariable, str | PipelineVariable] | None#
exit_message: str | PipelineVariable | None#
experiment_config: ExperimentConfig | None#
failure_reason: str | PipelineVariable | None#
classmethod get(processing_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ProcessingJob | None[source]#

Get a ProcessingJob resource

Parameters:
  • processing_job_name – The name of the processing job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.

  • session – Boto3 session.

  • region – Region name.

Returns:

The ProcessingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ProcessingJob][source]#

Get all ProcessingJob resources

Parameters:
  • creation_time_after – A filter that returns only processing jobs created after the specified time.

  • creation_time_before – A filter that returns only processing jobs created after the specified time.

  • last_modified_time_after – A filter that returns only processing jobs modified after the specified time.

  • last_modified_time_before – A filter that returns only processing jobs modified before the specified time.

  • name_contains – A string in the processing job name. This filter returns only processing jobs whose name contains the specified string.

  • status_equals – A filter that retrieves only processing jobs with a specific status.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • next_token – If the result of the previous ListProcessingJobs request was truncated, the response includes a NextToken. To retrieve the next set of processing jobs, use the token in the next request.

  • max_results – The maximum number of processing jobs to return in the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ProcessingJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

monitoring_schedule_arn: str | PipelineVariable | None#
network_config: NetworkConfig | None#
populate_inputs_decorator()[source]#
processing_end_time: datetime | None#
processing_inputs: List[ProcessingInput] | None#
processing_job_arn: str | PipelineVariable | None#
processing_job_name: str | PipelineVariable#
processing_job_status: str | PipelineVariable | None#
processing_output_config: ProcessingOutputConfig | None#
processing_resources: ProcessingResources | None#
processing_start_time: datetime | None#
refresh() ProcessingJob | None[source]#

Refresh a ProcessingJob resource

Returns:

The ProcessingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

role_arn: str | PipelineVariable | None#
stop() None[source]#

Stop a ProcessingJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stopping_condition: ProcessingStoppingCondition | None#
training_job_arn: str | PipelineVariable | None#
wait(poll: int = 5, timeout: int | None = None, logs: bool | None = False) None[source]#

Wait for a ProcessingJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

  • logs – Whether to print logs while waiting.

Raises:
class sagemaker.core.resources.Project(*, project_name: str | PipelineVariable, project_arn: str | PipelineVariable | None = Unassigned(), project_id: str | PipelineVariable | None = Unassigned(), project_description: str | PipelineVariable | None = Unassigned(), service_catalog_provisioning_details: ServiceCatalogProvisioningDetails | None = Unassigned(), service_catalog_provisioned_product_details: ServiceCatalogProvisionedProductDetails | None = Unassigned(), project_status: str | PipelineVariable | None = Unassigned(), template_provider_details: List[TemplateProviderDetail] | None = Unassigned(), created_by: UserContext | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource Project

project_arn#

The Amazon Resource Name (ARN) of the project.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

project_name#

The name of the project.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

project_id#

The ID of the project.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

project_status#

The status of the project.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#

The time when the project was created.

Type:

datetime.datetime | None

project_description#

The description of the project.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

service_catalog_provisioning_details#

Information used to provision a service catalog product. For information, see What is Amazon Web Services Service Catalog.

Type:

sagemaker.core.shapes.shapes.ServiceCatalogProvisioningDetails | None

service_catalog_provisioned_product_details#

Information about a provisioned service catalog product.

Type:

sagemaker.core.shapes.shapes.ServiceCatalogProvisionedProductDetails | None

template_provider_details#

An array of template providers associated with the project.

Type:

List[sagemaker.core.shapes.shapes.TemplateProviderDetail] | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

The timestamp when project was last modified.

Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

classmethod create(project_name: str | PipelineVariable, project_description: str | PipelineVariable | None = Unassigned(), service_catalog_provisioning_details: ServiceCatalogProvisioningDetails | None = Unassigned(), tags: List[Tag] | None = Unassigned(), template_providers: List[CreateTemplateProvider] | None = Unassigned(), workflow_disabled: bool | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Project | None[source]#

Create a Project resource

Parameters:
  • project_name – The name of the project.

  • project_description – A description for the project.

  • service_catalog_provisioning_details – The product ID and provisioning artifact ID to provision a service catalog. The provisioning artifact ID will default to the latest provisioning artifact ID of the product, if you don’t provide the provisioning artifact ID. For more information, see What is Amazon Web Services Service Catalog.

  • tags – An array of key-value pairs that you want to use to organize and track your Amazon Web Services resource costs. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.

  • template_providers – An array of template provider configurations for creating infrastructure resources for the project.

  • workflow_disabled

  • session – Boto3 session.

  • region – Region name.

Returns:

The Project resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Project resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

classmethod get(project_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Project | None[source]#

Get a Project resource

Parameters:
  • project_name – The name of the project to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Project resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), project_status: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Project][source]#

Get all Project resources

Parameters:
  • creation_time_after – A filter that returns the projects that were created after a specified time.

  • creation_time_before – A filter that returns the projects that were created before a specified time.

  • max_results – The maximum number of projects to return in the response.

  • name_contains – A filter that returns the projects whose name contains a specified string.

  • next_token – If the result of the previous ListProjects request was truncated, the response includes a NextToken. To retrieve the next set of projects, use the token in the next request.

  • sort_by – The field by which to sort results. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • project_status

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Project resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

project_arn: str | PipelineVariable | None#
project_description: str | PipelineVariable | None#
project_id: str | PipelineVariable | None#
project_name: str | PipelineVariable#
project_status: str | PipelineVariable | None#
refresh() Project | None[source]#

Refresh a Project resource

Returns:

The Project resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

service_catalog_provisioned_product_details: ServiceCatalogProvisionedProductDetails | None#
service_catalog_provisioning_details: ServiceCatalogProvisioningDetails | None#
template_provider_details: List[TemplateProviderDetail] | None#
update(project_description: str | PipelineVariable | None = Unassigned(), service_catalog_provisioning_update_details: ServiceCatalogProvisioningUpdateDetails | None = Unassigned(), tags: List[Tag] | None = Unassigned(), template_providers_to_update: List[UpdateTemplateProvider] | None = Unassigned(), workflow_disabled: bool | None = Unassigned()) Project | None[source]#

Update a Project resource

Parameters:
  • service_catalog_provisioning_update_details – The product ID and provisioning artifact ID to provision a service catalog. The provisioning artifact ID will default to the latest provisioning artifact ID of the product, if you don’t provide the provisioning artifact ID. For more information, see What is Amazon Web Services Service Catalog.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources. In addition, the project must have tag update constraints set in order to include this parameter in the request. For more information, see Amazon Web Services Service Catalog Tag Update Constraints.

  • template_providers_to_update – The template providers to update in the project.

  • workflow_disabled

Returns:

The Project resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

wait_for_status(target_status: Literal['Pending', 'CreateInProgress', 'CreateCompleted', 'CreateFailed', 'DeleteInProgress', 'DeleteFailed', 'DeleteCompleted', 'UpdateInProgress', 'UpdateCompleted', 'UpdateFailed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Project resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.QuotaAllocation(*, quota_allocation_arn: str | PipelineVariable, quota_id: str | PipelineVariable | None = Unassigned(), quota_allocation_name: str | PipelineVariable | None = Unassigned(), quota_allocation_version: int | None = Unassigned(), quota_allocation_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), cluster_arn: str | PipelineVariable | None = Unassigned(), quota_resources: List[QuotaResourceConfig] | None = Unassigned(), over_quota: OverQuota | None = Unassigned(), preemption_config: PreemptionConfig | None = Unassigned(), activation_state: ActivationStateV1 | None = Unassigned(), quota_allocation_target: QuotaAllocationTarget | None = Unassigned(), quota_allocation_description: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource QuotaAllocation

quota_allocation_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

quota_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

quota_allocation_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

quota_allocation_version#
Type:

int | None

quota_allocation_status#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

cluster_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

quota_resources#
Type:

List[sagemaker.core.shapes.shapes.QuotaResourceConfig] | None

over_quota#
Type:

sagemaker.core.shapes.shapes.OverQuota | None

preemption_config#
Type:

sagemaker.core.shapes.shapes.PreemptionConfig | None

activation_state#
Type:

sagemaker.core.shapes.shapes.ActivationStateV1 | None

quota_allocation_target#
Type:

sagemaker.core.shapes.shapes.QuotaAllocationTarget | None

creation_time#
Type:

datetime.datetime | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

failure_reason#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

quota_allocation_description#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#
Type:

datetime.datetime | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

activation_state: ActivationStateV1 | None#
cluster_arn: str | PipelineVariable | None#
classmethod create(quota_allocation_name: str | PipelineVariable, cluster_arn: str | PipelineVariable, quota_resources: List[QuotaResourceConfig], quota_allocation_target: QuotaAllocationTarget, over_quota: OverQuota | None = Unassigned(), preemption_config: PreemptionConfig | None = Unassigned(), activation_state: ActivationStateV1 | None = Unassigned(), quota_allocation_description: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) QuotaAllocation | None[source]#

Create a QuotaAllocation resource

Parameters:
  • quota_allocation_name

  • cluster_arn

  • quota_resources

  • quota_allocation_target

  • over_quota

  • preemption_config

  • activation_state

  • quota_allocation_description

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The QuotaAllocation resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a QuotaAllocation resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

failure_reason: str | PipelineVariable | None#
classmethod get(quota_allocation_arn: str | PipelineVariable, quota_allocation_version: int | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) QuotaAllocation | None[source]#

Get a QuotaAllocation resource

Parameters:
  • quota_allocation_arn

  • quota_allocation_version

  • session – Boto3 session.

  • region – Region name.

Returns:

The QuotaAllocation resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), quota_allocation_status: str | PipelineVariable | None = Unassigned(), cluster_arn: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[QuotaAllocation][source]#

Get all QuotaAllocation resources

Parameters:
  • created_after

  • created_before

  • name_contains

  • quota_allocation_status

  • cluster_arn

  • sort_by

  • sort_order

  • next_token

  • max_results

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed QuotaAllocation resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

over_quota: OverQuota | None#
preemption_config: PreemptionConfig | None#
quota_allocation_arn: str | PipelineVariable#
quota_allocation_description: str | PipelineVariable | None#
quota_allocation_name: str | PipelineVariable | None#
quota_allocation_status: str | PipelineVariable | None#
quota_allocation_target: QuotaAllocationTarget | None#
quota_allocation_version: int | None#
quota_id: str | PipelineVariable | None#
quota_resources: List[QuotaResourceConfig] | None#
refresh() QuotaAllocation | None[source]#

Refresh a QuotaAllocation resource

Returns:

The QuotaAllocation resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

update(quota_allocation_version: int | None = Unassigned(), quota_resources: List[QuotaResourceConfig] | None = Unassigned(), over_quota: OverQuota | None = Unassigned(), preemption_config: PreemptionConfig | None = Unassigned(), activation_state: ActivationStateV1 | None = Unassigned(), quota_allocation_target: QuotaAllocationTarget | None = Unassigned(), quota_allocation_description: str | PipelineVariable | None = Unassigned()) QuotaAllocation | None[source]#

Update a QuotaAllocation resource

Returns:

The QuotaAllocation resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a QuotaAllocation resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Creating', 'CreateFailed', 'CreateRollbackFailed', 'Created', 'Updating', 'UpdateFailed', 'UpdateRollbackFailed', 'Updated', 'Deleting', 'DeleteFailed', 'DeleteRollbackFailed', 'Deleted'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a QuotaAllocation resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.ResourceCatalog(*, resource_catalog_arn: str | PipelineVariable, resource_catalog_name: str | PipelineVariable, description: str | PipelineVariable, creation_time: datetime)[source]#

Bases: Base

Class representing resource ResourceCatalog

resource_catalog_arn#

The Amazon Resource Name (ARN) of the ResourceCatalog.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

resource_catalog_name#

The name of the ResourceCatalog.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

description#

A free form description of the ResourceCatalog.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The time the ResourceCatalog was created.

Type:

datetime.datetime

creation_time: datetime#
description: str | PipelineVariable#
classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[ResourceCatalog][source]#

Get all ResourceCatalog resources

Parameters:
  • name_contains – A string that partially matches one or more ResourceCatalogs names. Filters ResourceCatalog by name.

  • creation_time_after – Use this parameter to search for ResourceCatalogs created after a specific date and time.

  • creation_time_before – Use this parameter to search for ResourceCatalogs created before a specific date and time.

  • sort_order – The order in which the resource catalogs are listed.

  • sort_by – The value on which the resource catalog list is sorted.

  • max_results – The maximum number of results returned by ListResourceCatalogs.

  • next_token – A token to resume pagination of ListResourceCatalogs results.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed ResourceCatalog resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

resource_catalog_arn: str | PipelineVariable#
resource_catalog_name: str | PipelineVariable#
class sagemaker.core.resources.SagemakerServicecatalogPortfolio[source]#

Bases: Base

Class representing resource SagemakerServicecatalogPortfolio

static disable(session: Session | None = None, region: str | None = None) None[source]#

Disables using Service Catalog in SageMaker.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

static enable(session: Session | None = None, region: str | None = None) None[source]#

Enables using Service Catalog in SageMaker.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

static get_status(session: Session | None = None, region: str | None = None) str | None[source]#

Gets the status of Service Catalog in SageMaker.

Parameters:
  • session – Boto3 session.

  • region – Region name.

Returns:

str

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class sagemaker.core.resources.SharedModel(*, shared_model_id: str | PipelineVariable, shared_model_version: str | PipelineVariable, owner: str | PipelineVariable | None = Unassigned(), creator: str | PipelineVariable | None = Unassigned(), model_artifacts: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), comments: List[CommentEntity] | None = Unassigned(), model_name: str | PipelineVariable | None = Unassigned(), origin: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource SharedModel

shared_model_id#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

shared_model_version#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

owner#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creator#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_artifacts#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

comments#
Type:

List[sagemaker.core.shapes.shapes.CommentEntity] | None

model_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

origin#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

comments: List[CommentEntity] | None#
classmethod create(reviewer_user_profiles: List[str | PipelineVariable], model_artifacts: Dict[str | PipelineVariable, str | PipelineVariable], comment: str | PipelineVariable | None = Unassigned(), model_name: str | PipelineVariable | object | None = Unassigned(), origin: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) SharedModel | None[source]#

Create a SharedModel resource

Parameters:
  • reviewer_user_profiles

  • model_artifacts

  • comment

  • model_name

  • origin

  • session – Boto3 session.

  • region – Region name.

Returns:

The SharedModel resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creator: str | PipelineVariable | None#
delete() None[source]#

Delete a SharedModel resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get(shared_model_id: str | PipelineVariable, shared_model_version: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) SharedModel | None[source]#

Get a SharedModel resource

Parameters:
  • shared_model_id

  • shared_model_version

  • session – Boto3 session.

  • region – Region name.

Returns:

The SharedModel resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[SharedModel][source]#

Get all SharedModel resources

Parameters:
  • creation_time_before

  • creation_time_after

  • sort_by

  • sort_order

  • next_token

  • max_results

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed SharedModel resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
model_artifacts: Dict[str | PipelineVariable, str | PipelineVariable] | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_name: str | PipelineVariable | None#
origin: str | PipelineVariable | None#
owner: str | PipelineVariable | None#
refresh() SharedModel | None[source]#

Refresh a SharedModel resource

Returns:

The SharedModel resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

shared_model_id: str | PipelineVariable#
shared_model_version: str | PipelineVariable#
update(shared_model_version: str | PipelineVariable | None = Unassigned(), comment: str | PipelineVariable | None = Unassigned(), model_artifacts: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), origin: str | PipelineVariable | None = Unassigned()) SharedModel | None[source]#

Update a SharedModel resource

Parameters:

comment

Returns:

The SharedModel resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

class sagemaker.core.resources.SharedModelReviewers[source]#

Bases: Base

Class representing resource SharedModelReviewers

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class sagemaker.core.resources.Space(*, domain_id: str | PipelineVariable, space_name: str | PipelineVariable, space_arn: str | PipelineVariable | None = Unassigned(), home_efs_file_system_uid: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), space_settings: SpaceSettings | None = Unassigned(), ownership_settings: OwnershipSettings | None = Unassigned(), space_sharing_settings: SpaceSharingSettings | None = Unassigned(), space_display_name: str | PipelineVariable | None = Unassigned(), url: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource Space

domain_id#

The ID of the associated domain.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

space_arn#

The space’s Amazon Resource Name (ARN).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

space_name#

The name of the space.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

home_efs_file_system_uid#

The ID of the space’s profile in the Amazon EFS volume.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

The last modified time.

Type:

datetime.datetime | None

creation_time#

The creation time.

Type:

datetime.datetime | None

failure_reason#

The failure reason.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

space_settings#

A collection of space settings.

Type:

sagemaker.core.shapes.shapes.SpaceSettings | None

ownership_settings#

The collection of ownership settings for a space.

Type:

sagemaker.core.shapes.shapes.OwnershipSettings | None

space_sharing_settings#

The collection of space sharing settings for a space.

Type:

sagemaker.core.shapes.shapes.SpaceSharingSettings | None

space_display_name#

The name of the space that appears in the Amazon SageMaker Studio UI.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

url#

Returns the URL of the space. If the space is created with Amazon Web Services IAM Identity Center (Successor to Amazon Web Services Single Sign-On) authentication, users can navigate to the URL after appending the respective redirect parameter for the application type to be federated through Amazon Web Services IAM Identity Center. The following application types are supported: Studio Classic: &amp;redirect=JupyterServer JupyterLab: &amp;redirect=JupyterLab Code Editor, based on Code-OSS, Visual Studio Code - Open Source: &amp;redirect=CodeEditor

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(domain_id: str | PipelineVariable, space_name: str | PipelineVariable, tags: List[Tag] | None = Unassigned(), space_settings: SpaceSettings | None = Unassigned(), ownership_settings: OwnershipSettings | None = Unassigned(), space_sharing_settings: SpaceSharingSettings | None = Unassigned(), space_display_name: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Space | None[source]#

Create a Space resource

Parameters:
  • domain_id – The ID of the associated domain.

  • space_name – The name of the space.

  • tags – Tags to associated with the space. Each tag consists of a key and an optional value. Tag keys must be unique for each resource. Tags are searchable using the Search API.

  • space_settings – A collection of space settings.

  • ownership_settings – A collection of ownership settings.

  • space_sharing_settings – A collection of space sharing settings.

  • space_display_name – The name of the space that appears in the SageMaker Studio UI.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Space resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a Space resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

domain_id: str | PipelineVariable#
failure_reason: str | PipelineVariable | None#
classmethod get(domain_id: str | PipelineVariable, space_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Space | None[source]#

Get a Space resource

Parameters:
  • domain_id – The ID of the associated domain.

  • space_name – The name of the space.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Space resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), domain_id_equals: str | PipelineVariable | None = Unassigned(), space_name_contains: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Space][source]#

Get all Space resources

Parameters:
  • next_token – If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

  • max_results – This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

  • sort_order – The sort order for the results. The default is Ascending.

  • sort_by – The parameter by which to sort the results. The default is CreationTime.

  • domain_id_equals – A parameter to search for the domain ID.

  • space_name_contains – A parameter by which to filter the results.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Space resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
home_efs_file_system_uid: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

ownership_settings: OwnershipSettings | None#
refresh() Space | None[source]#

Refresh a Space resource

Returns:

The Space resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

space_arn: str | PipelineVariable | None#
space_display_name: str | PipelineVariable | None#
space_name: str | PipelineVariable#
space_settings: SpaceSettings | None#
space_sharing_settings: SpaceSharingSettings | None#
status: str | PipelineVariable | None#
update(space_settings: SpaceSettings | None = Unassigned(), space_display_name: str | PipelineVariable | None = Unassigned()) Space | None[source]#

Update a Space resource

Returns:

The Space resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

url: str | PipelineVariable | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Space resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Deleting', 'Failed', 'InService', 'Pending', 'Updating', 'Update_Failed', 'Delete_Failed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Space resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.StudioLifecycleConfig(*, studio_lifecycle_config_name: str | PipelineVariable, studio_lifecycle_config_arn: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), studio_lifecycle_config_content: str | PipelineVariable | None = Unassigned(), studio_lifecycle_config_app_type: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource StudioLifecycleConfig

studio_lifecycle_config_arn#

The ARN of the Lifecycle Configuration to describe.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

studio_lifecycle_config_name#

The name of the Amazon SageMaker AI Studio Lifecycle Configuration that is described.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

creation_time#

The creation time of the Amazon SageMaker AI Studio Lifecycle Configuration.

Type:

datetime.datetime | None

last_modified_time#

This value is equivalent to CreationTime because Amazon SageMaker AI Studio Lifecycle Configurations are immutable.

Type:

datetime.datetime | None

studio_lifecycle_config_content#

The content of your Amazon SageMaker AI Studio Lifecycle Configuration script.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

studio_lifecycle_config_app_type#

The App type that the Lifecycle Configuration is attached to.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(studio_lifecycle_config_name: str | PipelineVariable, studio_lifecycle_config_content: str | PipelineVariable, studio_lifecycle_config_app_type: str | PipelineVariable, tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) StudioLifecycleConfig | None[source]#

Create a StudioLifecycleConfig resource

Parameters:
  • studio_lifecycle_config_name – The name of the Amazon SageMaker AI Studio Lifecycle Configuration to create.

  • studio_lifecycle_config_content – The content of your Amazon SageMaker AI Studio Lifecycle Configuration script. This content must be base64 encoded.

  • studio_lifecycle_config_app_type – The App type that the Lifecycle Configuration is attached to.

  • tags – Tags to be associated with the Lifecycle Configuration. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the Search API.

  • session – Boto3 session.

  • region – Region name.

Returns:

The StudioLifecycleConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a StudioLifecycleConfig resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

classmethod get(studio_lifecycle_config_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) StudioLifecycleConfig | None[source]#

Get a StudioLifecycleConfig resource

Parameters:
  • studio_lifecycle_config_name – The name of the Amazon SageMaker AI Studio Lifecycle Configuration to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The StudioLifecycleConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), app_type_equals: str | PipelineVariable | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), creation_time_after: datetime | None = Unassigned(), modified_time_before: datetime | None = Unassigned(), modified_time_after: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[StudioLifecycleConfig][source]#

Get all StudioLifecycleConfig resources

Parameters:
  • max_results – The total number of items to return in the response. If the total number of items available is more than the value specified, a NextToken is provided in the response. To resume pagination, provide the NextToken value in the as part of a subsequent call. The default value is 10.

  • next_token – If the previous call to ListStudioLifecycleConfigs didn’t return the full set of Lifecycle Configurations, the call returns a token for getting the next set of Lifecycle Configurations.

  • name_contains – A string in the Lifecycle Configuration name. This filter returns only Lifecycle Configurations whose name contains the specified string.

  • app_type_equals – A parameter to search for the App Type to which the Lifecycle Configuration is attached.

  • creation_time_before – A filter that returns only Lifecycle Configurations created on or before the specified time.

  • creation_time_after – A filter that returns only Lifecycle Configurations created on or after the specified time.

  • modified_time_before – A filter that returns only Lifecycle Configurations modified before the specified time.

  • modified_time_after – A filter that returns only Lifecycle Configurations modified after the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed StudioLifecycleConfig resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

get_name() str[source]#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() StudioLifecycleConfig | None[source]#

Refresh a StudioLifecycleConfig resource

Returns:

The StudioLifecycleConfig resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

studio_lifecycle_config_app_type: str | PipelineVariable | None#
studio_lifecycle_config_arn: str | PipelineVariable | None#
studio_lifecycle_config_content: str | PipelineVariable | None#
studio_lifecycle_config_name: str | PipelineVariable#
class sagemaker.core.resources.SubscribedWorkteam(*, workteam_arn: str | PipelineVariable, subscribed_workteam: SubscribedWorkteam | None = Unassigned())[source]#

Bases: Base

Class representing resource SubscribedWorkteam

subscribed_workteam#

A Workteam instance that contains information about the work team.

Type:

sagemaker.core.shapes.shapes.SubscribedWorkteam | None

classmethod get(workteam_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) SubscribedWorkteam | None[source]#

Get a SubscribedWorkteam resource

Parameters:
  • workteam_arn – The Amazon Resource Name (ARN) of the subscribed work team to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The SubscribedWorkteam resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(name_contains: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[SubscribedWorkteam][source]#

Get all SubscribedWorkteam resources

Parameters:
  • name_contains – A string in the work team name. This filter returns only work teams whose name contains the specified string.

  • next_token – If the result of the previous ListSubscribedWorkteams request was truncated, the response includes a NextToken. To retrieve the next set of labeling jobs, use the token in the next request.

  • max_results – The maximum number of work teams to return in each page of the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed SubscribedWorkteam resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() SubscribedWorkteam | None[source]#

Refresh a SubscribedWorkteam resource

Returns:

The SubscribedWorkteam resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

subscribed_workteam: SubscribedWorkteam | None#
workteam_arn: str | PipelineVariable#
class sagemaker.core.resources.Tag(*, key: str | PipelineVariable, value: str | PipelineVariable)[source]#

Bases: Base

Class representing resource Tag

key#

The tag key. Tag keys must be unique per resource.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

value#

The tag value.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

classmethod add_tags(resource_arn: str | PipelineVariable, tags: List[Tag], session: Session | None = None, region: str | None = None) None[source]#

Adds or overwrites one or more tags for the specified SageMaker resource.

Parameters:
  • resource_arn – The Amazon Resource Name (ARN) of the resource that you want to tag.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod delete_tags(resource_arn: str | PipelineVariable, tag_keys: List[str | PipelineVariable], session: Session | None = None, region: str | None = None) None[source]#

Deletes the specified tags from an SageMaker resource.

Parameters:
  • resource_arn – The Amazon Resource Name (ARN) of the resource whose tags you want to delete.

  • tag_keys – An array or one or more tag keys to delete.

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(resource_arn: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Tag][source]#

Get all Tag resources

Parameters:
  • resource_arn – The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve.

  • next_token – If the response to the previous ListTags request is truncated, SageMaker returns this token. To retrieve the next set of tags, use it in the subsequent request.

  • max_results – Maximum number of tags to return.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Tag resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
key: str | PipelineVariable#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: str | PipelineVariable#
class sagemaker.core.resources.TrainingJob(*, training_job_name: str | PipelineVariable, training_job_arn: str | PipelineVariable | None = Unassigned(), processing_job_arn: str | PipelineVariable | None = Unassigned(), tuning_job_arn: str | PipelineVariable | None = Unassigned(), labeling_job_arn: str | PipelineVariable | None = Unassigned(), auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), model_artifacts: ModelArtifacts | None = Unassigned(), training_job_output: TrainingJobOutput | None = Unassigned(), training_job_status: str | PipelineVariable | None = Unassigned(), secondary_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), hyper_parameters: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), algorithm_specification: AlgorithmSpecification | None = Unassigned(), role_arn: str | PipelineVariable | None = Unassigned(), input_data_config: List[Channel] | None = Unassigned(), output_data_config: OutputDataConfig | None = Unassigned(), resource_config: ResourceConfig | None = Unassigned(), warm_pool_status: WarmPoolStatus | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), stopping_condition: StoppingCondition | None = Unassigned(), creation_time: datetime | None = Unassigned(), training_start_time: datetime | None = Unassigned(), training_end_time: datetime | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), secondary_status_transitions: List[SecondaryStatusTransition] | None = Unassigned(), final_metric_data_list: List[MetricData] | None = Unassigned(), enable_network_isolation: bool | None = Unassigned(), enable_inter_container_traffic_encryption: bool | None = Unassigned(), enable_managed_spot_training: bool | None = Unassigned(), checkpoint_config: CheckpointConfig | None = Unassigned(), training_time_in_seconds: int | None = Unassigned(), billable_time_in_seconds: int | None = Unassigned(), billable_token_count: int | None = Unassigned(), debug_hook_config: DebugHookConfig | None = Unassigned(), experiment_config: ExperimentConfig | None = Unassigned(), debug_rule_configurations: List[DebugRuleConfiguration] | None = Unassigned(), tensor_board_output_config: TensorBoardOutputConfig | None = Unassigned(), debug_rule_evaluation_statuses: List[DebugRuleEvaluationStatus] | None = Unassigned(), upstream_platform_config: UpstreamPlatformConfig | None = Unassigned(), profiler_config: ProfilerConfig | None = Unassigned(), profiler_rule_configurations: List[ProfilerRuleConfiguration] | None = Unassigned(), profiler_rule_evaluation_statuses: List[ProfilerRuleEvaluationStatus] | None = Unassigned(), profiling_status: str | PipelineVariable | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), retry_strategy: RetryStrategy | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), created_by: UserContext | None = Unassigned(), disable_efa: bool | None = Unassigned(), processing_job_config: ProcessingJobConfig | None = Unassigned(), image_metadata: ImageMetadata | None = Unassigned(), remote_debug_config: RemoteDebugConfig | None = Unassigned(), resource_tags: ResourceTags | None = Unassigned(), infra_check_config: InfraCheckConfig | None = Unassigned(), serverless_job_config: ServerlessJobConfig | None = Unassigned(), mlflow_config: MlflowConfig | None = Unassigned(), model_package_config: ModelPackageConfig | None = Unassigned(), mlflow_details: MlflowDetails | None = Unassigned(), progress_info: TrainingProgressInfo | None = Unassigned(), output_model_package_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource TrainingJob

training_job_name#

Name of the model training job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

training_job_arn#

The Amazon Resource Name (ARN) of the training job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_artifacts#

Information about the Amazon S3 location that is configured for storing model artifacts.

Type:

sagemaker.core.shapes.shapes.ModelArtifacts | None

training_job_status#

The status of the training job. SageMaker provides the following training job statuses: InProgress - The training is in progress. Completed - The training job has completed. Failed - The training job has failed. To see the reason for the failure, see the FailureReason field in the response to a DescribeTrainingJobResponse call. Stopping - The training job is stopping. Stopped - The training job has stopped. For more detailed information, see SecondaryStatus.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

secondary_status#

Provides detailed information about the state of the training job. For detailed information on the secondary status of the training job, see StatusMessage under SecondaryStatusTransition. SageMaker provides primary statuses and secondary statuses that apply to each of them: InProgress Starting - Starting the training job. Downloading - An optional stage for algorithms that support File training input mode. It indicates that data is being downloaded to the ML storage volumes. Training - Training is in progress. Interrupted - The job stopped because the managed spot training instances were interrupted. Uploading - Training is complete and the model artifacts are being uploaded to the S3 location. Completed Completed - The training job has completed. Failed Failed - The training job has failed. The reason for the failure is returned in the FailureReason field of DescribeTrainingJobResponse. Stopped MaxRuntimeExceeded - The job stopped because it exceeded the maximum allowed runtime. MaxWaitTimeExceeded - The job stopped because it exceeded the maximum allowed wait time. Stopped - The training job has stopped. Stopping Stopping - Stopping the training job. Valid values for SecondaryStatus are subject to change. We no longer support the following secondary statuses: LaunchingMLInstances PreparingTraining DownloadingTrainingImage

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

stopping_condition#

Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs. To stop a job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.

Type:

sagemaker.core.shapes.shapes.StoppingCondition | None

creation_time#

A timestamp that indicates when the training job was created.

Type:

datetime.datetime | None

processing_job_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

tuning_job_arn#

The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

labeling_job_arn#

The Amazon Resource Name (ARN) of the SageMaker Ground Truth labeling job that created the transform or training job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_arn#

The Amazon Resource Name (ARN) of an AutoML job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

training_job_output#

Information about the S3 location that is configured for storing optional output.

Type:

sagemaker.core.shapes.shapes.TrainingJobOutput | None

failure_reason#

If the training job failed, the reason it failed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

hyper_parameters#

Algorithm-specific parameters.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

algorithm_specification#

Information about the algorithm used for training, and algorithm metadata.

Type:

sagemaker.core.shapes.shapes.AlgorithmSpecification | None

role_arn#

The Amazon Web Services Identity and Access Management (IAM) role configured for the training job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

input_data_config#

An array of Channel objects that describes each data input channel.

Type:

List[sagemaker.core.shapes.shapes.Channel] | None

output_data_config#

The S3 path where model artifacts that you configured when creating the job are stored. SageMaker creates subfolders for model artifacts.

Type:

sagemaker.core.shapes.shapes.OutputDataConfig | None

resource_config#

Resources, including ML compute instances and ML storage volumes, that are configured for model training.

Type:

sagemaker.core.shapes.shapes.ResourceConfig | None

warm_pool_status#

The status of the warm pool associated with the training job.

Type:

sagemaker.core.shapes.shapes.WarmPoolStatus | None

vpc_config#

A VpcConfig object that specifies the VPC that this training job has access to. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

Type:

sagemaker.core.shapes.shapes.VpcConfig | None

training_start_time#

Indicates the time when the training job starts on training instances. You are billed for the time interval between this time and the value of TrainingEndTime. The start time in CloudWatch Logs might be later than this time. The difference is due to the time it takes to download the training data and to the size of the training container.

Type:

datetime.datetime | None

training_end_time#

Indicates the time when the training job ends on training instances. You are billed for the time interval between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time when SageMaker detects a job failure.

Type:

datetime.datetime | None

last_modified_time#

A timestamp that indicates when the status of the training job was last modified.

Type:

datetime.datetime | None

secondary_status_transitions#

A history of all of the secondary statuses that the training job has transitioned through.

Type:

List[sagemaker.core.shapes.shapes.SecondaryStatusTransition] | None

final_metric_data_list#

A collection of MetricData objects that specify the names, values, and dates and times that the training algorithm emitted to Amazon CloudWatch.

Type:

List[sagemaker.core.shapes.shapes.MetricData] | None

enable_network_isolation#

If you want to allow inbound or outbound network calls, except for calls between peers within a training cluster for distributed training, choose True. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

Type:

bool | None

enable_inter_container_traffic_encryption#

To encrypt all communications between ML compute instances in distributed training, choose True. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithms in distributed training.

Type:

bool | None

enable_managed_spot_training#

A Boolean indicating whether managed spot training is enabled (True) or not (False).

Type:

bool | None

checkpoint_config#
Type:

sagemaker.core.shapes.shapes.CheckpointConfig | None

training_time_in_seconds#

The training time in seconds.

Type:

int | None

billable_time_in_seconds#

The billable time in seconds. Billable time refers to the absolute wall-clock time. Multiply BillableTimeInSeconds by the number of instances (InstanceCount) in your training cluster to get the total compute time SageMaker bills you if you run distributed training. The formula is as follows: BillableTimeInSeconds * InstanceCount . You can calculate the savings from using managed spot training using the formula (1 - BillableTimeInSeconds / TrainingTimeInSeconds) * 100. For example, if BillableTimeInSeconds is 100 and TrainingTimeInSeconds is 500, the savings is 80%.

Type:

int | None

billable_token_count#
Type:

int | None

debug_hook_config#
Type:

sagemaker.core.shapes.shapes.DebugHookConfig | None

experiment_config#
Type:

sagemaker.core.shapes.shapes.ExperimentConfig | None

debug_rule_configurations#

Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.

Type:

List[sagemaker.core.shapes.shapes.DebugRuleConfiguration] | None

tensor_board_output_config#
Type:

sagemaker.core.shapes.shapes.TensorBoardOutputConfig | None

debug_rule_evaluation_statuses#

Evaluation status of Amazon SageMaker Debugger rules for debugging on a training job.

Type:

List[sagemaker.core.shapes.shapes.DebugRuleEvaluationStatus] | None

upstream_platform_config#
Type:

sagemaker.core.shapes.shapes.UpstreamPlatformConfig | None

profiler_config#
Type:

sagemaker.core.shapes.shapes.ProfilerConfig | None

profiler_rule_configurations#

Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.

Type:

List[sagemaker.core.shapes.shapes.ProfilerRuleConfiguration] | None

profiler_rule_evaluation_statuses#

Evaluation status of Amazon SageMaker Debugger rules for profiling on a training job.

Type:

List[sagemaker.core.shapes.shapes.ProfilerRuleEvaluationStatus] | None

profiling_status#

Profiling status of a training job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

environment#

The environment variables to set in the Docker container. Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

retry_strategy#

The number of times to retry the job when the job fails due to an InternalServerError.

Type:

sagemaker.core.shapes.shapes.RetryStrategy | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

disable_efa#
Type:

bool | None

processing_job_config#
Type:

sagemaker.core.shapes.shapes.ProcessingJobConfig | None

image_metadata#
Type:

sagemaker.core.shapes.shapes.ImageMetadata | None

remote_debug_config#

Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging.

Type:

sagemaker.core.shapes.shapes.RemoteDebugConfig | None

resource_tags#
Type:

sagemaker.core.shapes.shapes.ResourceTags | None

infra_check_config#

Contains information about the infrastructure health check configuration for the training job.

Type:

sagemaker.core.shapes.shapes.InfraCheckConfig | None

serverless_job_config#
Type:

sagemaker.core.shapes.shapes.ServerlessJobConfig | None

mlflow_config#
Type:

sagemaker.core.shapes.shapes.MlflowConfig | None

model_package_config#
Type:

sagemaker.core.shapes.shapes.ModelPackageConfig | None

mlflow_details#
Type:

sagemaker.core.shapes.shapes.MlflowDetails | None

progress_info#
Type:

sagemaker.core.shapes.shapes.TrainingProgressInfo | None

output_model_package_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

algorithm_specification: AlgorithmSpecification | None#
auto_ml_job_arn: str | PipelineVariable | None#
billable_time_in_seconds: int | None#
billable_token_count: int | None#
checkpoint_config: CheckpointConfig | None#
classmethod create(training_job_name: str | PipelineVariable, role_arn: str | PipelineVariable, output_data_config: OutputDataConfig, hyper_parameters: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), algorithm_specification: AlgorithmSpecification | None = Unassigned(), chained_customer_role_arn: str | PipelineVariable | None = Unassigned(), input_data_config: List[Channel] | None = Unassigned(), resource_config: ResourceConfig | None = Unassigned(), vpc_config: VpcConfig | None = Unassigned(), stopping_condition: StoppingCondition | None = Unassigned(), tags: List[Tag] | None = Unassigned(), resource_tags: ResourceTags | None = Unassigned(), enable_network_isolation: bool | None = Unassigned(), enable_inter_container_traffic_encryption: bool | None = Unassigned(), enable_managed_spot_training: bool | None = Unassigned(), checkpoint_config: CheckpointConfig | None = Unassigned(), debug_hook_config: DebugHookConfig | None = Unassigned(), debug_rule_configurations: List[DebugRuleConfiguration] | None = Unassigned(), tensor_board_output_config: TensorBoardOutputConfig | None = Unassigned(), experiment_config: ExperimentConfig | None = Unassigned(), upstream_platform_config: UpstreamPlatformConfig | None = Unassigned(), profiler_config: ProfilerConfig | None = Unassigned(), profiler_rule_configurations: List[ProfilerRuleConfiguration] | None = Unassigned(), disable_efa: bool | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), retry_strategy: RetryStrategy | None = Unassigned(), upstream_assume_role_source_arn: str | PipelineVariable | None = Unassigned(), upstream_assume_role_source_account: str | PipelineVariable | None = Unassigned(), on_hold_cluster_id: str | PipelineVariable | None = Unassigned(), target_compute_cell_account_id: str | PipelineVariable | None = Unassigned(), training_job_arn: str | PipelineVariable | None = Unassigned(), remote_debug_config: RemoteDebugConfig | None = Unassigned(), infra_check_config: InfraCheckConfig | None = Unassigned(), session_chaining_config: SessionChainingConfig | None = Unassigned(), serverless_job_config: ServerlessJobConfig | None = Unassigned(), mlflow_config: MlflowConfig | None = Unassigned(), with_warm_pool_validation_error: bool | None = Unassigned(), model_package_config: ModelPackageConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) TrainingJob | None[source]#

Create a TrainingJob resource

Parameters:
  • training_job_name – The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.

  • role_arn – The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see SageMaker Roles. To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole permission.

  • output_data_config – Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates subfolders for the artifacts.

  • hyper_parameters – Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see Algorithms. You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the Length Constraint. Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request hyperparameter variable or plain text fields.

  • algorithm_specification – The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by SageMaker, see Algorithms. For information about providing your own algorithms, see Using Your Own Algorithms with Amazon SageMaker.

  • chained_customer_role_arn

  • input_data_config – An array of Channel objects. Each channel is a named input source. InputDataConfig describes the input data and its location. Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, training_data and validation_data. The configuration for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format. Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you specify an EFS location, input data files are available as input streams. They do not need to be downloaded. Your input must be in the same Amazon Web Services region as your training job.

  • resource_config – The resources, including the ML compute instances and ML storage volumes, to use for model training. ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

  • vpc_config – A VpcConfig object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

  • stopping_condition – Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs. To stop a job, SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.

  • tags – An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources. Do not include any security-sensitive information including account access IDs, secrets, or tokens in any tags. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by any security-sensitive information included in the request tag variable or plain text fields.

  • resource_tags

  • enable_network_isolation – Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

  • enable_inter_container_traffic_encryption – To encrypt all communications between ML compute instances in distributed training, choose True. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training. For more information, see Protect Communications Between ML Compute Instances in a Distributed Training Job.

  • enable_managed_spot_training – To train models using managed spot training, choose True. Managed spot training provides a fully managed and scalable infrastructure for training machine learning models. this option is useful when training jobs can be interrupted and when there is flexibility when the training job is run. The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed.

  • checkpoint_config – Contains information about the output location for managed spot training checkpoint data.

  • debug_hook_config

  • debug_rule_configurations – Configuration information for Amazon SageMaker Debugger rules for debugging output tensors.

  • tensor_board_output_config

  • experiment_config

  • upstream_platform_config

  • profiler_config

  • profiler_rule_configurations – Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics.

  • disable_efa

  • environment – The environment variables to set in the Docker container. Do not include any security-sensitive information including account access IDs, secrets, or tokens in any environment fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request environment variable or plain text fields.

  • retry_strategy – The number of times to retry the job when the job fails due to an InternalServerError.

  • upstream_assume_role_source_arn

  • upstream_assume_role_source_account

  • on_hold_cluster_id

  • target_compute_cell_account_id

  • training_job_arn

  • remote_debug_config – Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see Access a training container through Amazon Web Services Systems Manager (SSM) for remote debugging.

  • infra_check_config – Contains information about the infrastructure health check configuration for the training job.

  • session_chaining_config – Contains information about attribute-based access control (ABAC) for the training job.

  • serverless_job_config

  • mlflow_config

  • with_warm_pool_validation_error

  • model_package_config

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrainingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
debug_hook_config: DebugHookConfig | None#
debug_rule_configurations: List[DebugRuleConfiguration] | None#
debug_rule_evaluation_statuses: List[DebugRuleEvaluationStatus] | None#
delete() None[source]#

Delete a TrainingJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

disable_efa: bool | None#
enable_inter_container_traffic_encryption: bool | None#
enable_managed_spot_training: bool | None#
enable_network_isolation: bool | None#
environment: Dict[str | PipelineVariable, str | PipelineVariable] | None#
experiment_config: ExperimentConfig | None#
failure_reason: str | PipelineVariable | None#
final_metric_data_list: List[MetricData] | None#
classmethod get(training_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) TrainingJob | None[source]#

Get a TrainingJob resource

Parameters:
  • training_job_name – The name of the training job.

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrainingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), warm_pool_status_equals: str | PipelineVariable | None = Unassigned(), training_plan_arn_equals: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[TrainingJob][source]#

Get all TrainingJob resources

Parameters:
  • next_token – If the result of the previous ListTrainingJobs request was truncated, the response includes a NextToken. To retrieve the next set of training jobs, use the token in the next request.

  • max_results – The maximum number of training jobs to return in the response.

  • creation_time_after – A filter that returns only training jobs created after the specified time (timestamp).

  • creation_time_before – A filter that returns only training jobs created before the specified time (timestamp).

  • last_modified_time_after – A filter that returns only training jobs modified after the specified time (timestamp).

  • last_modified_time_before – A filter that returns only training jobs modified before the specified time (timestamp).

  • name_contains – A string in the training job name. This filter returns only training jobs whose name contains the specified string.

  • status_equals – A filter that retrieves only training jobs with a specific status.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • warm_pool_status_equals – A filter that retrieves only training jobs with a specific warm pool status.

  • training_plan_arn_equals – The Amazon Resource Name (ARN); of the training plan to filter training jobs by. For more information about reserving GPU capacity for your SageMaker training jobs using Amazon SageMaker Training Plan, see CreateTrainingPlan .

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed TrainingJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
hyper_parameters: Dict[str | PipelineVariable, str | PipelineVariable] | None#
image_metadata: ImageMetadata | None#
infra_check_config: InfraCheckConfig | None#
input_data_config: List[Channel] | None#
labeling_job_arn: str | PipelineVariable | None#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
mlflow_config: MlflowConfig | None#
mlflow_details: MlflowDetails | None#
model_artifacts: ModelArtifacts | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_package_config: ModelPackageConfig | None#
output_data_config: OutputDataConfig | None#
output_model_package_arn: str | PipelineVariable | None#
populate_inputs_decorator()[source]#
processing_job_arn: str | PipelineVariable | None#
processing_job_config: ProcessingJobConfig | None#
profiler_config: ProfilerConfig | None#
profiler_rule_configurations: List[ProfilerRuleConfiguration] | None#
profiler_rule_evaluation_statuses: List[ProfilerRuleEvaluationStatus] | None#
profiling_status: str | PipelineVariable | None#
progress_info: TrainingProgressInfo | None#
refresh() TrainingJob | None[source]#

Refresh a TrainingJob resource

Returns:

The TrainingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

remote_debug_config: RemoteDebugConfig | None#
resource_config: ResourceConfig | None#
resource_tags: ResourceTags | None#
retry_strategy: RetryStrategy | None#
role_arn: str | PipelineVariable | None#
secondary_status: str | PipelineVariable | None#
secondary_status_transitions: List[SecondaryStatusTransition] | None#
serverless_job_config: ServerlessJobConfig | None#
stop() None[source]#

Stop a TrainingJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stopping_condition: StoppingCondition | None#
tensor_board_output_config: TensorBoardOutputConfig | None#
training_end_time: datetime | None#
training_job_arn: str | PipelineVariable | None#
training_job_name: str | PipelineVariable#
training_job_output: TrainingJobOutput | None#
training_job_status: str | PipelineVariable | None#
training_start_time: datetime | None#
training_time_in_seconds: int | None#
tuning_job_arn: str | PipelineVariable | None#
update(profiler_config: ProfilerConfigForUpdate | None = Unassigned(), profiler_rule_configurations: List[ProfilerRuleConfiguration] | None = Unassigned(), resource_config: ResourceConfigForUpdate | None = Unassigned(), remote_debug_config: RemoteDebugConfigForUpdate | None = Unassigned()) TrainingJob | None[source]#

Update a TrainingJob resource

Returns:

The TrainingJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

upstream_platform_config: UpstreamPlatformConfig | None#
vpc_config: VpcConfig | None#
wait(poll: int = 5, timeout: int | None = None, logs: bool | None = False) None[source]#

Wait for a TrainingJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

  • logs – Whether to print logs while waiting.

Raises:
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a TrainingJob resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

warm_pool_status: WarmPoolStatus | None#
class sagemaker.core.resources.TrainingPlan(*, training_plan_name: str | PipelineVariable, training_plan_arn: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), status_message: str | PipelineVariable | None = Unassigned(), duration_hours: int | None = Unassigned(), duration_minutes: int | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), upfront_fee: str | PipelineVariable | None = Unassigned(), currency_code: str | PipelineVariable | None = Unassigned(), total_instance_count: int | None = Unassigned(), available_instance_count: int | None = Unassigned(), in_use_instance_count: int | None = Unassigned(), unhealthy_instance_count: int | None = Unassigned(), available_spare_instance_count: int | None = Unassigned(), total_ultra_server_count: int | None = Unassigned(), target_resources: List[str | PipelineVariable] | None = Unassigned(), reserved_capacity_summaries: List[ReservedCapacitySummary] | None = Unassigned(), training_plan_status_transitions: List[TrainingPlanStatusTransition] | None = Unassigned())[source]#

Bases: Base

Class representing resource TrainingPlan

training_plan_arn#

The Amazon Resource Name (ARN); of the training plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

training_plan_name#

The name of the training plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

status#

The current status of the training plan (e.g., Pending, Active, Expired). To see the complete list of status values available for a training plan, refer to the Status attribute within the TrainingPlanSummary object.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status_message#

A message providing additional information about the current status of the training plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

duration_hours#

The number of whole hours in the total duration for this training plan.

Type:

int | None

duration_minutes#

The additional minutes beyond whole hours in the total duration for this training plan.

Type:

int | None

start_time#

The start time of the training plan.

Type:

datetime.datetime | None

end_time#

The end time of the training plan.

Type:

datetime.datetime | None

upfront_fee#

The upfront fee for the training plan.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

currency_code#

The currency code for the upfront fee (e.g., USD).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

total_instance_count#

The total number of instances reserved in this training plan.

Type:

int | None

available_instance_count#

The number of instances currently available for use in this training plan.

Type:

int | None

in_use_instance_count#

The number of instances currently in use from this training plan.

Type:

int | None

unhealthy_instance_count#

The number of instances in the training plan that are currently in an unhealthy state.

Type:

int | None

available_spare_instance_count#

The number of available spare instances in the training plan.

Type:

int | None

total_ultra_server_count#

The total number of UltraServers reserved to this training plan.

Type:

int | None

target_resources#

The target resources (e.g., SageMaker Training Jobs, SageMaker HyperPod) that can use this training plan. Training plans are specific to their target resource. A training plan designed for SageMaker training jobs can only be used to schedule and run training jobs. A training plan for HyperPod clusters can be used exclusively to provide compute resources to a cluster’s instance group.

Type:

List[str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

reserved_capacity_summaries#

The list of Reserved Capacity providing the underlying compute resources of the plan.

Type:

List[sagemaker.core.shapes.shapes.ReservedCapacitySummary] | None

training_plan_status_transitions#
Type:

List[sagemaker.core.shapes.shapes.TrainingPlanStatusTransition] | None

available_instance_count: int | None#
available_spare_instance_count: int | None#
classmethod create(training_plan_name: str | PipelineVariable, training_plan_offering_id: str | PipelineVariable, spare_instance_count_per_ultra_server: int | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) TrainingPlan | None[source]#

Create a TrainingPlan resource

Parameters:
  • training_plan_name – The name of the training plan to create.

  • training_plan_offering_id – The unique identifier of the training plan offering to use for creating this plan.

  • spare_instance_count_per_ultra_server – Number of spare instances to reserve per UltraServer for enhanced resiliency. Default is 1.

  • tags – An array of key-value pairs to apply to this training plan.

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrainingPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

currency_code: str | PipelineVariable | None#
duration_hours: int | None#
duration_minutes: int | None#
end_time: datetime | None#
classmethod get(training_plan_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) TrainingPlan | None[source]#

Get a TrainingPlan resource

Parameters:
  • training_plan_name – The name of the training plan to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrainingPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(start_time_after: datetime | None = Unassigned(), start_time_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), filters: List[TrainingPlanFilter] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[TrainingPlan][source]#

Get all TrainingPlan resources

Parameters:
  • next_token – A token to continue pagination if more results are available.

  • max_results – The maximum number of results to return in the response.

  • start_time_after – Filter to list only training plans with an actual start time after this date.

  • start_time_before – Filter to list only training plans with an actual start time before this date.

  • sort_by – The training plan field to sort the results by (e.g., StartTime, Status).

  • sort_order – The order to sort the results (Ascending or Descending).

  • filters – Additional filters to apply to the list of training plans.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed TrainingPlan resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
in_use_instance_count: int | None#
classmethod load(training_plan_arn: str | PipelineVariable, capacity_resource_arn: str | PipelineVariable, target_resources: List[str | PipelineVariable], session: Session | None = None, region: str | PipelineVariable | None = None) TrainingPlan | None[source]#

Import a TrainingPlan resource

Parameters:
  • training_plan_arn

  • capacity_resource_arn

  • target_resources

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrainingPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceAlreadyExists

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() TrainingPlan | None[source]#

Refresh a TrainingPlan resource

Returns:

The TrainingPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

reserved_capacity_summaries: List[ReservedCapacitySummary] | None#
start_time: datetime | None#
status: str | PipelineVariable | None#
status_message: str | PipelineVariable | None#
stop() None[source]#

Stop a TrainingPlan resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

target_resources: List[str | PipelineVariable] | None#
total_instance_count: int | None#
total_ultra_server_count: int | None#
training_plan_arn: str | PipelineVariable | None#
training_plan_name: str | PipelineVariable#
training_plan_status_transitions: List[TrainingPlanStatusTransition] | None#
unhealthy_instance_count: int | None#
update(max_wait_time_in_seconds: int | None = Unassigned(), requested_start_time: datetime | None = Unassigned(), requested_end_time: datetime | None = Unassigned(), instance_count: int | None = Unassigned()) TrainingPlan | None[source]#

Update a TrainingPlan resource

Parameters:
  • max_wait_time_in_seconds

  • requested_start_time

  • requested_end_time

  • instance_count

Returns:

The TrainingPlan resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

upfront_fee: str | PipelineVariable | None#
wait_for_status(target_status: Literal['Pending', 'Active', 'Scheduled', 'Expired', 'Failed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a TrainingPlan resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.TransformJob(*, transform_job_name: str | PipelineVariable, transform_job_arn: str | PipelineVariable | None = Unassigned(), transform_job_status: str | PipelineVariable | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), model_name: str | PipelineVariable | None = Unassigned(), max_concurrent_transforms: int | None = Unassigned(), model_client_config: ModelClientConfig | None = Unassigned(), max_payload_in_mb: int | None = Unassigned(), batch_strategy: str | PipelineVariable | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), transform_input: TransformInput | None = Unassigned(), transform_output: TransformOutput | None = Unassigned(), data_capture_config: BatchDataCaptureConfig | None = Unassigned(), transform_resources: TransformResources | None = Unassigned(), creation_time: datetime | None = Unassigned(), transform_start_time: datetime | None = Unassigned(), transform_end_time: datetime | None = Unassigned(), labeling_job_arn: str | PipelineVariable | None = Unassigned(), auto_ml_job_arn: str | PipelineVariable | None = Unassigned(), transform_job_progress: TransformJobProgress | None = Unassigned(), data_processing: DataProcessing | None = Unassigned(), experiment_config: ExperimentConfig | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), created_by: UserContext | None = Unassigned())[source]#

Bases: Base

Class representing resource TransformJob

transform_job_name#

The name of the transform job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

transform_job_arn#

The Amazon Resource Name (ARN) of the transform job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

transform_job_status#

The status of the transform job. If the transform job failed, the reason is returned in the FailureReason field.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

model_name#

The name of the model used in the transform job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

transform_input#

Describes the dataset to be transformed and the Amazon S3 location where it is stored.

Type:

sagemaker.core.shapes.shapes.TransformInput | None

transform_resources#

Describes the resources, including ML instance types and ML instance count, to use for the transform job.

Type:

sagemaker.core.shapes.shapes.TransformResources | None

creation_time#

A timestamp that shows when the transform Job was created.

Type:

datetime.datetime | None

failure_reason#

If the transform job failed, FailureReason describes why it failed. A transform job creates a log file, which includes error messages, and stores it as an Amazon S3 object. For more information, see Log Amazon SageMaker Events with Amazon CloudWatch.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

max_concurrent_transforms#

The maximum number of parallel requests on each instance node that can be launched in a transform job. The default value is 1.

Type:

int | None

model_client_config#

The timeout and maximum number of retries for processing a transform job invocation.

Type:

sagemaker.core.shapes.shapes.ModelClientConfig | None

max_payload_in_mb#

The maximum payload size, in MB, used in the transform job.

Type:

int | None

batch_strategy#

Specifies the number of records to include in a mini-batch for an HTTP inference request. A record is a single unit of input data that inference can be made on. For example, a single line in a CSV file is a record. To enable the batch strategy, you must set SplitType to Line, RecordIO, or TFRecord.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

environment#

The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, str | sagemaker.core.helper.pipeline_variable.PipelineVariable] | None

transform_output#

Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job.

Type:

sagemaker.core.shapes.shapes.TransformOutput | None

data_capture_config#

Configuration to control how SageMaker captures inference data.

Type:

sagemaker.core.shapes.shapes.BatchDataCaptureConfig | None

transform_start_time#

Indicates when the transform job starts on ML instances. You are billed for the time interval between this time and the value of TransformEndTime.

Type:

datetime.datetime | None

transform_end_time#

Indicates when the transform job has been completed, or has stopped or failed. You are billed for the time interval between this time and the value of TransformStartTime.

Type:

datetime.datetime | None

labeling_job_arn#

The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling job that created the transform or training job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

auto_ml_job_arn#

The Amazon Resource Name (ARN) of the AutoML transform job.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

transform_job_progress#
Type:

sagemaker.core.shapes.shapes.TransformJobProgress | None

data_processing#
Type:

sagemaker.core.shapes.shapes.DataProcessing | None

experiment_config#
Type:

sagemaker.core.shapes.shapes.ExperimentConfig | None

last_modified_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

created_by#
Type:

sagemaker.core.shapes.shapes.UserContext | None

auto_ml_job_arn: str | PipelineVariable | None#
batch_strategy: str | PipelineVariable | None#
classmethod create(transform_job_name: str | PipelineVariable, model_name: str | PipelineVariable | object, transform_input: TransformInput, transform_output: TransformOutput, transform_resources: TransformResources, max_concurrent_transforms: int | None = Unassigned(), model_client_config: ModelClientConfig | None = Unassigned(), max_payload_in_mb: int | None = Unassigned(), batch_strategy: str | PipelineVariable | None = Unassigned(), environment: Dict[str | PipelineVariable, str | PipelineVariable] | None = Unassigned(), data_capture_config: BatchDataCaptureConfig | None = Unassigned(), data_processing: DataProcessing | None = Unassigned(), tags: List[Tag] | None = Unassigned(), platform_credential_token: str | PipelineVariable | None = Unassigned(), customer_credential_token: str | PipelineVariable | None = Unassigned(), data_access_credential_token: str | PipelineVariable | None = Unassigned(), data_access_vpc_config: VpcConfig | None = Unassigned(), credential_provider_function: str | PipelineVariable | None = Unassigned(), credential_provider_encryption_key: str | PipelineVariable | None = Unassigned(), experiment_config: ExperimentConfig | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) TransformJob | None[source]#

Create a TransformJob resource

Parameters:
  • transform_job_name – The name of the transform job. The name must be unique within an Amazon Web Services Region in an Amazon Web Services account.

  • model_name – The name of the model that you want to use for the transform job. ModelName must be the name of an existing Amazon SageMaker model within an Amazon Web Services Region in an Amazon Web Services account.

  • transform_input – Describes the input source and the way the transform job consumes it.

  • transform_output – Describes the results of the transform job.

  • transform_resources – Describes the resources, including ML instance types and ML instance count, to use for the transform job.

  • max_concurrent_transforms – The maximum number of parallel requests that can be sent to each instance in a transform job. If MaxConcurrentTransforms is set to 0 or left unset, Amazon SageMaker checks the optional execution-parameters to determine the settings for your chosen algorithm. If the execution-parameters endpoint is not enabled, the default value is 1. For more information on execution-parameters, see How Containers Serve Requests. For built-in algorithms, you don’t need to set a value for MaxConcurrentTransforms.

  • model_client_config – Configures the timeout and maximum number of retries for processing a transform job invocation.

  • max_payload_in_mb – The maximum allowed size of the payload, in MB. A payload is the data portion of a record (without metadata). The value in MaxPayloadInMB must be greater than, or equal to, the size of a single record. To estimate the size of a record in MB, divide the size of your dataset by the number of records. To ensure that the records fit within the maximum payload size, we recommend using a slightly larger value. The default value is 6 MB. The value of MaxPayloadInMB cannot be greater than 100 MB. If you specify the MaxConcurrentTransforms parameter, the value of (MaxConcurrentTransforms * MaxPayloadInMB) also cannot exceed 100 MB. For cases where the payload might be arbitrarily large and is transmitted using HTTP chunked encoding, set the value to 0. This feature works only in supported algorithms. Currently, Amazon SageMaker built-in algorithms do not support HTTP chunked encoding.

  • batch_strategy – Specifies the number of records to include in a mini-batch for an HTTP inference request. A record is a single unit of input data that inference can be made on. For example, a single line in a CSV file is a record. To enable the batch strategy, you must set the SplitType property to Line, RecordIO, or TFRecord. To use only one record when making an HTTP invocation request to a container, set BatchStrategy to SingleRecord and SplitType to Line. To fit as many records in a mini-batch as can fit within the MaxPayloadInMB limit, set BatchStrategy to MultiRecord and SplitType to Line.

  • environment – The environment variables to set in the Docker container. Don’t include any sensitive data in your environment variables. We support up to 16 key and values entries in the map.

  • data_capture_config – Configuration to control how SageMaker captures inference data.

  • data_processing – The data structure used to specify the data to be used for inference in a batch transform job and to associate the data that is relevant to the prediction results in the output. The input filter provided allows you to exclude input data that is not needed for inference in a batch transform job. The output filter provided allows you to include input data relevant to interpreting the predictions in the output from the job. For more information, see Associate Prediction Results with their Corresponding Input Records.

  • tags – (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • platform_credential_token

  • customer_credential_token

  • data_access_credential_token

  • data_access_vpc_config

  • credential_provider_function

  • credential_provider_encryption_key

  • experiment_config

  • session – Boto3 session.

  • region – Region name.

Returns:

The TransformJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
data_capture_config: BatchDataCaptureConfig | None#
data_processing: DataProcessing | None#
delete() None[source]#

Delete a TransformJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

environment: Dict[str | PipelineVariable, str | PipelineVariable] | None#
experiment_config: ExperimentConfig | None#
failure_reason: str | PipelineVariable | None#
classmethod get(transform_job_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) TransformJob | None[source]#

Get a TransformJob resource

Parameters:
  • transform_job_name – The name of the transform job that you want to view details of.

  • session – Boto3 session.

  • region – Region name.

Returns:

The TransformJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), last_modified_time_after: datetime | None = Unassigned(), last_modified_time_before: datetime | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), status_equals: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[TransformJob][source]#

Get all TransformJob resources

Parameters:
  • creation_time_after – A filter that returns only transform jobs created after the specified time.

  • creation_time_before – A filter that returns only transform jobs created before the specified time.

  • last_modified_time_after – A filter that returns only transform jobs modified after the specified time.

  • last_modified_time_before – A filter that returns only transform jobs modified before the specified time.

  • name_contains – A string in the transform job name. This filter returns only transform jobs whose name contains the specified string.

  • status_equals – A filter that retrieves only transform jobs with a specific status.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Descending.

  • next_token – If the result of the previous ListTransformJobs request was truncated, the response includes a NextToken. To retrieve the next set of transform jobs, use the token in the next request.

  • max_results – The maximum number of transform jobs to return in the response. The default value is 10.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed TransformJob resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
labeling_job_arn: str | PipelineVariable | None#
last_modified_by: UserContext | None#
max_concurrent_transforms: int | None#
max_payload_in_mb: int | None#
model_client_config: ModelClientConfig | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_name: str | PipelineVariable | None#
populate_inputs_decorator()[source]#
refresh() TransformJob | None[source]#

Refresh a TransformJob resource

Returns:

The TransformJob resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

stop() None[source]#

Stop a TransformJob resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

transform_end_time: datetime | None#
transform_input: TransformInput | None#
transform_job_arn: str | PipelineVariable | None#
transform_job_name: str | PipelineVariable#
transform_job_progress: TransformJobProgress | None#
transform_job_status: str | PipelineVariable | None#
transform_output: TransformOutput | None#
transform_resources: TransformResources | None#
transform_start_time: datetime | None#
wait(poll: int = 5, timeout: int | None = None, logs: bool | None = False) None[source]#

Wait for a TransformJob resource.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

  • logs – Whether to print logs while waiting.

Raises:
class sagemaker.core.resources.Trial(*, trial_name: str | PipelineVariable, trial_arn: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), experiment_name: str | PipelineVariable | None = Unassigned(), source: TrialSource | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned())[source]#

Bases: Base

Class representing resource Trial

trial_name#

The name of the trial.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

trial_arn#

The Amazon Resource Name (ARN) of the trial.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

display_name#

The name of the trial as displayed. If DisplayName isn’t specified, TrialName is displayed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

experiment_name#

The name of the experiment the trial is part of.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source#

The Amazon Resource Name (ARN) of the source and, optionally, the job type.

Type:

sagemaker.core.shapes.shapes.TrialSource | None

creation_time#

When the trial was created.

Type:

datetime.datetime | None

created_by#

Who created the trial.

Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

When the trial was last modified.

Type:

datetime.datetime | None

last_modified_by#

Who last modified the trial.

Type:

sagemaker.core.shapes.shapes.UserContext | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

classmethod create(trial_name: str | PipelineVariable, experiment_name: str | PipelineVariable | object, display_name: str | PipelineVariable | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Trial | None[source]#

Create a Trial resource

Parameters:
  • trial_name – The name of the trial. The name must be unique in your Amazon Web Services account and is not case-sensitive.

  • experiment_name – The name of the experiment to associate the trial with.

  • display_name – The name of the trial as displayed. The name doesn’t need to be unique. If DisplayName isn’t specified, TrialName is displayed.

  • metadata_properties

  • tags – A list of tags to associate with the trial. You can use Search API to search on the tags.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Trial resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a Trial resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

display_name: str | PipelineVariable | None#
experiment_name: str | PipelineVariable | None#
classmethod get(trial_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Trial | None[source]#

Get a Trial resource

Parameters:
  • trial_name – The name of the trial to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Trial resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(experiment_name: str | PipelineVariable | None = Unassigned(), trial_component_name: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Trial][source]#

Get all Trial resources

Parameters:
  • experiment_name – A filter that returns only trials that are part of the specified experiment.

  • trial_component_name – A filter that returns only trials that are associated with the specified trial component.

  • created_after – A filter that returns only trials created after the specified time.

  • created_before – A filter that returns only trials created before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • max_results – The maximum number of trials to return in the response. The default value is 10.

  • next_token – If the previous call to ListTrials didn’t return the full set of trials, the call returns a token for getting the next set of trials.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Trial resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() Trial | None[source]#

Refresh a Trial resource

Returns:

The Trial resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

source: TrialSource | None#
trial_arn: str | PipelineVariable | None#
trial_name: str | PipelineVariable#
update(display_name: str | PipelineVariable | None = Unassigned()) Trial | None[source]#

Update a Trial resource

Returns:

The Trial resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.TrialComponent(*, trial_component_name: str | PipelineVariable, trial_component_arn: str | PipelineVariable | None = Unassigned(), display_name: str | PipelineVariable | None = Unassigned(), source: TrialComponentSource | None = Unassigned(), status: TrialComponentStatus | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), created_by: UserContext | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), last_modified_by: UserContext | None = Unassigned(), parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None = Unassigned(), input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), metrics: List[TrialComponentMetricSummary] | None = Unassigned(), lineage_group_arn: str | PipelineVariable | None = Unassigned(), sources: List[TrialComponentSource] | None = Unassigned())[source]#

Bases: Base

Class representing resource TrialComponent

trial_component_name#

The name of the trial component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

trial_component_arn#

The Amazon Resource Name (ARN) of the trial component.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

display_name#

The name of the component as displayed. If DisplayName isn’t specified, TrialComponentName is displayed.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

source#

The Amazon Resource Name (ARN) of the source and, optionally, the job type.

Type:

sagemaker.core.shapes.shapes.TrialComponentSource | None

status#

The status of the component. States include: InProgress Completed Failed

Type:

sagemaker.core.shapes.shapes.TrialComponentStatus | None

start_time#

When the component started.

Type:

datetime.datetime | None

end_time#

When the component ended.

Type:

datetime.datetime | None

creation_time#

When the component was created.

Type:

datetime.datetime | None

created_by#

Who created the trial component.

Type:

sagemaker.core.shapes.shapes.UserContext | None

last_modified_time#

When the component was last modified.

Type:

datetime.datetime | None

last_modified_by#

Who last modified the component.

Type:

sagemaker.core.shapes.shapes.UserContext | None

parameters#

The hyperparameters of the component.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, sagemaker.core.shapes.shapes.TrialComponentParameterValue] | None

input_artifacts#

The input artifacts of the component.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, sagemaker.core.shapes.shapes.TrialComponentArtifact] | None

output_artifacts#

The output artifacts of the component.

Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, sagemaker.core.shapes.shapes.TrialComponentArtifact] | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

metrics#

The metrics for the component.

Type:

List[sagemaker.core.shapes.shapes.TrialComponentMetricSummary] | None

lineage_group_arn#

The Amazon Resource Name (ARN) of the lineage group.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

sources#

A list of ARNs and, if applicable, job types for multiple sources of an experiment run.

Type:

List[sagemaker.core.shapes.shapes.TrialComponentSource] | None

associate_trail(trial_name: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Associates a trial component with a trial.

Parameters:
  • trial_name – The name of the trial to associate with.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

classmethod batch_get_metrics(metric_queries: List[MetricQuery], session: Session | None = None, region: str | None = None) BatchGetMetricsResponse | None[source]#

None

Parameters:
  • metric_queries

  • session – Boto3 session.

  • region – Region name.

Returns:

BatchGetMetricsResponse

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

batch_put_metrics(resource_arn: str | PipelineVariable, metric_data: List[RawMetricData], session: Session | None = None, region: str | None = None) None[source]#

None

Parameters:
  • resource_arn

  • metric_data

  • session – Boto3 session.

  • region – Region name.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod create(trial_component_name: str | PipelineVariable, display_name: str | PipelineVariable | None = Unassigned(), status: TrialComponentStatus | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None = Unassigned(), input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) TrialComponent | None[source]#

Create a TrialComponent resource

Parameters:
  • trial_component_name – The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.

  • display_name – The name of the component as displayed. The name doesn’t need to be unique. If DisplayName isn’t specified, TrialComponentName is displayed.

  • status – The status of the component. States include: InProgress Completed Failed

  • start_time – When the component started.

  • end_time – When the component ended.

  • parameters – The hyperparameters for the component.

  • input_artifacts – The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.

  • output_artifacts – The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.

  • metadata_properties

  • tags – A list of tags to associate with the component. You can use Search API to search on the tags.

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrialComponent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

created_by: UserContext | None#
creation_time: datetime | None#
delete() None[source]#

Delete a TrialComponent resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

disassociate_trail(trial_name: str | PipelineVariable, session: Session | None = None, region: str | None = None) None[source]#

Disassociates a trial component from a trial.

Parameters:
  • trial_name – The name of the trial to disassociate from.

  • session – Boto3 session.

  • region – Region name.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

display_name: str | PipelineVariable | None#
end_time: datetime | None#
classmethod get(trial_component_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) TrialComponent | None[source]#

Get a TrialComponent resource

Parameters:
  • trial_component_name – The name of the trial component to describe.

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrialComponent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(experiment_name: str | PipelineVariable | None = Unassigned(), trial_name: str | PipelineVariable | None = Unassigned(), source_arn: str | PipelineVariable | None = Unassigned(), created_after: datetime | None = Unassigned(), created_before: datetime | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[TrialComponent][source]#

Get all TrialComponent resources

Parameters:
  • experiment_name – A filter that returns only components that are part of the specified experiment. If you specify ExperimentName, you can’t filter by SourceArn or TrialName.

  • trial_name – A filter that returns only components that are part of the specified trial. If you specify TrialName, you can’t filter by ExperimentName or SourceArn.

  • source_arn – A filter that returns only components that have the specified source Amazon Resource Name (ARN). If you specify SourceArn, you can’t filter by ExperimentName or TrialName.

  • created_after – A filter that returns only components created after the specified time.

  • created_before – A filter that returns only components created before the specified time.

  • sort_by – The property used to sort results. The default value is CreationTime.

  • sort_order – The sort order. The default value is Descending.

  • max_results – The maximum number of components to return in the response. The default value is 10.

  • next_token – If the previous call to ListTrialComponents didn’t return the full set of components, the call returns a token for getting the next set of components.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed TrialComponent resources.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None#
last_modified_by: UserContext | None#
last_modified_time: datetime | None#
lineage_group_arn: str | PipelineVariable | None#
metadata_properties: MetadataProperties | None#
metrics: List[TrialComponentMetricSummary] | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None#
parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None#
refresh() TrialComponent | None[source]#

Refresh a TrialComponent resource

Returns:

The TrialComponent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

source: TrialComponentSource | None#
sources: List[TrialComponentSource] | None#
start_time: datetime | None#
status: TrialComponentStatus | None#
trial_component_arn: str | PipelineVariable | None#
trial_component_name: str | PipelineVariable#
update(display_name: str | PipelineVariable | None = Unassigned(), status: TrialComponentStatus | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None = Unassigned(), parameters_to_remove: List[str | PipelineVariable] | None = Unassigned(), input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), input_artifacts_to_remove: List[str | PipelineVariable] | None = Unassigned(), output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), output_artifacts_to_remove: List[str | PipelineVariable] | None = Unassigned()) TrialComponent | None[source]#

Update a TrialComponent resource

Parameters:
  • parameters_to_remove – The hyperparameters to remove from the component.

  • input_artifacts_to_remove – The input artifacts to remove from the component.

  • output_artifacts_to_remove – The output artifacts to remove from the component.

Returns:

The TrialComponent resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a TrialComponent resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['InProgress', 'Completed', 'Failed', 'Stopping', 'Stopped', 'Deleting', 'DeleteFailed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a TrialComponent resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.TrialComponentInternal(*, trial_component_name: str | PipelineVariable | object, customer_details: CustomerDetails, display_name: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), source: InputTrialComponentSource | None = Unassigned(), status: TrialComponentStatus | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None = Unassigned(), input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), trial_component_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource TrialComponentInternal

trial_component_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails

display_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#
Type:

datetime.datetime | None

source#
Type:

sagemaker.core.shapes.shapes.InputTrialComponentSource | None

status#
Type:

sagemaker.core.shapes.shapes.TrialComponentStatus | None

start_time#
Type:

datetime.datetime | None

end_time#
Type:

datetime.datetime | None

parameters#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, sagemaker.core.shapes.shapes.TrialComponentParameterValue] | None

input_artifacts#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, sagemaker.core.shapes.shapes.TrialComponentArtifact] | None

output_artifacts#
Type:

Dict[str | sagemaker.core.helper.pipeline_variable.PipelineVariable, sagemaker.core.shapes.shapes.TrialComponentArtifact] | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

tags#
Type:

List[sagemaker.core.resources.Tag] | None

trial_component_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(trial_component_name: str | PipelineVariable | object, customer_details: CustomerDetails, display_name: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), source: InputTrialComponentSource | None = Unassigned(), status: TrialComponentStatus | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None = Unassigned(), input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | None = None) TrialComponentInternal | None[source]#

Create a TrialComponentInternal resource

Parameters:
  • trial_component_name

  • customer_details

  • display_name

  • creation_time

  • source

  • status

  • start_time

  • end_time

  • parameters

  • input_artifacts

  • output_artifacts

  • metadata_properties

  • tags

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrialComponentInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails#
display_name: str | PipelineVariable | None#
end_time: datetime | None#
get_name() str[source]#
input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None#
parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None#
source: InputTrialComponentSource | None#
start_time: datetime | None#
status: TrialComponentStatus | None#
tags: List[Tag] | None#
trial_component_arn: str | PipelineVariable | None#
trial_component_name: str | PipelineVariable | object#
update(display_name: str | PipelineVariable | None = Unassigned(), status: TrialComponentStatus | None = Unassigned(), start_time: datetime | None = Unassigned(), end_time: datetime | None = Unassigned(), parameters: Dict[str | PipelineVariable, TrialComponentParameterValue] | None = Unassigned(), parameters_to_remove: List[str | PipelineVariable] | None = Unassigned(), input_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), input_artifacts_to_remove: List[str | PipelineVariable] | None = Unassigned(), output_artifacts: Dict[str | PipelineVariable, TrialComponentArtifact] | None = Unassigned(), output_artifacts_to_remove: List[str | PipelineVariable] | None = Unassigned(), customer_details: CustomerDetails | None = Unassigned()) TrialComponentInternal | None[source]#

Update a TrialComponentInternal resource

Parameters:
  • parameters_to_remove

  • input_artifacts_to_remove

  • output_artifacts_to_remove

Returns:

The TrialComponentInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound – Resource being access is not found.

class sagemaker.core.resources.TrialInternal(*, trial_name: str | PipelineVariable | object, experiment_name: str | PipelineVariable | object, display_name: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), source: InputTrialSource | None = Unassigned(), customer_details: CustomerDetails | None = Unassigned(), trial_arn: str | PipelineVariable | None = Unassigned())[source]#

Bases: Base

Class representing resource TrialInternal

trial_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

experiment_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | object

display_name#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

creation_time#
Type:

datetime.datetime | None

tags#
Type:

List[sagemaker.core.resources.Tag] | None

metadata_properties#
Type:

sagemaker.core.shapes.shapes.MetadataProperties | None

source#
Type:

sagemaker.core.shapes.shapes.InputTrialSource | None

customer_details#
Type:

sagemaker.core.shapes.shapes.CustomerDetails | None

trial_arn#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

classmethod create(trial_name: str | PipelineVariable | object, experiment_name: str | PipelineVariable | object, display_name: str | PipelineVariable | None = Unassigned(), creation_time: datetime | None = Unassigned(), tags: List[Tag] | None = Unassigned(), metadata_properties: MetadataProperties | None = Unassigned(), source: InputTrialSource | None = Unassigned(), customer_details: CustomerDetails | None = Unassigned(), session: Session | None = None, region: str | None = None) TrialInternal | None[source]#

Create a TrialInternal resource

Parameters:
  • trial_name

  • experiment_name

  • display_name

  • creation_time

  • tags

  • metadata_properties

  • source

  • customer_details

  • session – Boto3 session.

  • region – Region name.

Returns:

The TrialInternal resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
customer_details: CustomerDetails | None#
display_name: str | PipelineVariable | None#
experiment_name: str | PipelineVariable | object#
get_name() str[source]#
metadata_properties: MetadataProperties | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source: InputTrialSource | None#
tags: List[Tag] | None#
trial_arn: str | PipelineVariable | None#
trial_name: str | PipelineVariable | object#
class sagemaker.core.resources.UserProfile(*, domain_id: str | PipelineVariable, user_profile_name: str | PipelineVariable, user_profile_arn: str | PipelineVariable | None = Unassigned(), home_efs_file_system_uid: str | PipelineVariable | None = Unassigned(), status: str | PipelineVariable | None = Unassigned(), last_modified_time: datetime | None = Unassigned(), creation_time: datetime | None = Unassigned(), failure_reason: str | PipelineVariable | None = Unassigned(), single_sign_on_user_identifier: str | PipelineVariable | None = Unassigned(), single_sign_on_user_value: str | PipelineVariable | None = Unassigned(), user_policy: str | PipelineVariable | None = Unassigned(), user_settings: UserSettings | None = Unassigned())[source]#

Bases: Base

Class representing resource UserProfile

domain_id#

The ID of the domain that contains the profile.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

user_profile_arn#

The user profile Amazon Resource Name (ARN).

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

user_profile_name#

The user profile name.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable

home_efs_file_system_uid#

The ID of the user’s profile in the Amazon Elastic File System volume.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

status#

The status.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

last_modified_time#

The last modified time.

Type:

datetime.datetime | None

creation_time#

The creation time.

Type:

datetime.datetime | None

failure_reason#

The failure reason.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

single_sign_on_user_identifier#

The IAM Identity Center user identifier.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

single_sign_on_user_value#

The IAM Identity Center user value.

Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

user_policy#
Type:

str | sagemaker.core.helper.pipeline_variable.PipelineVariable | None

user_settings#

A collection of settings.

Type:

sagemaker.core.shapes.shapes.UserSettings | None

classmethod create(domain_id: str | PipelineVariable, user_profile_name: str | PipelineVariable, single_sign_on_user_identifier: str | PipelineVariable | None = Unassigned(), single_sign_on_user_value: str | PipelineVariable | None = Unassigned(), tags: List[Tag] | None = Unassigned(), user_policy: str | PipelineVariable | None = Unassigned(), user_settings: UserSettings | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) UserProfile | None[source]#

Create a UserProfile resource

Parameters:
  • domain_id – The ID of the associated Domain.

  • user_profile_name – A name for the UserProfile. This value is not case sensitive.

  • single_sign_on_user_identifier – A specifier for the type of value specified in SingleSignOnUserValue. Currently, the only supported value is “UserName”. If the Domain’s AuthMode is IAM Identity Center, this field is required. If the Domain’s AuthMode is not IAM Identity Center, this field cannot be specified.

  • single_sign_on_user_value – The username of the associated Amazon Web Services Single Sign-On User for this UserProfile. If the Domain’s AuthMode is IAM Identity Center, this field is required, and must match a valid username of a user in your directory. If the Domain’s AuthMode is not IAM Identity Center, this field cannot be specified.

  • tags – Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags that you specify for the User Profile are also added to all Apps that the User Profile launches.

  • user_policy

  • user_settings – A collection of settings.

  • session – Boto3 session.

  • region – Region name.

Returns:

The UserProfile resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessDeniedException

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

creation_time: datetime | None#
delete() None[source]#

Delete a UserProfile resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceNotFound – Resource being access is not found.

domain_id: str | PipelineVariable#
failure_reason: str | PipelineVariable | None#
classmethod get(domain_id: str | PipelineVariable, user_profile_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) UserProfile | None[source]#

Get a UserProfile resource

Parameters:
  • domain_id – The domain ID.

  • user_profile_name – The user profile name. This value is not case sensitive.

  • session – Boto3 session.

  • region – Region name.

Returns:

The UserProfile resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessDeniedException

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

classmethod get_all(sort_order: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), domain_id_equals: str | PipelineVariable | None = Unassigned(), user_profile_name_contains: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[UserProfile][source]#

Get all UserProfile resources

Parameters:
  • next_token – If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

  • max_results – This parameter defines the maximum number of results that can be return in a single response. The MaxResults parameter is an upper bound, not a target. If there are more results available than the value specified, a NextToken is provided in the response. The NextToken indicates that the user should get the next set of results by providing this token as a part of a subsequent call. The default value for MaxResults is 10.

  • sort_order – The sort order for the results. The default is Ascending.

  • sort_by – The parameter by which to sort the results. The default is CreationTime.

  • domain_id_equals – A parameter by which to filter the results.

  • user_profile_name_contains – A parameter by which to filter the results.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed UserProfile resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
home_efs_file_system_uid: str | PipelineVariable | None#
last_modified_time: datetime | None#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() UserProfile | None[source]#

Refresh a UserProfile resource

Returns:

The UserProfile resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • AccessDeniedException

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

single_sign_on_user_identifier: str | PipelineVariable | None#
single_sign_on_user_value: str | PipelineVariable | None#
status: str | PipelineVariable | None#
update(user_policy: str | PipelineVariable | None = Unassigned(), user_settings: UserSettings | None = Unassigned()) UserProfile | None[source]#

Update a UserProfile resource

Returns:

The UserProfile resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound – Resource being access is not found.

user_policy: str | PipelineVariable | None#
user_profile_arn: str | PipelineVariable | None#
user_profile_name: str | PipelineVariable#
user_settings: UserSettings | None#
wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a UserProfile resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Deleting', 'Failed', 'InService', 'Pending', 'Updating', 'Update_Failed', 'Delete_Failed'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a UserProfile resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
class sagemaker.core.resources.Workforce(*, workforce_name: str | PipelineVariable, workforce: Workforce | None = Unassigned())[source]#

Bases: Base

Class representing resource Workforce

workforce#

A single private workforce, which is automatically created when you create your first private work team. You can create one private work force in each Amazon Web Services Region. By default, any workforce-related API operation used in a specific region will apply to the workforce created in that region. To learn how to create a private workforce, see Create a Private Workforce.

Type:

sagemaker.core.shapes.shapes.Workforce | None

classmethod create(workforce_name: str | PipelineVariable, cognito_config: CognitoConfig | None = Unassigned(), oidc_config: OidcConfig | None = Unassigned(), source_ip_config: SourceIpConfig | None = Unassigned(), tags: List[Tag] | None = Unassigned(), workforce_vpc_config: WorkforceVpcConfigRequest | None = Unassigned(), ip_address_type: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Workforce | None[source]#

Create a Workforce resource

Parameters:
  • workforce_name – The name of the private workforce.

  • cognito_config – Use this parameter to configure an Amazon Cognito private workforce. A single Cognito workforce is created using and corresponds to a single Amazon Cognito user pool. Do not use OidcConfig if you specify values for CognitoConfig.

  • oidc_config – Use this parameter to configure a private workforce using your own OIDC Identity Provider. Do not use CognitoConfig if you specify values for OidcConfig.

  • source_ip_config

  • tags – An array of key-value pairs that contain metadata to help you categorize and organize our workforce. Each tag consists of a key and a value, both of which you define.

  • workforce_vpc_config – Use this parameter to configure a workforce using VPC.

  • ip_address_type – Use this parameter to specify whether you want IPv4 only or dualstack (IPv4 and IPv6) to support your labeling workforce.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Workforce resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

delete() None[source]#

Delete a Workforce resource

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get(workforce_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Workforce | None[source]#

Get a Workforce resource

Parameters:
  • workforce_name – The name of the private workforce whose access you want to restrict. WorkforceName is automatically set to default when a workforce is created and cannot be modified.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Workforce resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Workforce][source]#

Get all Workforce resources

Parameters:
  • sort_by – Sort workforces using the workforce name or creation date.

  • sort_order – Sort workforces in ascending or descending order.

  • name_contains – A filter you can use to search for workforces using part of the workforce name.

  • next_token – A token to resume pagination.

  • max_results – The maximum number of workforces returned in the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Workforce resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

populate_inputs_decorator()[source]#
refresh() Workforce | None[source]#

Refresh a Workforce resource

Returns:

The Workforce resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

update(source_ip_config: SourceIpConfig | None = Unassigned(), oidc_config: OidcConfig | None = Unassigned(), workforce_vpc_config: WorkforceVpcConfigRequest | None = Unassigned(), ip_address_type: str | PipelineVariable | None = Unassigned()) Workforce | None[source]#

Update a Workforce resource

Parameters:
  • source_ip_config – A list of one to ten worker IP address ranges (CIDRs) that can be used to access tasks assigned to this workforce. Maximum: Ten CIDR values

  • oidc_config – Use this parameter to update your OIDC Identity Provider (IdP) configuration for a workforce made using your own IdP.

  • workforce_vpc_config – Use this parameter to update your VPC configuration for a workforce.

  • ip_address_type – Use this parameter to specify whether you want IPv4 only or dualstack (IPv4 and IPv6) to support your labeling workforce.

Returns:

The Workforce resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ConflictException – There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

wait_for_delete(poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Workforce resource to be deleted.

Parameters:
  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • TimeoutExceededError – If the resource does not reach a terminal state before the timeout.

  • DeleteFailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

wait_for_status(target_status: Literal['Initializing', 'Updating', 'Deleting', 'Failed', 'Active'], poll: int = 5, timeout: int | None = None) None[source]#

Wait for a Workforce resource to reach certain status.

Parameters:
  • target_status – The status to wait for.

  • poll – The number of seconds to wait between each poll.

  • timeout – The maximum number of seconds to wait before timing out.

Raises:
workforce: Workforce | None#
workforce_name: str | PipelineVariable#
class sagemaker.core.resources.Workteam(*, workteam_name: str | PipelineVariable, workteam: Workteam | None = Unassigned())[source]#

Bases: Base

Class representing resource Workteam

workteam#

A Workteam instance that contains information about the work team.

Type:

sagemaker.core.shapes.shapes.Workteam | None

classmethod create(workteam_name: str | PipelineVariable, member_definitions: List[MemberDefinition], description: str | PipelineVariable, workforce_name: str | PipelineVariable | object | None = Unassigned(), membership_rule: MembershipRule | None = Unassigned(), membership_type: str | PipelineVariable | None = Unassigned(), notification_configuration: NotificationConfiguration | None = Unassigned(), worker_access_configuration: WorkerAccessConfiguration | None = Unassigned(), tags: List[Tag] | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) Workteam | None[source]#

Create a Workteam resource

Parameters:
  • workteam_name – The name of the work team. Use this name to identify the work team.

  • member_definitions – A list of MemberDefinition objects that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use CognitoMemberDefinition. For workforces created using your own OIDC identity provider (IdP) use OidcMemberDefinition. Do not provide input for both of these parameters in a single request. For workforces created using Amazon Cognito, private work teams correspond to Amazon Cognito user groups within the user pool used to create a workforce. All of the CognitoMemberDefinition objects that make up the member definition must have the same ClientId and UserPool values. To add a Amazon Cognito user group to an existing worker pool, see Adding groups to a User Pool. For more information about user pools, see Amazon Cognito User Pools. For workforces created using your own OIDC IdP, specify the user groups that you want to include in your private work team in OidcMemberDefinition by listing those groups in Groups.

  • description – A description of the work team.

  • workforce_name – The name of the workforce.

  • membership_rule

  • membership_type

  • notification_configuration – Configures notification of workers regarding available or expiring work items.

  • worker_access_configuration – Use this optional parameter to constrain access to an Amazon S3 resource based on the IP address using supported IAM global condition keys. The Amazon S3 resource is accessed in the worker portal using a Amazon S3 presigned URL.

  • tags – An array of key-value pairs. For more information, see Resource Tag and Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Workteam resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceInUse – Resource being accessed is in use.

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ConfigSchemaValidationError – Raised when a configuration file does not adhere to the schema

  • LocalConfigNotFoundError – Raised when a configuration file is not found in local file system

  • S3ConfigNotFoundError – Raised when a configuration file is not found in S3

delete() None[source]#

Delete a Workteam resource

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

classmethod get(workteam_name: str | PipelineVariable, session: Session | None = None, region: str | PipelineVariable | None = None) Workteam | None[source]#

Get a Workteam resource

Parameters:
  • workteam_name – The name of the work team to return a description of.

  • session – Boto3 session.

  • region – Region name.

Returns:

The Workteam resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

classmethod get_all(sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), name_contains: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | PipelineVariable | None = None) ResourceIterator[Workteam][source]#

Get all Workteam resources

Parameters:
  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • name_contains – A string in the work team’s name. This filter returns only work teams whose name contains the specified string.

  • next_token – If the result of the previous ListWorkteams request was truncated, the response includes a NextToken. To retrieve the next set of labeling jobs, use the token in the next request.

  • max_results – The maximum number of work teams to return in each page of the response.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed Workteam resources.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

get_all_labeling_jobs(workteam_arn: str | PipelineVariable, creation_time_after: datetime | None = Unassigned(), creation_time_before: datetime | None = Unassigned(), job_reference_code_contains: str | PipelineVariable | None = Unassigned(), sort_by: str | PipelineVariable | None = Unassigned(), sort_order: str | PipelineVariable | None = Unassigned(), session: Session | None = None, region: str | None = None) ResourceIterator[LabelingJob][source]#

Gets a list of labeling jobs assigned to a specified work team.

Parameters:
  • workteam_arn – The Amazon Resource Name (ARN) of the work team for which you want to see labeling jobs for.

  • max_results – The maximum number of labeling jobs to return in each page of the response.

  • next_token – If the result of the previous ListLabelingJobsForWorkteam request was truncated, the response includes a NextToken. To retrieve the next set of labeling jobs, use the token in the next request.

  • creation_time_after – A filter that returns only labeling jobs created after the specified time (timestamp).

  • creation_time_before – A filter that returns only labeling jobs created before the specified time (timestamp).

  • job_reference_code_contains – A filter the limits jobs to only the ones whose job reference code contains the specified string.

  • sort_by – The field to sort results by. The default is CreationTime.

  • sort_order – The sort order for results. The default is Ascending.

  • session – Boto3 session.

  • region – Region name.

Returns:

Iterator for listed LabelingJob.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceNotFound – Resource being access is not found.

get_name() str[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

refresh() Workteam | None[source]#

Refresh a Workteam resource

Returns:

The Workteam resource.

Raises:

botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

update(member_definitions: List[MemberDefinition] | None = Unassigned(), membership_rule: MembershipRule | None = Unassigned(), membership_type: str | PipelineVariable | None = Unassigned(), description: str | PipelineVariable | None = Unassigned(), notification_configuration: NotificationConfiguration | None = Unassigned(), worker_access_configuration: WorkerAccessConfiguration | None = Unassigned()) Workteam | None[source]#

Update a Workteam resource

Parameters:
  • member_definitions – A list of MemberDefinition objects that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use CognitoMemberDefinition. For workforces created using your own OIDC identity provider (IdP) use OidcMemberDefinition. You should not provide input for both of these parameters in a single request. For workforces created using Amazon Cognito, private work teams correspond to Amazon Cognito user groups within the user pool used to create a workforce. All of the CognitoMemberDefinition objects that make up the member definition must have the same ClientId and UserPool values. To add a Amazon Cognito user group to an existing worker pool, see Adding groups to a User Pool. For more information about user pools, see Amazon Cognito User Pools. For workforces created using your own OIDC IdP, specify the user groups that you want to include in your private work team in OidcMemberDefinition by listing those groups in Groups. Be aware that user groups that are already in the work team must also be listed in Groups when you make this request to remain on the work team. If you do not include these user groups, they will no longer be associated with the work team you update.

  • membership_rule

  • membership_type

  • description – An updated description for the work team.

  • notification_configuration – Configures SNS topic notifications for available or expiring work items

  • worker_access_configuration – Use this optional parameter to constrain access to an Amazon S3 resource based on the IP address using supported IAM global condition keys. The Amazon S3 resource is accessed in the worker portal using a Amazon S3 presigned URL.

Returns:

The Workteam resource.

Raises:
  • botocore.exceptions.ClientError – This exception is raised for AWS service related errors. The error message and error code can be parsed from the exception as follows: `     try:         # AWS service call here     except botocore.exceptions.ClientError as e:         error_message = e.response['Error']['Message']         error_code = e.response['Error']['Code']     `

  • ResourceLimitExceeded – You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

workteam: Workteam | None#
workteam_name: str | PipelineVariable#