SageMaker

SageMaker Core

Latest Version Supported Python Versions

Introduction

Welcome to the sagemaker-core Python SDK, an SDK designed to provide an object-oriented interface for interacting with Amazon SageMaker resources. It offers full parity with SageMaker APIs, allowing developers to leverage all SageMaker capabilities directly through the SDK. sagemaker-core introduces features such as dedicated resource classes, resource chaining, auto code completion, comprehensive documentation and type hints to enhance the developer experience as well as productivity.

Key Features

  • Object-Oriented Interface: Provides a structured way to interact with SageMaker resources, making it easier to manage them using familiar object-oriented programming techniques.

  • Resource Chaining: Allows seamless connection of SageMaker resources by passing outputs as inputs between them, simplifying workflows and reducing the complexity of parameter management.

  • Full Parity with SageMaker APIs: Ensures access to all SageMaker capabilities through the SDK, providing a comprehensive toolset for building and deploying machine learning models.

  • Abstraction of Low-Level Details: Automatically handles resource state transitions and polling logic, freeing developers from managing these intricacies and allowing them to focus on higher-level tasks.

  • Auto Code Completion: Enhances the developer experience by offering real-time suggestions and completions in popular IDEs, reducing syntax errors and speeding up the coding process.

  • Comprehensive Documentation and Type Hints: Provides detailed guidance and type hints to help developers understand functionalities, write code faster, and reduce errors without complex API navigation.

  • Incorporation of Intelligent Defaults: Integrates the previous SageMaker SDK feature of intelligent defaults, allowing developers to set default values for parameters like IAM roles and VPC configurations. This streamlines the setup process, enabling developers to focus on customizations specific to their use case.

Benefits

  • Simplified Development: By abstracting low-level details and providing intelligent defaults, developers can focus on building and deploying machine learning models without getting bogged down by repetitive tasks.

  • Increased Productivity: The SDK’s features, such as auto code completion and type hints, help developers write code faster and with fewer errors.

  • Enhanced Readability: Resource chaining and dedicated resource classes result in more readable and maintainable code.

Docs and Examples

Learn more about the sagemaker-core SDK and its features by visting the What’s New Announcement.

For examples and walkthroughs, see the SageMaker Core Examples.

For detailed documentation, including the API reference, see Read the Docs.

SageMaker Core Resources

class sagemaker_core.main.resources.Action(*, action_name, action_arn=<sagemaker_core.main.utils.Unassigned object>, source=<sagemaker_core.main.utils.Unassigned object>, action_type=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, status=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, created_by=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_by=<sagemaker_core.main.utils.Unassigned object>, metadata_properties=<sagemaker_core.main.utils.Unassigned object>, lineage_group_arn=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Action

Parameters:
  • action_name (str)

  • action_arn (str | None)

  • source (ActionSource | None)

  • action_type (str | None)

  • description (str | None)

  • status (str | None)

  • properties (Dict[str, str] | None)

  • creation_time (datetime | None)

  • created_by (UserContext | None)

  • last_modified_time (datetime | None)

  • last_modified_by (UserContext | None)

  • metadata_properties (MetadataProperties | None)

  • lineage_group_arn (str | None)

action_name

The name of the action.

Type:

str

action_arn

The Amazon Resource Name (ARN) of the action.

Type:

str | None

source

The source of the action.

Type:

sagemaker_core.main.shapes.ActionSource | None

action_type

The type of the action.

Type:

str | None

description

The description of the action.

Type:

str | None

status

The status of the action.

Type:

str | None

properties

A list of the action’s properties.

Type:

Dict[str, str] | None

creation_time

When the action was created.

Type:

datetime.datetime | None

created_by
Type:

sagemaker_core.main.shapes.UserContext | None

last_modified_time

When the action was last modified.

Type:

datetime.datetime | None

last_modified_by
Type:

sagemaker_core.main.shapes.UserContext | None

metadata_properties
Type:

sagemaker_core.main.shapes.MetadataProperties | None

lineage_group_arn

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

Type:

str | None

classmethod create(action_name, source, action_type, description=<sagemaker_core.main.utils.Unassigned object>, status=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, metadata_properties=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Action resource

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

  • source (ActionSource) – The source type, ID, and URI.

  • action_type (str) – The action type.

  • description (str | None) – The description of the action.

  • status (str | None) – The status of the action.

  • properties (Dict[str, str] | None) – A list of properties to add to the action.

  • metadata_properties (MetadataProperties | None)

  • tags (List[Tag] | None) – A list of tags to apply to the action.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Action | None

delete()[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.

Return type:

None

classmethod get(action_name, session=None, region=None)[source]

Get a Action resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Action | None

classmethod get_all(source_uri=<sagemaker_core.main.utils.Unassigned object>, action_type=<sagemaker_core.main.utils.Unassigned object>, created_after=<sagemaker_core.main.utils.Unassigned object>, created_before=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Action resources

Parameters:
  • source_uri (str | None) – A filter that returns only actions with the specified source URI.

  • action_type (str | None) – A filter that returns only actions of the specified type.

  • created_after (datetime | None) – A filter that returns only actions created on or after the specified time.

  • created_before (datetime | None) – A filter that returns only actions created on or before the specified time.

  • sort_by (str | None) – The property used to sort results. The default value is CreationTime.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[Action]

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

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

refresh()[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.

Return type:

Action | None

update(description=<sagemaker_core.main.utils.Unassigned object>, status=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, properties_to_remove=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a Action resource

Parameters:
  • properties_to_remove (List[str] | None) – A list of properties to remove.

  • description (str | None)

  • status (str | None)

  • properties (Dict[str, str] | None)

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.

Return type:

Action | None

class sagemaker_core.main.resources.Algorithm(*, algorithm_name, algorithm_arn=<sagemaker_core.main.utils.Unassigned object>, algorithm_description=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, training_specification=<sagemaker_core.main.utils.Unassigned object>, inference_specification=<sagemaker_core.main.utils.Unassigned object>, validation_specification=<sagemaker_core.main.utils.Unassigned object>, algorithm_status=<sagemaker_core.main.utils.Unassigned object>, algorithm_status_details=<sagemaker_core.main.utils.Unassigned object>, product_id=<sagemaker_core.main.utils.Unassigned object>, certify_for_marketplace=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Algorithm

Parameters:
  • algorithm_name (str)

  • algorithm_arn (str | None)

  • algorithm_description (str | None)

  • creation_time (datetime | None)

  • training_specification (TrainingSpecification | None)

  • inference_specification (InferenceSpecification | None)

  • validation_specification (AlgorithmValidationSpecification | None)

  • algorithm_status (str | None)

  • algorithm_status_details (AlgorithmStatusDetails | None)

  • product_id (str | None)

  • certify_for_marketplace (bool | None)

algorithm_name

The name of the algorithm being described.

Type:

str

algorithm_arn

The Amazon Resource Name (ARN) of the algorithm.

Type:

str | 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.main.shapes.TrainingSpecification | None

algorithm_status

The current status of the algorithm.

Type:

str | None

algorithm_status_details

Details about the current status of the algorithm.

Type:

sagemaker_core.main.shapes.AlgorithmStatusDetails | None

algorithm_description

A brief summary about the algorithm.

Type:

str | None

inference_specification

Details about inference jobs that the algorithm runs.

Type:

sagemaker_core.main.shapes.InferenceSpecification | None

validation_specification

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

Type:

sagemaker_core.main.shapes.AlgorithmValidationSpecification | None

product_id

The product identifier of the algorithm.

Type:

str | None

certify_for_marketplace

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

Type:

bool | None

classmethod create(algorithm_name, training_specification, algorithm_description=<sagemaker_core.main.utils.Unassigned object>, inference_specification=<sagemaker_core.main.utils.Unassigned object>, validation_specification=<sagemaker_core.main.utils.Unassigned object>, certify_for_marketplace=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Algorithm resource

Parameters:
  • algorithm_name (str) – The name of the algorithm.

  • training_specification (TrainingSpecification) – 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 (str | None) – A description of the algorithm.

  • inference_specification (InferenceSpecification | None) – 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 (AlgorithmValidationSpecification | None) – 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 (bool | None) – Whether to certify the algorithm so that it can be listed in Amazon Web Services Marketplace.

  • tags (List[Tag] | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Algorithm | None

delete()[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.

Return type:

None

classmethod get(algorithm_name, session=None, region=None)[source]

Get a Algorithm resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

Algorithm | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Algorithm resources

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

  • creation_time_before (datetime | None) – 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 (str | None) – 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 (str | None) – The parameter by which to sort the results. The default is CreationTime.

  • sort_order (str | None) – The sort order for the results. The default is Ascending.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[Algorithm]

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

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

refresh()[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']     `

Return type:

Algorithm | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a Algorithm resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a Algorithm resource to reach certain status.

Parameters:
  • target_status (Literal['Pending', 'InProgress', 'Completed', 'Failed', 'Deleting']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.App(*, domain_id, app_type, app_name, app_arn=<sagemaker_core.main.utils.Unassigned object>, user_profile_name=<sagemaker_core.main.utils.Unassigned object>, space_name=<sagemaker_core.main.utils.Unassigned object>, status=<sagemaker_core.main.utils.Unassigned object>, last_health_check_timestamp=<sagemaker_core.main.utils.Unassigned object>, last_user_activity_timestamp=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, resource_spec=<sagemaker_core.main.utils.Unassigned object>, built_in_lifecycle_config_arn=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource App

Parameters:
  • domain_id (str)

  • app_type (str)

  • app_name (str)

  • app_arn (str | None)

  • user_profile_name (str | None)

  • space_name (str | None)

  • status (str | None)

  • last_health_check_timestamp (datetime | None)

  • last_user_activity_timestamp (datetime | None)

  • creation_time (datetime | None)

  • failure_reason (str | None)

  • resource_spec (ResourceSpec | None)

  • built_in_lifecycle_config_arn (str | None)

app_arn

The Amazon Resource Name (ARN) of the app.

Type:

str | None

app_type

The type of app.

Type:

str

app_name

The name of the app.

Type:

str

domain_id

The domain ID.

Type:

str

user_profile_name

The user profile name.

Type:

str | None

space_name

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

Type:

str | None

status

The status.

Type:

str | 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 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 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

failure_reason

The failure reason.

Type:

str | None

resource_spec

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

Type:

sagemaker_core.main.shapes.ResourceSpec | None

built_in_lifecycle_config_arn

The lifecycle configuration that runs before the default lifecycle configuration

Type:

str | None

classmethod create(domain_id, app_type, app_name, user_profile_name=<sagemaker_core.main.utils.Unassigned object>, space_name=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, resource_spec=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a App resource

Parameters:
  • domain_id (str) – The domain ID.

  • app_type (str) – The type of app.

  • app_name (str) – The name of the app.

  • user_profile_name (str | object | None) – The user profile name. If this value is not set, then SpaceName must be set.

  • space_name (str | object | None) – The name of the space. If this value is not set, then UserProfileName must be set.

  • tags (List[Tag] | None) – Each tag consists of a key and an optional value. Tag keys must be unique per resource.

  • resource_spec (ResourceSpec | None) – The instance type and the Amazon Resource Name (ARN) of the SageMaker 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.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

App | None

delete()[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.

Return type:

None

classmethod get(domain_id, app_type, app_name, user_profile_name=<sagemaker_core.main.utils.Unassigned object>, space_name=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get a App resource

Parameters:
  • domain_id (str) – The domain ID.

  • app_type (str) – The type of app.

  • app_name (str) – The name of the app.

  • user_profile_name (str | None) – The user profile name. If this value is not set, then SpaceName must be set.

  • space_name (str | None) – The name of the space.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

App | None

classmethod get_all(sort_order=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, domain_id_equals=<sagemaker_core.main.utils.Unassigned object>, user_profile_name_equals=<sagemaker_core.main.utils.Unassigned object>, space_name_equals=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (str | None) – The sort order for the results. The default is Ascending.

  • sort_by (str | None) – The parameter by which to sort the results. The default is CreationTime.

  • domain_id_equals (str | None) – A parameter to search for the domain ID.

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

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[App]

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

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

refresh()[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.

Return type:

App | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a App resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a App resource to reach certain status.

Parameters:
  • target_status (Literal['Deleted', 'Deleting', 'Failed', 'InService', 'Pending']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.AppImageConfig(*, app_image_config_name, app_image_config_arn=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, kernel_gateway_image_config=<sagemaker_core.main.utils.Unassigned object>, jupyter_lab_app_image_config=<sagemaker_core.main.utils.Unassigned object>, code_editor_app_image_config=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource AppImageConfig

Parameters:
  • app_image_config_name (str)

  • app_image_config_arn (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • kernel_gateway_image_config (KernelGatewayImageConfig | None)

  • jupyter_lab_app_image_config (JupyterLabAppImageConfig | None)

  • code_editor_app_image_config (CodeEditorAppImageConfig | None)

app_image_config_arn

The ARN of the AppImageConfig.

Type:

str | None

app_image_config_name

The name of the AppImageConfig.

Type:

str

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.main.shapes.KernelGatewayImageConfig | None

jupyter_lab_app_image_config

The configuration of the JupyterLab app.

Type:

sagemaker_core.main.shapes.JupyterLabAppImageConfig | None

code_editor_app_image_config

The configuration of the Code Editor app.

Type:

sagemaker_core.main.shapes.CodeEditorAppImageConfig | None

classmethod create(app_image_config_name, tags=<sagemaker_core.main.utils.Unassigned object>, kernel_gateway_image_config=<sagemaker_core.main.utils.Unassigned object>, jupyter_lab_app_image_config=<sagemaker_core.main.utils.Unassigned object>, code_editor_app_image_config=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a AppImageConfig resource

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

  • tags (List[Tag] | None) – A list of tags to apply to the AppImageConfig.

  • kernel_gateway_image_config (KernelGatewayImageConfig | None) – 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.

  • jupyter_lab_app_image_config (JupyterLabAppImageConfig | None) – 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 (CodeEditorAppImageConfig | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

AppImageConfig | None

delete()[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.

Return type:

None

classmethod get(app_image_config_name, session=None, region=None)[source]

Get a AppImageConfig resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

AppImageConfig | None

classmethod get_all(name_contains=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, modified_time_before=<sagemaker_core.main.utils.Unassigned object>, modified_time_after=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (str | None) – A filter that returns only AppImageConfigs whose name contains the specified string.

  • creation_time_before (datetime | None) – A filter that returns only AppImageConfigs created on or before the specified time.

  • creation_time_after (datetime | None) – A filter that returns only AppImageConfigs created on or after the specified time.

  • modified_time_before (datetime | None) – A filter that returns only AppImageConfigs modified on or before the specified time.

  • modified_time_after (datetime | None) – A filter that returns only AppImageConfigs modified on or after the specified time.

  • sort_by (str | None) – The property used to sort results. The default value is CreationTime.

  • sort_order (str | None) – The sort order. The default value is Descending.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[AppImageConfig]

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

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

refresh()[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.

Return type:

AppImageConfig | None

update(kernel_gateway_image_config=<sagemaker_core.main.utils.Unassigned object>, jupyter_lab_app_image_config=<sagemaker_core.main.utils.Unassigned object>, code_editor_app_image_config=<sagemaker_core.main.utils.Unassigned object>)[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.

Parameters:
  • kernel_gateway_image_config (KernelGatewayImageConfig | None)

  • jupyter_lab_app_image_config (JupyterLabAppImageConfig | None)

  • code_editor_app_image_config (CodeEditorAppImageConfig | None)

Return type:

AppImageConfig | None

class sagemaker_core.main.resources.Artifact(*, artifact_arn, artifact_name=<sagemaker_core.main.utils.Unassigned object>, source=<sagemaker_core.main.utils.Unassigned object>, artifact_type=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, created_by=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_by=<sagemaker_core.main.utils.Unassigned object>, metadata_properties=<sagemaker_core.main.utils.Unassigned object>, lineage_group_arn=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Artifact

Parameters:
  • artifact_arn (str)

  • artifact_name (str | None)

  • source (ArtifactSource | None)

  • artifact_type (str | None)

  • properties (Dict[str, str] | None)

  • creation_time (datetime | None)

  • created_by (UserContext | None)

  • last_modified_time (datetime | None)

  • last_modified_by (UserContext | None)

  • metadata_properties (MetadataProperties | None)

  • lineage_group_arn (str | None)

artifact_name

The name of the artifact.

Type:

str | None

artifact_arn

The Amazon Resource Name (ARN) of the artifact.

Type:

str

source

The source of the artifact.

Type:

sagemaker_core.main.shapes.ArtifactSource | None

artifact_type

The type of the artifact.

Type:

str | None

properties

A list of the artifact’s properties.

Type:

Dict[str, str] | None

creation_time

When the artifact was created.

Type:

datetime.datetime | None

created_by
Type:

sagemaker_core.main.shapes.UserContext | None

last_modified_time

When the artifact was last modified.

Type:

datetime.datetime | None

last_modified_by
Type:

sagemaker_core.main.shapes.UserContext | None

metadata_properties
Type:

sagemaker_core.main.shapes.MetadataProperties | None

lineage_group_arn

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

Type:

str | None

classmethod create(source, artifact_type, artifact_name=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, metadata_properties=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Artifact resource

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

  • artifact_type (str) – The artifact type.

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

  • properties (Dict[str, str] | None) – A list of properties to add to the artifact.

  • metadata_properties (MetadataProperties | None)

  • tags (List[Tag] | None) – A list of tags to apply to the artifact.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Artifact | None

delete()[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.

Return type:

None

classmethod get(artifact_arn, session=None, region=None)[source]

Get a Artifact resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Artifact | None

classmethod get_all(source_uri=<sagemaker_core.main.utils.Unassigned object>, artifact_type=<sagemaker_core.main.utils.Unassigned object>, created_after=<sagemaker_core.main.utils.Unassigned object>, created_before=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Artifact resources

Parameters:
  • source_uri (str | None) – A filter that returns only artifacts with the specified source URI.

  • artifact_type (str | None) – A filter that returns only artifacts of the specified type.

  • created_after (datetime | None) – A filter that returns only artifacts created on or after the specified time.

  • created_before (datetime | None) – A filter that returns only artifacts created on or before the specified time.

  • sort_by (str | None) – The property used to sort results. The default value is CreationTime.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[Artifact]

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

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

refresh()[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.

Return type:

Artifact | None

update(artifact_name=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, properties_to_remove=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a Artifact resource

Parameters:
  • properties_to_remove (List[str] | None) – A list of properties to remove.

  • artifact_name (str | None)

  • properties (Dict[str, str] | None)

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.

Return type:

Artifact | None

class sagemaker_core.main.resources.Association(*, source_arn=<sagemaker_core.main.utils.Unassigned object>, destination_arn=<sagemaker_core.main.utils.Unassigned object>, source_type=<sagemaker_core.main.utils.Unassigned object>, destination_type=<sagemaker_core.main.utils.Unassigned object>, association_type=<sagemaker_core.main.utils.Unassigned object>, source_name=<sagemaker_core.main.utils.Unassigned object>, destination_name=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, created_by=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Association

Parameters:
  • source_arn (str | None)

  • destination_arn (str | None)

  • source_type (str | None)

  • destination_type (str | None)

  • association_type (str | None)

  • source_name (str | None)

  • destination_name (str | None)

  • creation_time (datetime | None)

  • created_by (UserContext | None)

source_arn

The ARN of the source.

Type:

str | None

destination_arn

The Amazon Resource Name (ARN) of the destination.

Type:

str | None

source_type

The source type.

Type:

str | None

destination_type

The destination type.

Type:

str | None

association_type

The type of the association.

Type:

str | None

source_name

The name of the source.

Type:

str | None

destination_name

The name of the destination.

Type:

str | None

creation_time

When the association was created.

Type:

datetime.datetime | None

created_by
Type:

sagemaker_core.main.shapes.UserContext | None

classmethod add(source_arn, destination_arn, association_type=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Creates an association between the source and the destination.

Parameters:
  • source_arn (str) – The ARN of the source.

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

  • association_type (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

delete()[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.

Return type:

None

classmethod get_all(source_arn=<sagemaker_core.main.utils.Unassigned object>, destination_arn=<sagemaker_core.main.utils.Unassigned object>, source_type=<sagemaker_core.main.utils.Unassigned object>, destination_type=<sagemaker_core.main.utils.Unassigned object>, association_type=<sagemaker_core.main.utils.Unassigned object>, created_after=<sagemaker_core.main.utils.Unassigned object>, created_before=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Association resources

Parameters:
  • source_arn (str | None) – A filter that returns only associations with the specified source ARN.

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

  • source_type (str | None) – A filter that returns only associations with the specified source type.

  • destination_type (str | None) – A filter that returns only associations with the specified destination type.

  • association_type (str | None) – A filter that returns only associations of the specified type.

  • created_after (datetime | None) – A filter that returns only associations created on or after the specified time.

  • created_before (datetime | None) – A filter that returns only associations created on or before the specified time.

  • sort_by (str | None) – The property used to sort results. The default value is CreationTime.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[Association]

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

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

class sagemaker_core.main.resources.AutoMLJob(*, auto_ml_job_name, auto_ml_job_arn=<sagemaker_core.main.utils.Unassigned object>, input_data_config=<sagemaker_core.main.utils.Unassigned object>, output_data_config=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_objective=<sagemaker_core.main.utils.Unassigned object>, problem_type=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_config=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, end_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, partial_failure_reasons=<sagemaker_core.main.utils.Unassigned object>, best_candidate=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_status=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_secondary_status=<sagemaker_core.main.utils.Unassigned object>, generate_candidate_definitions_only=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_artifacts=<sagemaker_core.main.utils.Unassigned object>, resolved_attributes=<sagemaker_core.main.utils.Unassigned object>, model_deploy_config=<sagemaker_core.main.utils.Unassigned object>, model_deploy_result=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource AutoMLJob

Parameters:
  • auto_ml_job_name (str)

  • auto_ml_job_arn (str | None)

  • input_data_config (List[AutoMLChannel] | None)

  • output_data_config (AutoMLOutputDataConfig | None)

  • role_arn (str | None)

  • auto_ml_job_objective (AutoMLJobObjective | None)

  • problem_type (str | None)

  • auto_ml_job_config (AutoMLJobConfig | None)

  • creation_time (datetime | None)

  • end_time (datetime | None)

  • last_modified_time (datetime | None)

  • failure_reason (str | None)

  • partial_failure_reasons (List[AutoMLPartialFailureReason] | None)

  • best_candidate (AutoMLCandidate | None)

  • auto_ml_job_status (str | None)

  • auto_ml_job_secondary_status (str | None)

  • generate_candidate_definitions_only (bool | None)

  • auto_ml_job_artifacts (AutoMLJobArtifacts | None)

  • resolved_attributes (ResolvedAttributes | None)

  • model_deploy_config (ModelDeployConfig | None)

  • model_deploy_result (ModelDeployResult | None)

auto_ml_job_name

Returns the name of the AutoML job.

Type:

str

auto_ml_job_arn

Returns the ARN of the AutoML job.

Type:

str | None

input_data_config

Returns the input data configuration for the AutoML job.

Type:

List[sagemaker_core.main.shapes.AutoMLChannel] | None

output_data_config

Returns the job’s output data config.

Type:

sagemaker_core.main.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 | 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 | None

auto_ml_job_secondary_status

Returns the secondary status of the AutoML job.

Type:

str | None

auto_ml_job_objective

Returns the job’s objective.

Type:

sagemaker_core.main.shapes.AutoMLJobObjective | None

problem_type

Returns the job’s problem type.

Type:

str | None

auto_ml_job_config

Returns the configuration for the AutoML job.

Type:

sagemaker_core.main.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 | None

partial_failure_reasons

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

Type:

List[sagemaker_core.main.shapes.AutoMLPartialFailureReason] | None

best_candidate

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

Type:

sagemaker_core.main.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.main.shapes.AutoMLJobArtifacts | None

resolved_attributes

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

Type:

sagemaker_core.main.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.main.shapes.ModelDeployConfig | None

model_deploy_result

Provides information about endpoint for the model deployment.

Type:

sagemaker_core.main.shapes.ModelDeployResult | None

classmethod create(auto_ml_job_name, input_data_config, output_data_config, role_arn, problem_type=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_objective=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_config=<sagemaker_core.main.utils.Unassigned object>, generate_candidate_definitions_only=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, model_deploy_config=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a AutoMLJob resource

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

  • input_data_config (List[AutoMLChannel]) – 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 (AutoMLOutputDataConfig) – Provides information about encryption and the Amazon S3 output path needed to store artifacts from an AutoML job. Format(s) supported: CSV.

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

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

  • auto_ml_job_objective (AutoMLJobObjective | None) – 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 (AutoMLJobConfig | None) – A collection of settings used to configure an AutoML job.

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

  • tags (List[Tag] | None) – 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.

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

AutoMLJob | None

classmethod get(auto_ml_job_name, session=None, region=None)[source]

Get a AutoMLJob resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

AutoMLJob | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, status_equals=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all AutoMLJob resources

Parameters:
  • creation_time_after (datetime | None) – Request a list of jobs, using a filter for time.

  • creation_time_before (datetime | None) – Request a list of jobs, using a filter for time.

  • last_modified_time_after (datetime | None) – Request a list of jobs, using a filter for time.

  • last_modified_time_before (datetime | None) – Request a list of jobs, using a filter for time.

  • name_contains (str | None) – Request a list of jobs, using a search filter for name.

  • status_equals (str | None) – Request a list of jobs, using a filter for status.

  • sort_order (str | None) – The sort order for the results. The default is Descending.

  • sort_by (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[AutoMLJob]

get_all_candidates(status_equals=<sagemaker_core.main.utils.Unassigned object>, candidate_name_equals=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

List the candidates created for the job.

Parameters:
  • status_equals (str | None) – List the candidates for the job and filter by status.

  • candidate_name_equals (str | None) – List the candidates for the job and filter by candidate name.

  • sort_order (str | None) – The sort order for the results. The default is Ascending.

  • sort_by (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[AutoMLCandidate]

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

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

refresh()[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.

Return type:

AutoMLJob | None

stop()[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.

Return type:

None

wait(poll=5, timeout=None)[source]

Wait for a AutoMLJob resource.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.AutoMLJobV2(*, auto_ml_job_name, auto_ml_job_arn=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_input_data_config=<sagemaker_core.main.utils.Unassigned object>, output_data_config=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_objective=<sagemaker_core.main.utils.Unassigned object>, auto_ml_problem_type_config=<sagemaker_core.main.utils.Unassigned object>, auto_ml_problem_type_config_name=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, end_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, partial_failure_reasons=<sagemaker_core.main.utils.Unassigned object>, best_candidate=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_status=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_secondary_status=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_artifacts=<sagemaker_core.main.utils.Unassigned object>, resolved_attributes=<sagemaker_core.main.utils.Unassigned object>, model_deploy_config=<sagemaker_core.main.utils.Unassigned object>, model_deploy_result=<sagemaker_core.main.utils.Unassigned object>, data_split_config=<sagemaker_core.main.utils.Unassigned object>, security_config=<sagemaker_core.main.utils.Unassigned object>, auto_ml_compute_config=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource AutoMLJobV2

Parameters:
  • auto_ml_job_name (str)

  • auto_ml_job_arn (str | None)

  • auto_ml_job_input_data_config (List[AutoMLJobChannel] | None)

  • output_data_config (AutoMLOutputDataConfig | None)

  • role_arn (str | None)

  • auto_ml_job_objective (AutoMLJobObjective | None)

  • auto_ml_problem_type_config (AutoMLProblemTypeConfig | None)

  • auto_ml_problem_type_config_name (str | None)

  • creation_time (datetime | None)

  • end_time (datetime | None)

  • last_modified_time (datetime | None)

  • failure_reason (str | None)

  • partial_failure_reasons (List[AutoMLPartialFailureReason] | None)

  • best_candidate (AutoMLCandidate | None)

  • auto_ml_job_status (str | None)

  • auto_ml_job_secondary_status (str | None)

  • auto_ml_job_artifacts (AutoMLJobArtifacts | None)

  • resolved_attributes (AutoMLResolvedAttributes | None)

  • model_deploy_config (ModelDeployConfig | None)

  • model_deploy_result (ModelDeployResult | None)

  • data_split_config (AutoMLDataSplitConfig | None)

  • security_config (AutoMLSecurityConfig | None)

  • auto_ml_compute_config (AutoMLComputeConfig | None)

auto_ml_job_name

Returns the name of the AutoML job V2.

Type:

str

auto_ml_job_arn

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

Type:

str | None

auto_ml_job_input_data_config

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

Type:

List[sagemaker_core.main.shapes.AutoMLJobChannel] | None

output_data_config

Returns the job’s output data config.

Type:

sagemaker_core.main.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 | 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 | None

auto_ml_job_secondary_status

Returns the secondary status of the AutoML job V2.

Type:

str | None

auto_ml_job_objective

Returns the job’s objective.

Type:

sagemaker_core.main.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.main.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 | 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 | None

partial_failure_reasons

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

Type:

List[sagemaker_core.main.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.main.shapes.AutoMLCandidate | None

auto_ml_job_artifacts
Type:

sagemaker_core.main.shapes.AutoMLJobArtifacts | None

resolved_attributes

Returns the resolved attributes used by the AutoML job V2.

Type:

sagemaker_core.main.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.main.shapes.ModelDeployConfig | None

model_deploy_result

Provides information about endpoint for the model deployment.

Type:

sagemaker_core.main.shapes.ModelDeployResult | None

data_split_config

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

Type:

sagemaker_core.main.shapes.AutoMLDataSplitConfig | None

security_config

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

Type:

sagemaker_core.main.shapes.AutoMLSecurityConfig | None

auto_ml_compute_config

The compute configuration used for the AutoML job V2.

Type:

sagemaker_core.main.shapes.AutoMLComputeConfig | None

classmethod create(auto_ml_job_name, auto_ml_job_input_data_config, output_data_config, auto_ml_problem_type_config, role_arn, tags=<sagemaker_core.main.utils.Unassigned object>, security_config=<sagemaker_core.main.utils.Unassigned object>, auto_ml_job_objective=<sagemaker_core.main.utils.Unassigned object>, model_deploy_config=<sagemaker_core.main.utils.Unassigned object>, data_split_config=<sagemaker_core.main.utils.Unassigned object>, auto_ml_compute_config=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a AutoMLJobV2 resource

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

  • auto_ml_job_input_data_config (List[AutoMLJobChannel]) – 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 (AutoMLOutputDataConfig) – Provides information about encryption and the Amazon S3 output path needed to store artifacts from an AutoML job.

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

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

  • tags (List[Tag] | None) – 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 (AutoMLSecurityConfig | None) – The security configuration for traffic encryption or Amazon VPC settings.

  • auto_ml_job_objective (AutoMLJobObjective | None) – 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 (ModelDeployConfig | None) – Specifies how to generate the endpoint name for an automatic one-click Autopilot model deployment.

  • data_split_config (AutoMLDataSplitConfig | None) – 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_compute_config (AutoMLComputeConfig | None) – Specifies the compute configuration for the AutoML job V2.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

AutoMLJobV2 | None

classmethod get(auto_ml_job_name, session=None, region=None)[source]

Get a AutoMLJobV2 resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

AutoMLJobV2 | None

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

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

refresh()[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.

Return type:

AutoMLJobV2 | None

wait(poll=5, timeout=None)[source]

Wait for a AutoMLJobV2 resource.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.Base[source]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}

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

class sagemaker_core.main.resources.Cluster(*, cluster_name, cluster_arn=<sagemaker_core.main.utils.Unassigned object>, cluster_status=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, failure_message=<sagemaker_core.main.utils.Unassigned object>, instance_groups=<sagemaker_core.main.utils.Unassigned object>, vpc_config=<sagemaker_core.main.utils.Unassigned object>, orchestrator=<sagemaker_core.main.utils.Unassigned object>, node_recovery=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Cluster

Parameters:
  • cluster_name (str)

  • cluster_arn (str | None)

  • cluster_status (str | None)

  • creation_time (datetime | None)

  • failure_message (str | None)

  • instance_groups (List[ClusterInstanceGroupDetails] | None)

  • vpc_config (VpcConfig | None)

  • orchestrator (ClusterOrchestrator | None)

  • node_recovery (str | None)

cluster_arn

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

Type:

str | None

cluster_status

The status of the SageMaker HyperPod cluster.

Type:

str | None

instance_groups

The instance groups of the SageMaker HyperPod cluster.

Type:

List[sagemaker_core.main.shapes.ClusterInstanceGroupDetails] | None

cluster_name

The name of the SageMaker HyperPod cluster.

Type:

str

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 | None

vpc_config
Type:

sagemaker_core.main.shapes.VpcConfig | None

orchestrator

The type of orchestrator used for the SageMaker HyperPod cluster.

Type:

sagemaker_core.main.shapes.ClusterOrchestrator | None

node_recovery

The node recovery mode configured for the SageMaker HyperPod cluster.

Type:

str | None

batch_delete_nodes(node_ids, session=None, region=None)[source]

Deletes specific nodes within a SageMaker HyperPod cluster.

Parameters:
  • node_ids (List[str]) – 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.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

  • ResourceNotFound – Resource being access is not found.

Return type:

BatchDeleteClusterNodesResponse | None

classmethod create(cluster_name, instance_groups, vpc_config=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, orchestrator=<sagemaker_core.main.utils.Unassigned object>, node_recovery=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Cluster resource

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

  • instance_groups (List[ClusterInstanceGroupSpecification]) – The instance groups to be created in the SageMaker HyperPod cluster.

  • vpc_config (VpcConfig | None)

  • tags (List[Tag] | None) – 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 (ClusterOrchestrator | None) – 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 (EKS) cluster as the orchestrator.

  • node_recovery (str | None) – 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.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

  • 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

Return type:

Cluster | None

delete()[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.

  • ResourceNotFound – Resource being access is not found.

Return type:

None

classmethod get(cluster_name, session=None, region=None)[source]

Get a Cluster resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Cluster | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Cluster resources

Parameters:
  • creation_time_after (datetime | None) – 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 (datetime | None) – 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 – Set the maximum number of SageMaker HyperPod clusters to list.

  • name_contains (str | None) – 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 (str | None) – The field by which to sort results. The default value is CREATION_TIME.

  • sort_order (str | None) – The sort order for results. The default value is Ascending.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[Cluster]

get_all_nodes(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, instance_group_name_contains=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

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

Parameters:
  • creation_time_after (datetime | None) – 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 (datetime | None) – 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 (str | None) – 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 (str | None) – The field by which to sort results. The default value is CREATION_TIME.

  • sort_order (str | None) – The sort order for results. The default value is Ascending.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[ClusterNodeDetails]

get_node(node_id, session=None, region=None)[source]

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

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ClusterNodeDetails | None

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

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

refresh()[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.

Return type:

Cluster | None

update(instance_groups, node_recovery=<sagemaker_core.main.utils.Unassigned object>)[source]

Update 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']     `

  • 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.

Parameters:
  • instance_groups (List[ClusterInstanceGroupSpecification])

  • node_recovery (str | None)

Return type:

Cluster | None

update_software(session=None, region=None)[source]

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

Parameters:
  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a Cluster resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a Cluster resource to reach certain status.

Parameters:
  • target_status (Literal['Creating', 'Deleting', 'Failed', 'InService', 'RollingBack', 'SystemUpdating', 'Updating']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.CodeRepository(*, code_repository_name, code_repository_arn=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, git_config=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource CodeRepository

Parameters:
  • code_repository_name (str)

  • code_repository_arn (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • git_config (GitConfig | None)

code_repository_name

The name of the Git repository.

Type:

str

code_repository_arn

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

Type:

str | 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.main.shapes.GitConfig | None

classmethod create(code_repository_name, git_config, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a CodeRepository resource

Parameters:
  • code_repository_name (str) – 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 (GitConfig) – 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 (List[Tag] | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

CodeRepository | None

delete()[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']     `

Return type:

None

classmethod get(code_repository_name, session=None, region=None)[source]

Get a CodeRepository resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

CodeRepository | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Gets a list of the Git repositories in your account.

Parameters:
  • creation_time_after (datetime | None) – A filter that returns only Git repositories that were created after the specified time.

  • creation_time_before (datetime | None) – A filter that returns only Git repositories that were created before the specified time.

  • last_modified_time_after (datetime | None) – A filter that returns only Git repositories that were last modified after the specified time.

  • last_modified_time_before (datetime | None) – 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 (str | None) – 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 (str | None) – The field to sort results by. The default is Name.

  • sort_order (str | None) – The sort order for results. The default is Ascending.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[CodeRepository]

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

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

refresh()[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']     `

Return type:

CodeRepository | None

update(git_config=<sagemaker_core.main.utils.Unassigned object>)[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.

Parameters:

git_config (GitConfigForUpdate | None)

Return type:

CodeRepository | None

class sagemaker_core.main.resources.CompilationJob(*, compilation_job_name, compilation_job_arn=<sagemaker_core.main.utils.Unassigned object>, compilation_job_status=<sagemaker_core.main.utils.Unassigned object>, compilation_start_time=<sagemaker_core.main.utils.Unassigned object>, compilation_end_time=<sagemaker_core.main.utils.Unassigned object>, stopping_condition=<sagemaker_core.main.utils.Unassigned object>, inference_image=<sagemaker_core.main.utils.Unassigned object>, model_package_version_arn=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, model_artifacts=<sagemaker_core.main.utils.Unassigned object>, model_digests=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, input_config=<sagemaker_core.main.utils.Unassigned object>, output_config=<sagemaker_core.main.utils.Unassigned object>, vpc_config=<sagemaker_core.main.utils.Unassigned object>, derived_information=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource CompilationJob

Parameters:
  • compilation_job_name (str)

  • compilation_job_arn (str | None)

  • compilation_job_status (str | None)

  • compilation_start_time (datetime | None)

  • compilation_end_time (datetime | None)

  • stopping_condition (StoppingCondition | None)

  • inference_image (str | None)

  • model_package_version_arn (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • failure_reason (str | None)

  • model_artifacts (ModelArtifacts | None)

  • model_digests (ModelDigests | None)

  • role_arn (str | None)

  • input_config (InputConfig | None)

  • output_config (OutputConfig | None)

  • vpc_config (NeoVpcConfig | None)

  • derived_information (DerivedInformation | None)

compilation_job_name

The name of the model compilation job.

Type:

str

compilation_job_arn

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

Type:

str | None

compilation_job_status

The status of the model compilation job.

Type:

str | None

stopping_condition

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

Type:

sagemaker_core.main.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 | 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.main.shapes.ModelArtifacts | None

role_arn

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

Type:

str | 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.main.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.main.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 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 | 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 | None

model_digests

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

Type:

sagemaker_core.main.shapes.ModelDigests | 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.main.shapes.NeoVpcConfig | None

derived_information

Information that SageMaker Neo automatically derived about the model.

Type:

sagemaker_core.main.shapes.DerivedInformation | None

classmethod create(compilation_job_name, role_arn, output_config, stopping_condition, model_package_version_arn=<sagemaker_core.main.utils.Unassigned object>, input_config=<sagemaker_core.main.utils.Unassigned object>, vpc_config=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a CompilationJob resource

Parameters:
  • compilation_job_name (str) – 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 (str) – The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. During model compilation, Amazon SageMaker 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, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker Roles.

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

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

  • model_package_version_arn (str | None) – 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 (InputConfig | None) – 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.

  • vpc_config (NeoVpcConfig | None) – 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 (List[Tag] | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

CompilationJob | None

delete()[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.

Return type:

None

classmethod get(compilation_job_name, session=None, region=None)[source]

Get a CompilationJob resource

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

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

CompilationJob | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, status_equals=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (datetime | None) – A filter that returns the model compilation jobs that were created after a specified time.

  • creation_time_before (datetime | None) – A filter that returns the model compilation jobs that were created before a specified time.

  • last_modified_time_after (datetime | None) – A filter that returns the model compilation jobs that were modified after a specified time.

  • last_modified_time_before (datetime | None) – A filter that returns the model compilation jobs that were modified before a specified time.

  • name_contains (str | None) – A filter that returns the model compilation jobs whose name contains a specified string.

  • status_equals (str | None) – A filter that retrieves model compilation jobs with a specific CompilationJobStatus status.

  • sort_by (str | None) – The field by which to sort results. The default is CreationTime.

  • sort_order (str | None) – The sort order for results. The default is Ascending.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[CompilationJob]

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

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

refresh()[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.

Return type:

CompilationJob | None

stop()[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.

Return type:

None

wait(poll=5, timeout=None)[source]

Wait for a CompilationJob resource.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.Context(*, context_name, context_arn=<sagemaker_core.main.utils.Unassigned object>, source=<sagemaker_core.main.utils.Unassigned object>, context_type=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, created_by=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_by=<sagemaker_core.main.utils.Unassigned object>, lineage_group_arn=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Context

Parameters:
  • context_name (str)

  • context_arn (str | None)

  • source (ContextSource | None)

  • context_type (str | None)

  • description (str | None)

  • properties (Dict[str, str] | None)

  • creation_time (datetime | None)

  • created_by (UserContext | None)

  • last_modified_time (datetime | None)

  • last_modified_by (UserContext | None)

  • lineage_group_arn (str | None)

context_name

The name of the context.

Type:

str

context_arn

The Amazon Resource Name (ARN) of the context.

Type:

str | None

source

The source of the context.

Type:

sagemaker_core.main.shapes.ContextSource | None

context_type

The type of the context.

Type:

str | None

description

The description of the context.

Type:

str | None

properties

A list of the context’s properties.

Type:

Dict[str, str] | None

creation_time

When the context was created.

Type:

datetime.datetime | None

created_by
Type:

sagemaker_core.main.shapes.UserContext | None

last_modified_time

When the context was last modified.

Type:

datetime.datetime | None

last_modified_by
Type:

sagemaker_core.main.shapes.UserContext | None

lineage_group_arn

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

Type:

str | None

classmethod create(context_name, source, context_type, description=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Context resource

Parameters:
  • context_name (str) – The name of the context. Must be unique to your account in an Amazon Web Services Region.

  • source (ContextSource) – The source type, ID, and URI.

  • context_type (str) – The context type.

  • description (str | None) – The description of the context.

  • properties (Dict[str, str] | None) – A list of properties to add to the context.

  • tags (List[Tag] | None) – A list of tags to apply to the context.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Context | None

delete()[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.

Return type:

None

classmethod get(context_name, session=None, region=None)[source]

Get a Context resource

Parameters:
  • context_name (str) – The name of the context to describe.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Context | None

classmethod get_all(source_uri=<sagemaker_core.main.utils.Unassigned object>, context_type=<sagemaker_core.main.utils.Unassigned object>, created_after=<sagemaker_core.main.utils.Unassigned object>, created_before=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Context resources

Parameters:
  • source_uri (str | None) – A filter that returns only contexts with the specified source URI.

  • context_type (str | None) – A filter that returns only contexts of the specified type.

  • created_after (datetime | None) – A filter that returns only contexts created on or after the specified time.

  • created_before (datetime | None) – A filter that returns only contexts created on or before the specified time.

  • sort_by (str | None) – The property used to sort results. The default value is CreationTime.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[Context]

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

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

refresh()[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.

Return type:

Context | None

update(description=<sagemaker_core.main.utils.Unassigned object>, properties=<sagemaker_core.main.utils.Unassigned object>, properties_to_remove=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a Context resource

Parameters:
  • properties_to_remove (List[str] | None) – A list of properties to remove.

  • description (str | None)

  • properties (Dict[str, str] | None)

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.

Return type:

Context | None

class sagemaker_core.main.resources.DataQualityJobDefinition(*, job_definition_name, job_definition_arn=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, data_quality_baseline_config=<sagemaker_core.main.utils.Unassigned object>, data_quality_app_specification=<sagemaker_core.main.utils.Unassigned object>, data_quality_job_input=<sagemaker_core.main.utils.Unassigned object>, data_quality_job_output_config=<sagemaker_core.main.utils.Unassigned object>, job_resources=<sagemaker_core.main.utils.Unassigned object>, network_config=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, stopping_condition=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource DataQualityJobDefinition

Parameters:
  • job_definition_name (str)

  • job_definition_arn (str | None)

  • creation_time (datetime | None)

  • data_quality_baseline_config (DataQualityBaselineConfig | None)

  • data_quality_app_specification (DataQualityAppSpecification | None)

  • data_quality_job_input (DataQualityJobInput | None)

  • data_quality_job_output_config (MonitoringOutputConfig | None)

  • job_resources (MonitoringResources | None)

  • network_config (MonitoringNetworkConfig | None)

  • role_arn (str | None)

  • stopping_condition (MonitoringStoppingCondition | None)

job_definition_arn

The Amazon Resource Name (ARN) of the data quality monitoring job definition.

Type:

str | None

job_definition_name

The name of the data quality monitoring job definition.

Type:

str

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.main.shapes.DataQualityAppSpecification | None

data_quality_job_input

The list of inputs for the data quality monitoring job. Currently endpoints are supported.

Type:

sagemaker_core.main.shapes.DataQualityJobInput | None

data_quality_job_output_config
Type:

sagemaker_core.main.shapes.MonitoringOutputConfig | None

job_resources
Type:

sagemaker_core.main.shapes.MonitoringResources | 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 | None

data_quality_baseline_config

The constraints and baselines for the data quality monitoring job definition.

Type:

sagemaker_core.main.shapes.DataQualityBaselineConfig | None

network_config

The networking configuration for the data quality monitoring job.

Type:

sagemaker_core.main.shapes.MonitoringNetworkConfig | None

stopping_condition
Type:

sagemaker_core.main.shapes.MonitoringStoppingCondition | None

classmethod create(job_definition_name, data_quality_app_specification, data_quality_job_input, data_quality_job_output_config, job_resources, role_arn, data_quality_baseline_config=<sagemaker_core.main.utils.Unassigned object>, network_config=<sagemaker_core.main.utils.Unassigned object>, stopping_condition=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a DataQualityJobDefinition resource

Parameters:
  • job_definition_name (str) – The name for the monitoring job definition.

  • data_quality_app_specification (DataQualityAppSpecification) – Specifies the container that runs the monitoring job.

  • data_quality_job_input (DataQualityJobInput) – A list of inputs for the monitoring job. Currently endpoints are supported as monitoring inputs.

  • data_quality_job_output_config (MonitoringOutputConfig)

  • job_resources (MonitoringResources)

  • role_arn (str) – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.

  • data_quality_baseline_config (DataQualityBaselineConfig | None) – Configures the constraints and baselines for the monitoring job.

  • network_config (MonitoringNetworkConfig | None) – Specifies networking configuration for the monitoring job.

  • stopping_condition (MonitoringStoppingCondition | None)

  • tags (List[Tag] | None) – (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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

DataQualityJobDefinition | None

delete()[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.

Return type:

None

classmethod get(job_definition_name, session=None, region=None)[source]

Get a DataQualityJobDefinition resource

Parameters:
  • job_definition_name (str) – The name of the data quality monitoring job definition to describe.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

DataQualityJobDefinition | None

classmethod get_all(endpoint_name=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all DataQualityJobDefinition resources

Parameters:
  • endpoint_name (str | None) – A filter that lists the data quality job definitions associated with the specified endpoint.

  • sort_by (str | None) – The field to sort results by. The default is CreationTime.

  • sort_order (str | None) – 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 (str | None) – 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 (datetime | None) – A filter that returns only data quality monitoring job definitions created before the specified time.

  • creation_time_after (datetime | None) – A filter that returns only data quality monitoring job definitions created after the specified time.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[DataQualityJobDefinition]

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

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

refresh()[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.

Return type:

DataQualityJobDefinition | None

class sagemaker_core.main.resources.Device(*, device_name, device_fleet_name, device_arn=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, iot_thing_name=<sagemaker_core.main.utils.Unassigned object>, registration_time=<sagemaker_core.main.utils.Unassigned object>, latest_heartbeat=<sagemaker_core.main.utils.Unassigned object>, models=<sagemaker_core.main.utils.Unassigned object>, max_models=<sagemaker_core.main.utils.Unassigned object>, next_token=<sagemaker_core.main.utils.Unassigned object>, agent_version=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Device

Parameters:
  • device_name (str)

  • device_fleet_name (str)

  • device_arn (str | None)

  • description (str | None)

  • iot_thing_name (str | None)

  • registration_time (datetime | None)

  • latest_heartbeat (datetime | None)

  • models (List[EdgeModel] | None)

  • max_models (int | None)

  • next_token (str | None)

  • agent_version (str | None)

device_name

The unique identifier of the device.

Type:

str

device_fleet_name

The name of the fleet the device belongs to.

Type:

str

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 | None

description

A description of the device.

Type:

str | None

iot_thing_name

The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.

Type:

str | None

latest_heartbeat

The last heartbeat received from the device.

Type:

datetime.datetime | None

models

Models on the device.

Type:

List[sagemaker_core.main.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 | None

agent_version

Edge Manager agent version.

Type:

str | None

classmethod get(device_name, device_fleet_name, next_token=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get a Device resource

Parameters:
  • device_name (str) – The unique ID of the device.

  • device_fleet_name (str) – The name of the fleet the devices belong to.

  • next_token (str | None) – Next token of device description.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Device | None

classmethod get_all(latest_heartbeat_after=<sagemaker_core.main.utils.Unassigned object>, model_name=<sagemaker_core.main.utils.Unassigned object>, device_fleet_name=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (datetime | None) – Select fleets where the job was updated after X

  • model_name (str | None) – A filter that searches devices that contains this name in any of their models.

  • device_fleet_name (str | None) – Filter for fleets containing this name in their device fleet name.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[Device]

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

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

refresh()[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.

Return type:

Device | None

class sagemaker_core.main.resources.DeviceFleet(*, device_fleet_name, device_fleet_arn=<sagemaker_core.main.utils.Unassigned object>, output_config=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, iot_role_alias=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource DeviceFleet

Parameters:
  • device_fleet_name (str)

  • device_fleet_arn (str | None)

  • output_config (EdgeOutputConfig | None)

  • description (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • role_arn (str | None)

  • iot_role_alias (str | None)

device_fleet_name

The name of the fleet.

Type:

str

device_fleet_arn

The The Amazon Resource Name (ARN) of the fleet.

Type:

str | None

output_config

The output configuration for storing sampled data.

Type:

sagemaker_core.main.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 | None

role_arn

The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet of Things (IoT).

Type:

str | None

iot_role_alias

The Amazon Resource Name (ARN) alias created in Amazon Web Services Internet of Things (IoT).

Type:

str | None

classmethod create(device_fleet_name, output_config, role_arn=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, enable_iot_role_alias=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a DeviceFleet resource

Parameters:
  • device_fleet_name (str) – The name of the fleet that the device belongs to.

  • output_config (EdgeOutputConfig) – The output configuration for storing sample data collected by the fleet.

  • role_arn (str | None) – The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet of Things (IoT).

  • description (str | None) – A description of the fleet.

  • tags (List[Tag] | None) – Creates tags for the specified fleet.

  • enable_iot_role_alias (bool | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

DeviceFleet | None

delete()[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.

Return type:

None

deregister_devices(device_names, session=None, region=None)[source]

Deregisters the specified devices.

Parameters:
  • device_names (List[str]) – The unique IDs of the devices.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

None

classmethod get(device_fleet_name, session=None, region=None)[source]

Get a DeviceFleet resource

Parameters:
  • device_fleet_name (str) – The name of the fleet.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

DeviceFleet | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (datetime | None) – Filter fleets where packaging job was created after specified time.

  • creation_time_before (datetime | None) – Filter fleets where the edge packaging job was created before specified time.

  • last_modified_time_after (datetime | None) – Select fleets where the job was updated after X

  • last_modified_time_before (datetime | None) – Select fleets where the job was updated before X

  • name_contains (str | None) – Filter for fleets containing this name in their fleet device name.

  • sort_by (str | None) – The column to sort by.

  • sort_order (str | None) – What direction to sort in.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[DeviceFleet]

get_report(session=None, region=None)[source]

Describes a fleet.

Parameters:
  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

GetDeviceFleetReportResponse | None

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

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

refresh()[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.

Return type:

DeviceFleet | None

register_devices(devices, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Register devices.

Parameters:
  • devices (List[Device]) – A list of devices to register with SageMaker Edge Manager.

  • tags (List[Tag] | None) – The tags associated with devices.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

update(output_config, role_arn=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, enable_iot_role_alias=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a DeviceFleet resource

Parameters:
  • enable_iot_role_alias (bool | None) – 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”.

  • output_config (EdgeOutputConfig)

  • role_arn (str | None)

  • description (str | None)

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.

Return type:

DeviceFleet | None

update_devices(devices, session=None, region=None)[source]

Updates one or more devices in a fleet.

Parameters:
  • devices (List[Device]) – List of devices to register with Edge Manager agent.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

None

class sagemaker_core.main.resources.Domain(*, domain_id, domain_arn=<sagemaker_core.main.utils.Unassigned object>, domain_name=<sagemaker_core.main.utils.Unassigned object>, home_efs_file_system_id=<sagemaker_core.main.utils.Unassigned object>, single_sign_on_managed_application_instance_id=<sagemaker_core.main.utils.Unassigned object>, single_sign_on_application_arn=<sagemaker_core.main.utils.Unassigned object>, status=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, security_group_id_for_domain_boundary=<sagemaker_core.main.utils.Unassigned object>, auth_mode=<sagemaker_core.main.utils.Unassigned object>, default_user_settings=<sagemaker_core.main.utils.Unassigned object>, domain_settings=<sagemaker_core.main.utils.Unassigned object>, app_network_access_type=<sagemaker_core.main.utils.Unassigned object>, home_efs_file_system_kms_key_id=<sagemaker_core.main.utils.Unassigned object>, subnet_ids=<sagemaker_core.main.utils.Unassigned object>, url=<sagemaker_core.main.utils.Unassigned object>, vpc_id=<sagemaker_core.main.utils.Unassigned object>, kms_key_id=<sagemaker_core.main.utils.Unassigned object>, app_security_group_management=<sagemaker_core.main.utils.Unassigned object>, tag_propagation=<sagemaker_core.main.utils.Unassigned object>, default_space_settings=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Domain

Parameters:
  • domain_id (str)

  • domain_arn (str | None)

  • domain_name (str | None)

  • home_efs_file_system_id (str | None)

  • single_sign_on_managed_application_instance_id (str | None)

  • single_sign_on_application_arn (str | None)

  • status (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • failure_reason (str | None)

  • security_group_id_for_domain_boundary (str | None)

  • auth_mode (str | None)

  • default_user_settings (UserSettings | None)

  • domain_settings (DomainSettings | None)

  • app_network_access_type (str | None)

  • home_efs_file_system_kms_key_id (str | None)

  • subnet_ids (List[str] | None)

  • url (str | None)

  • vpc_id (str | None)

  • kms_key_id (str | None)

  • app_security_group_management (str | None)

  • tag_propagation (str | None)

  • default_space_settings (DefaultSpaceSettings | None)

domain_arn

The domain’s Amazon Resource Name (ARN).

Type:

str | None

domain_id

The domain ID.

Type:

str

domain_name

The domain name.

Type:

str | None

home_efs_file_system_id

The ID of the Amazon Elastic File System managed by this Domain.

Type:

str | None

single_sign_on_managed_application_instance_id

The IAM Identity Center managed application instance ID.

Type:

str | None

single_sign_on_application_arn

The ARN of the application managed by SageMaker in IAM Identity Center. This value is only returned for domains created after October 1, 2023.

Type:

str | None

status

The status.

Type:

str | 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 | 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 | None

auth_mode

The domain’s authentication mode.

Type:

str | 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.main.shapes.UserSettings | None

domain_settings

A collection of Domain settings.

Type:

sagemaker_core.main.shapes.DomainSettings | 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, which allows direct internet access VpcOnly - All traffic is through the specified VPC and subnets

Type:

str | None

home_efs_file_system_kms_key_id

Use KmsKeyId.

Type:

str | None

subnet_ids

The VPC subnets that the domain uses for communication.

Type:

List[str] | None

url

The domain’s URL.

Type:

str | None

vpc_id

The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.

Type:

str | None

kms_key_id

The Amazon Web Services KMS customer managed key used to encrypt the EFS volume attached to the domain.

Type:

str | 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 | None

tag_propagation

Indicates whether custom tag propagation is supported for the domain.

Type:

str | None

default_space_settings

The default settings for shared spaces that users create in the domain.

Type:

sagemaker_core.main.shapes.DefaultSpaceSettings | None

classmethod create(domain_name, auth_mode, default_user_settings, subnet_ids, vpc_id, domain_settings=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, app_network_access_type=<sagemaker_core.main.utils.Unassigned object>, home_efs_file_system_kms_key_id=<sagemaker_core.main.utils.Unassigned object>, kms_key_id=<sagemaker_core.main.utils.Unassigned object>, app_security_group_management=<sagemaker_core.main.utils.Unassigned object>, tag_propagation=<sagemaker_core.main.utils.Unassigned object>, default_space_settings=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Domain resource

Parameters:
  • domain_name (str) – A name for the domain.

  • auth_mode (str) – The mode of authentication that members use to access the domain.

  • default_user_settings (UserSettings) – 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.

  • subnet_ids (List[str]) – The VPC subnets that the domain uses for communication.

  • vpc_id (str) – The ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication.

  • domain_settings (DomainSettings | None) – A collection of Domain settings.

  • tags (List[Tag] | None) – 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_type (str | None) – 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, which allows direct internet access VpcOnly - All traffic is through the specified VPC and subnets

  • home_efs_file_system_kms_key_id (str | None) – Use KmsKeyId.

  • kms_key_id (str | None) – SageMaker 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 (str | None) – 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.

  • tag_propagation (str | None) – Indicates whether custom tag propagation is supported for the domain. Defaults to DISABLED.

  • default_space_settings (DefaultSpaceSettings | None) – The default settings for shared spaces that users create in the domain.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Domain | None

delete(retention_policy=<sagemaker_core.main.utils.Unassigned object>)[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.

Parameters:

retention_policy (RetentionPolicy | None)

Return type:

None

classmethod get(domain_id, session=None, region=None)[source]

Get a Domain resource

Parameters:
  • domain_id (str) – The domain ID.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Domain | None

classmethod get_all(session=None, region=None)[source]

Get all Domain resources.

Parameters:
  • session (Session | None) – Boto3 session.

  • region (str | None) – Region name.

Returns:

Iterator for listed Domain resources.

Return type:

ResourceIterator[Domain]

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

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

refresh()[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.

Return type:

Domain | None

update(default_user_settings=<sagemaker_core.main.utils.Unassigned object>, domain_settings_for_update=<sagemaker_core.main.utils.Unassigned object>, app_security_group_management=<sagemaker_core.main.utils.Unassigned object>, default_space_settings=<sagemaker_core.main.utils.Unassigned object>, subnet_ids=<sagemaker_core.main.utils.Unassigned object>, app_network_access_type=<sagemaker_core.main.utils.Unassigned object>, tag_propagation=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a Domain resource

Parameters:
  • domain_settings_for_update (DomainSettingsForUpdate | None) – A collection of DomainSettings configuration values to update.

  • default_user_settings (UserSettings | None)

  • app_security_group_management (str | None)

  • default_space_settings (DefaultSpaceSettings | None)

  • subnet_ids (List[str] | None)

  • app_network_access_type (str | None)

  • tag_propagation (str | None)

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.

Return type:

Domain | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a Domain resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a Domain resource to reach certain status.

Parameters:
  • target_status (Literal['Deleting', 'Failed', 'InService', 'Pending', 'Updating', 'Update_Failed', 'Delete_Failed']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.EdgeDeploymentPlan(*, edge_deployment_plan_name, edge_deployment_plan_arn=<sagemaker_core.main.utils.Unassigned object>, model_configs=<sagemaker_core.main.utils.Unassigned object>, device_fleet_name=<sagemaker_core.main.utils.Unassigned object>, edge_deployment_success=<sagemaker_core.main.utils.Unassigned object>, edge_deployment_pending=<sagemaker_core.main.utils.Unassigned object>, edge_deployment_failed=<sagemaker_core.main.utils.Unassigned object>, stages=<sagemaker_core.main.utils.Unassigned object>, next_token=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource EdgeDeploymentPlan

Parameters:
  • edge_deployment_plan_name (str)

  • edge_deployment_plan_arn (str | None)

  • model_configs (List[EdgeDeploymentModelConfig] | None)

  • device_fleet_name (str | None)

  • edge_deployment_success (int | None)

  • edge_deployment_pending (int | None)

  • edge_deployment_failed (int | None)

  • stages (List[DeploymentStageStatusSummary] | None)

  • next_token (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

edge_deployment_plan_arn

The ARN of edge deployment plan.

Type:

str | None

edge_deployment_plan_name

The name of the edge deployment plan.

Type:

str

model_configs

List of models associated with the edge deployment plan.

Type:

List[sagemaker_core.main.shapes.EdgeDeploymentModelConfig] | None

device_fleet_name

The device fleet used for this edge deployment plan.

Type:

str | None

stages

List of stages in the edge deployment plan.

Type:

List[sagemaker_core.main.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 | 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, model_configs, device_fleet_name, stages=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a EdgeDeploymentPlan resource

Parameters:
  • edge_deployment_plan_name (str) – The name of the edge deployment plan.

  • model_configs (List[EdgeDeploymentModelConfig]) – List of models associated with the edge deployment plan.

  • device_fleet_name (str | object) – The device fleet used for this edge deployment plan.

  • stages (List[DeploymentStage] | None) – List of stages of the edge deployment plan. The number of stages is limited to 10 per deployment.

  • tags (List[Tag] | None) – List of tags with which to tag the edge deployment plan.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

EdgeDeploymentPlan | None

create_stage(session=None, region=None)[source]

Creates a new stage in an existing edge deployment plan.

Parameters:
  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

delete()[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.

Return type:

None

delete_stage(stage_name, session=None, region=None)[source]

Delete a stage in an edge deployment plan if (and only if) the stage is inactive.

Parameters:
  • stage_name (str) – The name of the stage.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

classmethod get(edge_deployment_plan_name, next_token=<sagemaker_core.main.utils.Unassigned object>, max_results=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get a EdgeDeploymentPlan resource

Parameters:
  • edge_deployment_plan_name (str) – The name of the deployment plan to describe.

  • next_token (str | None) – 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 (int | None) – The maximum number of results to select (50 by default).

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

EdgeDeploymentPlan | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, device_fleet_name_contains=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (datetime | None) – Selects edge deployment plans created after this time.

  • creation_time_before (datetime | None) – Selects edge deployment plans created before this time.

  • last_modified_time_after (datetime | None) – Selects edge deployment plans that were last updated after this time.

  • last_modified_time_before (datetime | None) – Selects edge deployment plans that were last updated before this time.

  • name_contains (str | None) – Selects edge deployment plans with names containing this name.

  • device_fleet_name_contains (str | None) – Selects edge deployment plans with a device fleet name containing this name.

  • sort_by (str | None) – The column by which to sort the edge deployment plans. Can be one of NAME, DEVICEFLEETNAME, CREATIONTIME, LASTMODIFIEDTIME.

  • sort_order (str | None) – The direction of the sorting (ascending or descending).

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[EdgeDeploymentPlan]

get_all_stage_devices(stage_name, exclude_devices_deployed_in_other_stage=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Lists devices allocated to the stage, containing detailed device information and deployment status.

Parameters:
  • stage_name (str) – The name of the stage in the deployment.

  • max_results – The maximum number of requests to select.

  • exclude_devices_deployed_in_other_stage (bool | None) – Toggle for excluding devices deployed in other stages.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[DeviceDeploymentSummary]

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

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

refresh(max_results=<sagemaker_core.main.utils.Unassigned object>)[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.

Parameters:

max_results (int | None)

Return type:

EdgeDeploymentPlan | None

start_stage(stage_name, session=None, region=None)[source]

Starts a stage in an edge deployment plan.

Parameters:
  • stage_name (str) – The name of the stage to start.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

None

stop_stage(stage_name, session=None, region=None)[source]

Stops a stage in an edge deployment plan.

Parameters:
  • stage_name (str) – The name of the stage to stop.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

None

class sagemaker_core.main.resources.EdgePackagingJob(*, edge_packaging_job_name, edge_packaging_job_arn=<sagemaker_core.main.utils.Unassigned object>, compilation_job_name=<sagemaker_core.main.utils.Unassigned object>, model_name=<sagemaker_core.main.utils.Unassigned object>, model_version=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, output_config=<sagemaker_core.main.utils.Unassigned object>, resource_key=<sagemaker_core.main.utils.Unassigned object>, edge_packaging_job_status=<sagemaker_core.main.utils.Unassigned object>, edge_packaging_job_status_message=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, model_artifact=<sagemaker_core.main.utils.Unassigned object>, model_signature=<sagemaker_core.main.utils.Unassigned object>, preset_deployment_output=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource EdgePackagingJob

Parameters:
  • edge_packaging_job_name (str)

  • edge_packaging_job_arn (str | None)

  • compilation_job_name (str | None)

  • model_name (str | None)

  • model_version (str | None)

  • role_arn (str | None)

  • output_config (EdgeOutputConfig | None)

  • resource_key (str | None)

  • edge_packaging_job_status (str | None)

  • edge_packaging_job_status_message (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • model_artifact (str | None)

  • model_signature (str | None)

  • preset_deployment_output (EdgePresetDeploymentOutput | None)

edge_packaging_job_arn

The Amazon Resource Name (ARN) of the edge packaging job.

Type:

str | None

edge_packaging_job_name

The name of the edge packaging job.

Type:

str

edge_packaging_job_status

The current status of the packaging job.

Type:

str | 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 | None

model_name

The name of the model.

Type:

str | None

model_version

The version of the model.

Type:

str | 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 | None

output_config

The output configuration for the edge packaging job.

Type:

sagemaker_core.main.shapes.EdgeOutputConfig | None

resource_key

The Amazon Web Services KMS key to use when encrypting the EBS volume the job run on.

Type:

str | None

edge_packaging_job_status_message

Returns a message describing the job status and error messages.

Type:

str | 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 | None

model_signature

The signature document of files in the model artifact.

Type:

str | None

preset_deployment_output

The output of a SageMaker Edge Manager deployable resource.

Type:

sagemaker_core.main.shapes.EdgePresetDeploymentOutput | None

classmethod create(edge_packaging_job_name, compilation_job_name, model_name, model_version, role_arn, output_config, resource_key=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a EdgePackagingJob resource

Parameters:
  • edge_packaging_job_name (str) – The name of the edge packaging job.

  • compilation_job_name (str | object) – The name of the SageMaker Neo compilation job that will be used to locate model artifacts for packaging.

  • model_name (str | object) – The name of the model.

  • model_version (str) – The version of the model.

  • role_arn (str) – 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 (EdgeOutputConfig) – Provides information about the output location for the packaged model.

  • resource_key (str | None) – The Amazon Web Services KMS key to use when encrypting the EBS volume the edge packaging job runs on.

  • tags (List[Tag] | None) – Creates tags for the packaging job.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

EdgePackagingJob | None

classmethod get(edge_packaging_job_name, session=None, region=None)[source]

Get a EdgePackagingJob resource

Parameters:
  • edge_packaging_job_name (str) – The name of the edge packaging job.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

EdgePackagingJob | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, model_name_contains=<sagemaker_core.main.utils.Unassigned object>, status_equals=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[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 (datetime | None) – Select jobs where the job was created after specified time.

  • creation_time_before (datetime | None) – Select jobs where the job was created before specified time.

  • last_modified_time_after (datetime | None) – Select jobs where the job was updated after specified time.

  • last_modified_time_before (datetime | None) – Select jobs where the job was updated before specified time.

  • name_contains (str | None) – Filter for jobs containing this name in their packaging job name.

  • model_name_contains (str | None) – Filter for jobs where the model name contains this string.

  • status_equals (str | None) – The job status to filter for.

  • sort_by (str | None) – Use to specify what column to sort by.

  • sort_order (str | None) – What direction to sort by.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[EdgePackagingJob]

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

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

refresh()[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.

Return type:

EdgePackagingJob | None

stop()[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']     `

Return type:

None

wait(poll=5, timeout=None)[source]

Wait for a EdgePackagingJob resource.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.Endpoint(*, endpoint_name, endpoint_arn=<sagemaker_core.main.utils.Unassigned object>, endpoint_config_name=<sagemaker_core.main.utils.Unassigned object>, production_variants=<sagemaker_core.main.utils.Unassigned object>, data_capture_config=<sagemaker_core.main.utils.Unassigned object>, endpoint_status=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, last_deployment_config=<sagemaker_core.main.utils.Unassigned object>, async_inference_config=<sagemaker_core.main.utils.Unassigned object>, pending_deployment_summary=<sagemaker_core.main.utils.Unassigned object>, explainer_config=<sagemaker_core.main.utils.Unassigned object>, shadow_production_variants=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Endpoint

Parameters:
  • endpoint_name (str)

  • endpoint_arn (str | None)

  • endpoint_config_name (str | None)

  • production_variants (List[ProductionVariantSummary] | None)

  • data_capture_config (DataCaptureConfigSummary | None)

  • endpoint_status (str | None)

  • failure_reason (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • last_deployment_config (DeploymentConfig | None)

  • async_inference_config (AsyncInferenceConfig | None)

  • pending_deployment_summary (PendingDeploymentSummary | None)

  • explainer_config (ExplainerConfig | None)

  • shadow_production_variants (List[ProductionVariantSummary] | None)

endpoint_name

Name of the endpoint.

Type:

str

endpoint_arn

The Amazon Resource Name (ARN) of the endpoint.

Type:

str | 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 | 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 | None

production_variants

An array of ProductionVariantSummary objects, one for each model hosted behind this endpoint.

Type:

List[sagemaker_core.main.shapes.ProductionVariantSummary] | None

data_capture_config
Type:

sagemaker_core.main.shapes.DataCaptureConfigSummary | None

failure_reason

If the status of the endpoint is Failed, the reason why it failed.

Type:

str | None

last_deployment_config

The most recent deployment configuration for the endpoint.

Type:

sagemaker_core.main.shapes.DeploymentConfig | None

async_inference_config

Returns the description of an endpoint configuration created using the CreateEndpointConfig API.

Type:

sagemaker_core.main.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.main.shapes.PendingDeploymentSummary | None

explainer_config

The configuration parameters for an explainer.

Type:

sagemaker_core.main.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.main.shapes.ProductionVariantSummary] | None

classmethod create(endpoint_name, endpoint_config_name, deployment_config=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Endpoint resource

Parameters:
  • endpoint_name (str) – 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 (str | object) – The name of an endpoint configuration. For more information, see CreateEndpointConfig.

  • deployment_config (DeploymentConfig | None)

  • tags (List[Tag] | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Endpoint | None

delete()[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']     `

Return type:

None

classmethod get(endpoint_name, session=None, region=None)[source]

Get a Endpoint resource

Parameters:
  • endpoint_name (str) – The name of the endpoint.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

Endpoint | None

classmethod get_all(sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, status_equals=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Endpoint resources

Parameters:
  • sort_by (str | None) – Sorts the list of results. The default is CreationTime.

  • sort_order (str | None) – 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 (str | None) – A string in endpoint names. This filter returns only endpoints whose name contains the specified string.

  • creation_time_before (datetime | None) – A filter that returns only endpoints that were created before the specified time (timestamp).

  • creation_time_after (datetime | None) – A filter that returns only endpoints with a creation time greater than or equal to the specified time (timestamp).

  • last_modified_time_before (datetime | None) – A filter that returns only endpoints that were modified before the specified timestamp.

  • last_modified_time_after (datetime | None) – A filter that returns only endpoints that were modified after the specified timestamp.

  • status_equals (str | None) – A filter that returns only endpoints with the specified status.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[Endpoint]

invoke(body, content_type=<sagemaker_core.main.utils.Unassigned object>, accept=<sagemaker_core.main.utils.Unassigned object>, custom_attributes=<sagemaker_core.main.utils.Unassigned object>, target_model=<sagemaker_core.main.utils.Unassigned object>, target_variant=<sagemaker_core.main.utils.Unassigned object>, target_container_hostname=<sagemaker_core.main.utils.Unassigned object>, inference_id=<sagemaker_core.main.utils.Unassigned object>, enable_explanations=<sagemaker_core.main.utils.Unassigned object>, inference_component_name=<sagemaker_core.main.utils.Unassigned object>, session_id=<sagemaker_core.main.utils.Unassigned object>, session=None, region=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 (Any) – 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 (str | None) – The MIME type of the input data in the request body.

  • accept (str | None) – The desired MIME type of the inference response from the model container.

  • custom_attributes (str | None) – 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 (str | None) – The model to request for inference when invoking a multi-model endpoint.

  • target_variant (str | None) – 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 (str | None) – 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 (str | None) – 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 (str | None) – 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 (str | None) – If the endpoint hosts one or more inference components, this parameter specifies the name of inference component to invoke.

  • session_id (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

InvokeEndpointOutput | None

invoke_async(input_location, content_type=<sagemaker_core.main.utils.Unassigned object>, accept=<sagemaker_core.main.utils.Unassigned object>, custom_attributes=<sagemaker_core.main.utils.Unassigned object>, inference_id=<sagemaker_core.main.utils.Unassigned object>, request_ttl_seconds=<sagemaker_core.main.utils.Unassigned object>, invocation_timeout_seconds=<sagemaker_core.main.utils.Unassigned object>, session=None, region=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 (str) – The Amazon S3 URI where the inference request payload is stored.

  • content_type (str | None) – The MIME type of the input data in the request body.

  • accept (str | None) – The desired MIME type of the inference response from the model container.

  • custom_attributes (str | None) – 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 (str | None) – The identifier for the inference request. Amazon SageMaker will generate an identifier for you if none is specified.

  • request_ttl_seconds (int | None) – 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 (int | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

InvokeEndpointAsyncOutput | None

invoke_with_response_stream(body, content_type=<sagemaker_core.main.utils.Unassigned object>, accept=<sagemaker_core.main.utils.Unassigned object>, custom_attributes=<sagemaker_core.main.utils.Unassigned object>, target_variant=<sagemaker_core.main.utils.Unassigned object>, target_container_hostname=<sagemaker_core.main.utils.Unassigned object>, inference_id=<sagemaker_core.main.utils.Unassigned object>, inference_component_name=<sagemaker_core.main.utils.Unassigned object>, session_id=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Invokes a model at the specified endpoint to return the inference response as a stream.

Parameters:
  • body (Any) – 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 (str | None) – The MIME type of the input data in the request body.

  • accept (str | None) – The desired MIME type of the inference response from the model container.

  • custom_attributes (str | None) – 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 (str | None) – 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 (str | None) – 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 (str | None) – An identifier that you assign to your request.

  • inference_component_name (str | None) – 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 (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

InvokeEndpointWithResponseStreamOutput | None

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

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

refresh()[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']     `

Return type:

Endpoint | None

update(retain_all_variant_properties=<sagemaker_core.main.utils.Unassigned object>, exclude_retained_variant_properties=<sagemaker_core.main.utils.Unassigned object>, deployment_config=<sagemaker_core.main.utils.Unassigned object>, retain_deployment_config=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a Endpoint resource

Parameters:
  • retain_all_variant_properties (bool | None) – 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 (List[VariantProperty] | None) – 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 (DeploymentConfig | None) – The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.

  • retain_deployment_config (bool | None) – 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.

Return type:

Endpoint | None

update_weights_and_capacities(desired_weights_and_capacities, session=None, region=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 (List[DesiredWeightAndCapacity]) – An object that provides new capacity and weight values for a variant.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a Endpoint resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a Endpoint resource to reach certain status.

Parameters:
  • target_status (Literal['OutOfService', 'Creating', 'Updating', 'SystemUpdating', 'RollingBack', 'InService', 'Deleting', 'Failed', 'UpdateRollbackFailed']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.EndpointConfig(*, endpoint_config_name, endpoint_config_arn=<sagemaker_core.main.utils.Unassigned object>, production_variants=<sagemaker_core.main.utils.Unassigned object>, data_capture_config=<sagemaker_core.main.utils.Unassigned object>, kms_key_id=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, async_inference_config=<sagemaker_core.main.utils.Unassigned object>, explainer_config=<sagemaker_core.main.utils.Unassigned object>, shadow_production_variants=<sagemaker_core.main.utils.Unassigned object>, execution_role_arn=<sagemaker_core.main.utils.Unassigned object>, vpc_config=<sagemaker_core.main.utils.Unassigned object>, enable_network_isolation=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource EndpointConfig

Parameters:
  • endpoint_config_name (str)

  • endpoint_config_arn (str | None)

  • production_variants (List[ProductionVariant] | None)

  • data_capture_config (DataCaptureConfig | None)

  • kms_key_id (str | None)

  • creation_time (datetime | None)

  • async_inference_config (AsyncInferenceConfig | None)

  • explainer_config (ExplainerConfig | None)

  • shadow_production_variants (List[ProductionVariant] | None)

  • execution_role_arn (str | None)

  • vpc_config (VpcConfig | None)

  • enable_network_isolation (bool | None)

endpoint_config_name

Name of the SageMaker endpoint configuration.

Type:

str

endpoint_config_arn

The Amazon Resource Name (ARN) of the endpoint configuration.

Type:

str | None

production_variants

An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

Type:

List[sagemaker_core.main.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.main.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 | None

async_inference_config

Returns the description of an endpoint configuration created using the CreateEndpointConfig API.

Type:

sagemaker_core.main.shapes.AsyncInferenceConfig | None

explainer_config

The configuration parameters for an explainer.

Type:

sagemaker_core.main.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.main.shapes.ProductionVariant] | None

execution_role_arn

The Amazon Resource Name (ARN) of the IAM role that you assigned to the endpoint configuration.

Type:

str | None

vpc_config
Type:

sagemaker_core.main.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

classmethod create(endpoint_config_name, production_variants, data_capture_config=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, kms_key_id=<sagemaker_core.main.utils.Unassigned object>, async_inference_config=<sagemaker_core.main.utils.Unassigned object>, explainer_config=<sagemaker_core.main.utils.Unassigned object>, shadow_production_variants=<sagemaker_core.main.utils.Unassigned object>, execution_role_arn=<sagemaker_core.main.utils.Unassigned object>, vpc_config=<sagemaker_core.main.utils.Unassigned object>, enable_network_isolation=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a EndpointConfig resource

Parameters:
  • endpoint_config_name (str) – The name of the endpoint configuration. You specify this name in a CreateEndpoint request.

  • production_variants (List[ProductionVariant]) – An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

  • data_capture_config (DataCaptureConfig | None)

  • tags (List[Tag] | None) – 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 (str | None) – 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 (AsyncInferenceConfig | None) – 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 (ExplainerConfig | None) – A member of CreateEndpointConfig that enables explainers.

  • shadow_production_variants (List[ProductionVariant] | None) – 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 (str | None) – The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform actions on your behalf. For more information, see SageMaker Roles. To be able to pass this role to Amazon SageMaker, the caller of this action must have the iam:PassRole permission.

  • vpc_config (VpcConfig | None)

  • enable_network_isolation (bool | None) – 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.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

EndpointConfig | None

delete()[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']     `

Return type:

None

classmethod get(endpoint_config_name, session=None, region=None)[source]

Get a EndpointConfig resource

Parameters:
  • endpoint_config_name (str) – The name of the endpoint configuration.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

EndpointConfig | None

classmethod get_all(sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, name_contains=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all EndpointConfig resources

Parameters:
  • sort_by (str | None) – The field to sort results by. The default is CreationTime.

  • sort_order (str | None) – 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 (str | None) – A string in the endpoint configuration name. This filter returns only endpoint configurations whose name contains the specified string.

  • creation_time_before (datetime | None) – A filter that returns only endpoint configurations created before the specified time (timestamp).

  • creation_time_after (datetime | None) – A filter that returns only endpoint configurations with a creation time greater than or equal to the specified time (timestamp).

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[EndpointConfig]

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

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

refresh()[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']     `

Return type:

EndpointConfig | None

class sagemaker_core.main.resources.Experiment(*, experiment_name, experiment_arn=<sagemaker_core.main.utils.Unassigned object>, display_name=<sagemaker_core.main.utils.Unassigned object>, source=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, created_by=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_by=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Experiment

Parameters:
  • experiment_name (str)

  • experiment_arn (str | None)

  • display_name (str | None)

  • source (ExperimentSource | None)

  • description (str | None)

  • creation_time (datetime | None)

  • created_by (UserContext | None)

  • last_modified_time (datetime | None)

  • last_modified_by (UserContext | None)

experiment_name

The name of the experiment.

Type:

str

experiment_arn

The Amazon Resource Name (ARN) of the experiment.

Type:

str | None

display_name

The name of the experiment as displayed. If DisplayName isn’t specified, ExperimentName is displayed.

Type:

str | None

source

The Amazon Resource Name (ARN) of the source and, optionally, the type.

Type:

sagemaker_core.main.shapes.ExperimentSource | None

description

The description of the experiment.

Type:

str | None

creation_time

When the experiment was created.

Type:

datetime.datetime | None

created_by

Who created the experiment.

Type:

sagemaker_core.main.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.main.shapes.UserContext | None

classmethod create(experiment_name, display_name=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Experiment resource

Parameters:
  • experiment_name (str) – The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.

  • display_name (str | None) – 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 (str | None) – The description of the experiment.

  • tags (List[Tag] | None) – A list of tags to associate with the experiment. You can use Search API to search on the tags.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Experiment | None

delete()[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.

Return type:

None

classmethod get(experiment_name, session=None, region=None)[source]

Get a Experiment resource

Parameters:
  • experiment_name (str) – The name of the experiment to describe.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Experiment | None

classmethod get_all(created_after=<sagemaker_core.main.utils.Unassigned object>, created_before=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Experiment resources

Parameters:
  • created_after (datetime | None) – A filter that returns only experiments created after the specified time.

  • created_before (datetime | None) – A filter that returns only experiments created before the specified time.

  • sort_by (str | None) – The property used to sort results. The default value is CreationTime.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[Experiment]

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

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

refresh()[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.

Return type:

Experiment | None

update(display_name=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>)[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.

Parameters:
  • display_name (str | None)

  • description (str | None)

Return type:

Experiment | None

class sagemaker_core.main.resources.FeatureGroup(*, feature_group_name, feature_group_arn=<sagemaker_core.main.utils.Unassigned object>, record_identifier_feature_name=<sagemaker_core.main.utils.Unassigned object>, event_time_feature_name=<sagemaker_core.main.utils.Unassigned object>, feature_definitions=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, online_store_config=<sagemaker_core.main.utils.Unassigned object>, offline_store_config=<sagemaker_core.main.utils.Unassigned object>, throughput_config=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, feature_group_status=<sagemaker_core.main.utils.Unassigned object>, offline_store_status=<sagemaker_core.main.utils.Unassigned object>, last_update_status=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, next_token=<sagemaker_core.main.utils.Unassigned object>, online_store_total_size_bytes=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource FeatureGroup

Parameters:
  • feature_group_name (str)

  • feature_group_arn (str | None)

  • record_identifier_feature_name (str | None)

  • event_time_feature_name (str | None)

  • feature_definitions (List[FeatureDefinition] | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • online_store_config (OnlineStoreConfig | None)

  • offline_store_config (OfflineStoreConfig | None)

  • throughput_config (ThroughputConfigDescription | None)

  • role_arn (str | None)

  • feature_group_status (str | None)

  • offline_store_status (OfflineStoreStatus | None)

  • last_update_status (LastUpdateStatus | None)

  • failure_reason (str | None)

  • description (str | None)

  • next_token (str | None)

  • online_store_total_size_bytes (int | None)

feature_group_arn

The Amazon Resource Name (ARN) of the FeatureGroup.

Type:

str | None

feature_group_name

he name of the FeatureGroup.

Type:

str

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 | 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 | None

feature_definitions

A list of the Features in the FeatureGroup. Each feature is defined by a FeatureName and FeatureType.

Type:

List[sagemaker_core.main.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 | 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.main.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.main.shapes.OfflineStoreConfig | None

throughput_config
Type:

sagemaker_core.main.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 | None

feature_group_status

The status of the feature group.

Type:

str | 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.main.shapes.OfflineStoreStatus | None

last_update_status

A value indicating whether the update made to the feature group was successful.

Type:

sagemaker_core.main.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 | None

description

A free form description of the feature group.

Type:

str | None

online_store_total_size_bytes

The size of the OnlineStore in bytes.

Type:

int | None

batch_get_record(identifiers, expiration_time_response=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Retrieves a batch of Records from a FeatureGroup.

Parameters:
  • identifiers (List[BatchGetRecordIdentifier]) – 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 (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

BatchGetRecordResponse | None

classmethod create(feature_group_name, record_identifier_feature_name, event_time_feature_name, feature_definitions, online_store_config=<sagemaker_core.main.utils.Unassigned object>, offline_store_config=<sagemaker_core.main.utils.Unassigned object>, throughput_config=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a FeatureGroup resource

Parameters:
  • feature_group_name (str) – 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 (str) – 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 (str) – 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 (List[FeatureDefinition]) – 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 (OnlineStoreConfig | None) – 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 (OfflineStoreConfig | None) – 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 (ThroughputConfig | None)

  • role_arn (str | None) – The Amazon Resource Name (ARN) of the IAM execution role used to persist data into the OfflineStore if an OfflineStoreConfig is provided.

  • description (str | None) – A free-form description of a FeatureGroup.

  • tags (List[Tag] | None) – Tags used to identify Features in each FeatureGroup.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

FeatureGroup | None

delete()[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.

Return type:

None

delete_record(record_identifier_value_as_string, event_time, target_stores=<sagemaker_core.main.utils.Unassigned object>, deletion_mode=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Deletes a Record from a FeatureGroup in the OnlineStore.

Parameters:
  • record_identifier_value_as_string (str) – The value for the RecordIdentifier that uniquely identifies the record, in string format.

  • event_time (str) – Timestamp indicating when the deletion event occurred. EventTime can be used to query data at a certain point in time.

  • target_stores (List[str] | None) – 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 (str | None) – The name of the deletion mode for deleting the record. By default, the deletion mode is set to SoftDelete.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

classmethod get(feature_group_name, next_token=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get a FeatureGroup resource

Parameters:
  • feature_group_name (str) – The name or Amazon Resource Name (ARN) of the FeatureGroup you want described.

  • next_token (str | None) – A token to resume pagination of the list of Features (FeatureDefinitions). 2,500 Features are returned by default.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

FeatureGroup | None

classmethod get_all(name_contains=<sagemaker_core.main.utils.Unassigned object>, feature_group_status_equals=<sagemaker_core.main.utils.Unassigned object>, offline_store_status_equals=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all FeatureGroup resources

Parameters:
  • name_contains (str | None) – A string that partially matches one or more FeatureGroups names. Filters FeatureGroups by name.

  • feature_group_status_equals (str | None) – A FeatureGroup status. Filters by FeatureGroup status.

  • offline_store_status_equals (str | None) – An OfflineStore status. Filters by OfflineStore status.

  • creation_time_after (datetime | None) – Use this parameter to search for FeatureGroupss created after a specific date and time.

  • creation_time_before (datetime | None) – Use this parameter to search for FeatureGroupss created before a specific date and time.

  • sort_order (str | None) – The order in which feature groups are listed.

  • sort_by (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[FeatureGroup]

get_record(record_identifier_value_as_string, feature_names=<sagemaker_core.main.utils.Unassigned object>, expiration_time_response=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Use for OnlineStore serving from a FeatureStore.

Parameters:
  • record_identifier_value_as_string (str) – The value that corresponds to RecordIdentifier type and uniquely identifies the record in the FeatureGroup.

  • feature_names (List[str] | None) – List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.

  • expiration_time_response (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

GetRecordResponse | None

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

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

put_record(record, target_stores=<sagemaker_core.main.utils.Unassigned object>, ttl_duration=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

The PutRecord API is used to ingest a list of Records into your feature group.

Parameters:
  • record (List[FeatureValue]) – 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 (List[str] | None) – 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 (TtlDuration | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

None

refresh()[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.

Return type:

FeatureGroup | None

update(feature_additions=<sagemaker_core.main.utils.Unassigned object>, online_store_config=<sagemaker_core.main.utils.Unassigned object>, throughput_config=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a FeatureGroup resource

Parameters:
  • feature_additions (List[FeatureDefinition] | None) – 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.

  • online_store_config (OnlineStoreConfigUpdate | None)

  • throughput_config (ThroughputConfigUpdate | None)

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.

Return type:

FeatureGroup | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a FeatureGroup resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a FeatureGroup resource to reach certain status.

Parameters:
  • target_status (Literal['Creating', 'Created', 'CreateFailed', 'Deleting', 'DeleteFailed']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.FeatureMetadata(*, feature_group_name, feature_name, feature_group_arn=<sagemaker_core.main.utils.Unassigned object>, feature_type=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, description=<sagemaker_core.main.utils.Unassigned object>, parameters=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource FeatureMetadata

Parameters:
  • feature_group_name (str)

  • feature_name (str)

  • feature_group_arn (str | None)

  • feature_type (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

  • description (str | None)

  • parameters (List[FeatureParameter] | None)

feature_group_arn

The Amazon Resource Number (ARN) of the feature group that contains the feature.

Type:

str | None

feature_group_name

The name of the feature group that you’ve specified.

Type:

str

feature_name

The name of the feature that you’ve specified.

Type:

str

feature_type

The data type of the feature.

Type:

str | 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

description

The description you added to describe the feature.

Type:

str | None

parameters

The key-value pairs that you added to describe the feature.

Type:

List[sagemaker_core.main.shapes.FeatureParameter] | None

classmethod get(feature_group_name, feature_name, session=None, region=None)[source]

Get a FeatureMetadata resource

Parameters:
  • feature_group_name (str) – The name or Amazon Resource Name (ARN) of the feature group containing the feature.

  • feature_name (str) – The name of the feature.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

FeatureMetadata | None

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

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

refresh()[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.

Return type:

FeatureMetadata | None

update(description=<sagemaker_core.main.utils.Unassigned object>, parameter_additions=<sagemaker_core.main.utils.Unassigned object>, parameter_removals=<sagemaker_core.main.utils.Unassigned object>)[source]

Update a FeatureMetadata resource

Parameters:
  • parameter_additions (List[FeatureParameter] | None) – A list of key-value pairs that you can add to better describe the feature.

  • parameter_removals (List[str] | None) – A list of parameter keys that you can specify to remove parameters that describe your feature.

  • description (str | None)

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.

Return type:

FeatureMetadata | None

class sagemaker_core.main.resources.FlowDefinition(*, flow_definition_name, flow_definition_arn=<sagemaker_core.main.utils.Unassigned object>, flow_definition_status=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, human_loop_request_source=<sagemaker_core.main.utils.Unassigned object>, human_loop_activation_config=<sagemaker_core.main.utils.Unassigned object>, human_loop_config=<sagemaker_core.main.utils.Unassigned object>, output_config=<sagemaker_core.main.utils.Unassigned object>, role_arn=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource FlowDefinition

Parameters:
  • flow_definition_name (str)

  • flow_definition_arn (str | None)

  • flow_definition_status (str | None)

  • creation_time (datetime | None)

  • human_loop_request_source (HumanLoopRequestSource | None)

  • human_loop_activation_config (HumanLoopActivationConfig | None)

  • human_loop_config (HumanLoopConfig | None)

  • output_config (FlowDefinitionOutputConfig | None)

  • role_arn (str | None)

  • failure_reason (str | None)

flow_definition_arn

The Amazon Resource Name (ARN) of the flow defintion.

Type:

str | None

flow_definition_name

The Amazon Resource Name (ARN) of the flow definition.

Type:

str

flow_definition_status

The status of the flow definition. Valid values are listed below.

Type:

str | 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.main.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 | 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.main.shapes.HumanLoopRequestSource | None

human_loop_activation_config

An object containing information about what triggers a human review workflow.

Type:

sagemaker_core.main.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.main.shapes.HumanLoopConfig | None

failure_reason

The reason your flow definition failed.

Type:

str | None

classmethod create(flow_definition_name, output_config, role_arn, human_loop_request_source=<sagemaker_core.main.utils.Unassigned object>, human_loop_activation_config=<sagemaker_core.main.utils.Unassigned object>, human_loop_config=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a FlowDefinition resource

Parameters:
  • flow_definition_name (str) – The name of your flow definition.

  • output_config (FlowDefinitionOutputConfig) – An object containing information about where the human review results will be uploaded.

  • role_arn (str) – 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 (HumanLoopRequestSource | None) – 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 (HumanLoopActivationConfig | None) – An object containing information about the events that trigger a human workflow.

  • human_loop_config (HumanLoopConfig | None) – An object containing information about the tasks the human reviewers will perform.

  • tags (List[Tag] | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

FlowDefinition | None

delete()[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.

Return type:

None

classmethod get(flow_definition_name, session=None, region=None)[source]

Get a FlowDefinition resource

Parameters:
  • flow_definition_name (str) – The name of the flow definition.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

FlowDefinition | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all FlowDefinition resources

Parameters:
  • creation_time_after (datetime | None) – A filter that returns only flow definitions with a creation time greater than or equal to the specified timestamp.

  • creation_time_before (datetime | None) – A filter that returns only flow definitions that were created before the specified timestamp.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[FlowDefinition]

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

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

refresh()[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.

Return type:

FlowDefinition | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a FlowDefinition resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a FlowDefinition resource to reach certain status.

Parameters:
  • target_status (Literal['Initializing', 'Active', 'Failed', 'Deleting']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.Hub(*, hub_name, hub_arn=<sagemaker_core.main.utils.Unassigned object>, hub_display_name=<sagemaker_core.main.utils.Unassigned object>, hub_description=<sagemaker_core.main.utils.Unassigned object>, hub_search_keywords=<sagemaker_core.main.utils.Unassigned object>, s3_storage_config=<sagemaker_core.main.utils.Unassigned object>, hub_status=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource Hub

Parameters:
  • hub_name (str)

  • hub_arn (str | None)

  • hub_display_name (str | None)

  • hub_description (str | None)

  • hub_search_keywords (List[str] | None)

  • s3_storage_config (HubS3StorageConfig | None)

  • hub_status (str | None)

  • failure_reason (str | None)

  • creation_time (datetime | None)

  • last_modified_time (datetime | None)

hub_name

The name of the hub.

Type:

str

hub_arn

The Amazon Resource Name (ARN) of the hub.

Type:

str | None

hub_status

The status of the hub.

Type:

str | 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 | None

hub_description

A description of the hub.

Type:

str | None

hub_search_keywords

The searchable keywords for the hub.

Type:

List[str] | None

s3_storage_config

The Amazon S3 storage configuration for the hub.

Type:

sagemaker_core.main.shapes.HubS3StorageConfig | None

failure_reason

The failure reason if importing hub content failed.

Type:

str | None

classmethod create(hub_name, hub_description, hub_display_name=<sagemaker_core.main.utils.Unassigned object>, hub_search_keywords=<sagemaker_core.main.utils.Unassigned object>, s3_storage_config=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a Hub resource

Parameters:
  • hub_name (str) – The name of the hub to create.

  • hub_description (str) – A description of the hub.

  • hub_display_name (str | None) – The display name of the hub.

  • hub_search_keywords (List[str] | None) – The searchable keywords for the hub.

  • s3_storage_config (HubS3StorageConfig | None) – The Amazon S3 storage configuration for the hub.

  • tags (List[Tag] | None) – Any tags to associate with the hub.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

Hub | None

delete()[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.

Return type:

None

classmethod get(hub_name, session=None, region=None)[source]

Get a Hub resource

Parameters:
  • hub_name (str) – The name of the hub to describe.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

Hub | None

classmethod get_all(name_contains=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_before=<sagemaker_core.main.utils.Unassigned object>, last_modified_time_after=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all Hub resources

Parameters:
  • name_contains (str | None) – Only list hubs with names that contain the specified string.

  • creation_time_before (datetime | None) – Only list hubs that were created before the time specified.

  • creation_time_after (datetime | None) – Only list hubs that were created after the time specified.

  • last_modified_time_before (datetime | None) – Only list hubs that were last modified before the time specified.

  • last_modified_time_after (datetime | None) – Only list hubs that were last modified after the time specified.

  • sort_by (str | None) – Sort hubs by either name or creation time.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[Hub]

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

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

refresh()[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.

Return type:

Hub | None

update(hub_description=<sagemaker_core.main.utils.Unassigned object>, hub_display_name=<sagemaker_core.main.utils.Unassigned object>, hub_search_keywords=<sagemaker_core.main.utils.Unassigned object>)[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.

Parameters:
  • hub_description (str | None)

  • hub_display_name (str | None)

  • hub_search_keywords (List[str] | None)

Return type:

Hub | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a Hub resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a Hub resource to reach certain status.

Parameters:
  • target_status (Literal['InService', 'Creating', 'Updating', 'Deleting', 'CreateFailed', 'UpdateFailed', 'DeleteFailed']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.HubContent(*, hub_content_type, hub_content_name, hub_content_arn=<sagemaker_core.main.utils.Unassigned object>, hub_content_version=<sagemaker_core.main.utils.Unassigned object>, document_schema_version=<sagemaker_core.main.utils.Unassigned object>, hub_arn=<sagemaker_core.main.utils.Unassigned object>, hub_content_display_name=<sagemaker_core.main.utils.Unassigned object>, hub_content_description=<sagemaker_core.main.utils.Unassigned object>, hub_content_markdown=<sagemaker_core.main.utils.Unassigned object>, hub_content_document=<sagemaker_core.main.utils.Unassigned object>, sage_maker_public_hub_content_arn=<sagemaker_core.main.utils.Unassigned object>, reference_min_version=<sagemaker_core.main.utils.Unassigned object>, support_status=<sagemaker_core.main.utils.Unassigned object>, hub_content_search_keywords=<sagemaker_core.main.utils.Unassigned object>, hub_content_dependencies=<sagemaker_core.main.utils.Unassigned object>, hub_content_status=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, hub_name=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource HubContent

Parameters:
  • hub_content_type (str)

  • hub_content_name (str)

  • hub_content_arn (str | None)

  • hub_content_version (str | None)

  • document_schema_version (str | None)

  • hub_arn (str | None)

  • hub_content_display_name (str | None)

  • hub_content_description (str | None)

  • hub_content_markdown (str | None)

  • hub_content_document (str | None)

  • sage_maker_public_hub_content_arn (str | None)

  • reference_min_version (str | None)

  • support_status (str | None)

  • hub_content_search_keywords (List[str] | None)

  • hub_content_dependencies (List[HubContentDependency] | None)

  • hub_content_status (str | None)

  • failure_reason (str | None)

  • creation_time (datetime | None)

  • hub_name (str | None)

hub_content_name

The name of the hub content.

Type:

str

hub_content_arn

The Amazon Resource Name (ARN) of the hub content.

Type:

str | None

hub_content_version

The version of the hub content.

Type:

str | None

hub_content_type

The type of hub content.

Type:

str

document_schema_version

The document schema version for the hub content.

Type:

str | 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 | 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 | None

hub_content_status

The status of the hub content.

Type:

str | 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 | None

hub_content_description

A description of the hub content.

Type:

str | 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 | None

sage_maker_public_hub_content_arn

The ARN of the public hub content.

Type:

str | None

reference_min_version

The minimum version of the hub content.

Type:

str | None

support_status

The support status of the hub content.

Type:

str | None

hub_content_search_keywords

The searchable keywords for the hub content.

Type:

List[str] | 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.main.shapes.HubContentDependency] | None

failure_reason

The failure reason if importing hub content failed.

Type:

str | None

delete()[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.

Return type:

None

classmethod get(hub_name, hub_content_type, hub_content_name, hub_content_version=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get a HubContent resource

Parameters:
  • hub_name (str) – The name of the hub that contains the content to describe.

  • hub_content_type (str) – The type of content in the hub.

  • hub_content_name (str) – The name of the content to describe.

  • hub_content_version (str | None) – The version of the content to describe.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

HubContent | None

get_all_versions(min_version=<sagemaker_core.main.utils.Unassigned object>, max_schema_version=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, creation_time_after=<sagemaker_core.main.utils.Unassigned object>, sort_by=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

List hub content versions.

Parameters:
  • min_version (str | None) – The lower bound of the hub content versions to list.

  • max_schema_version (str | None) – The upper bound of the hub content schema version.

  • creation_time_before (datetime | None) – Only list hub content versions that were created before the time specified.

  • creation_time_after (datetime | None) – Only list hub content versions that were created after the time specified.

  • sort_by (str | None) – Sort hub content versions by either name or creation time.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

ResourceIterator[HubContent]

classmethod load(hub_content_name, hub_content_type, document_schema_version, hub_name, hub_content_document, hub_content_version=<sagemaker_core.main.utils.Unassigned object>, hub_content_display_name=<sagemaker_core.main.utils.Unassigned object>, hub_content_description=<sagemaker_core.main.utils.Unassigned object>, hub_content_markdown=<sagemaker_core.main.utils.Unassigned object>, hub_content_search_keywords=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Import a HubContent resource

Parameters:
  • hub_content_name (str) – The name of the hub content to import.

  • hub_content_type (str) – The type of hub content to import.

  • document_schema_version (str) – The version of the hub content schema to import.

  • hub_name (str) – The name of the hub to import content into.

  • hub_content_document (str) – The hub content document that describes information about the hub content such as type, associated containers, scripts, and more.

  • hub_content_version (str | None) – The version of the hub content to import.

  • hub_content_display_name (str | None) – The display name of the hub content to import.

  • hub_content_description (str | None) – A description of the hub content to import.

  • hub_content_markdown (str | None) – A string that provides a description of the hub content. This string can include links, tables, and standard markdown formating.

  • hub_content_search_keywords (List[str] | None) – The searchable keywords of the hub content.

  • tags (List[Tag] | None) – Any tags associated with the hub content.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

HubContent | None

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

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

refresh()[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.

Return type:

HubContent | None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a HubContent resource to reach certain status.

Parameters:
  • target_status (Literal['Supported', 'Deprecated']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.HubContentReference(*, hub_name, sage_maker_public_hub_content_arn, hub_arn, hub_content_arn, hub_content_name=<sagemaker_core.main.utils.Unassigned object>, min_version=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource HubContentReference

Parameters:
  • hub_name (str | object)

  • sage_maker_public_hub_content_arn (str)

  • hub_arn (str)

  • hub_content_arn (str)

  • hub_content_name (str | object | None)

  • min_version (str | None)

  • tags (List[Tag] | None)

hub_name

The name of the hub to add the hub content reference to.

Type:

str | object

sage_maker_public_hub_content_arn

The ARN of the public hub content to reference.

Type:

str

hub_arn

The ARN of the hub that the hub content reference was added to.

Type:

str

hub_content_arn

The ARN of the hub content.

Type:

str

hub_content_name

The name of the hub content to reference.

Type:

str | object | None

min_version

The minimum version of the hub content to reference.

Type:

str | None

tags

Any tags associated with the hub content to reference.

Type:

List[sagemaker_core.main.shapes.Tag] | None

classmethod create(hub_name, sage_maker_public_hub_content_arn, hub_content_name=<sagemaker_core.main.utils.Unassigned object>, min_version=<sagemaker_core.main.utils.Unassigned object>, tags=<sagemaker_core.main.utils.Unassigned object>)[source]

Create a HubContentReference resource

Parameters:
  • hub_name (str | object) – The name of the hub to add the hub content reference to.

  • sage_maker_public_hub_content_arn (str) – The ARN of the public hub content to reference.

  • hub_content_name (str | object | None) – The name of the hub content to reference.

  • min_version (str | None) – The minimum version of the hub content to reference.

  • tags (List[Tag] | None) – 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

Return type:

HubContentReference | None

delete(hub_content_type)[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.

Parameters:

hub_content_type (str)

Return type:

None

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

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

class sagemaker_core.main.resources.HumanTaskUi(*, human_task_ui_name, human_task_ui_arn=<sagemaker_core.main.utils.Unassigned object>, human_task_ui_status=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, ui_template=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource HumanTaskUi

Parameters:
  • human_task_ui_name (str)

  • human_task_ui_arn (str | None)

  • human_task_ui_status (str | None)

  • creation_time (datetime | None)

  • ui_template (UiTemplateInfo | None)

human_task_ui_arn

The Amazon Resource Name (ARN) of the human task user interface (worker task template).

Type:

str | None

human_task_ui_name

The name of the human task user interface (worker task template).

Type:

str

creation_time

The timestamp when the human task user interface was created.

Type:

datetime.datetime | None

ui_template
Type:

sagemaker_core.main.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 | None

classmethod create(human_task_ui_name, ui_template, tags=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Create a HumanTaskUi resource

Parameters:
  • human_task_ui_name (str) – The name of the user interface you are creating.

  • ui_template (UiTemplate)

  • tags (List[Tag] | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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

Return type:

HumanTaskUi | None

delete()[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.

Return type:

None

classmethod get(human_task_ui_name, session=None, region=None)[source]

Get a HumanTaskUi resource

Parameters:
  • human_task_ui_name (str) – The name of the human task user interface (worker task template) you want information about.

  • session (Session | None) – Boto3 session.

  • region (str | None) – 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.

Return type:

HumanTaskUi | None

classmethod get_all(creation_time_after=<sagemaker_core.main.utils.Unassigned object>, creation_time_before=<sagemaker_core.main.utils.Unassigned object>, sort_order=<sagemaker_core.main.utils.Unassigned object>, session=None, region=None)[source]

Get all HumanTaskUi resources

Parameters:
  • creation_time_after (datetime | None) – A filter that returns only human task user interfaces with a creation time greater than or equal to the specified timestamp.

  • creation_time_before (datetime | None) – A filter that returns only human task user interfaces that were created before the specified timestamp.

  • sort_order (str | None) – 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 (Session | None) – Boto3 session.

  • region (str | None) – 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']     `

Return type:

ResourceIterator[HumanTaskUi]

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

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

refresh()[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.

Return type:

HumanTaskUi | None

wait_for_delete(poll=5, timeout=None)[source]

Wait for a HumanTaskUi resource to be deleted.

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

  • timeout (int | None) – 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.

Return type:

None

wait_for_status(target_status, poll=5, timeout=None)[source]

Wait for a HumanTaskUi resource to reach certain status.

Parameters:
  • target_status (Literal['Active', 'Deleting']) – The status to wait for.

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

  • timeout (int | None) – The maximum number of seconds to wait before timing out.

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

  • FailedStatusError – If the resource reaches a failed state.

  • WaiterError – Raised when an error occurs while waiting.

Return type:

None

class sagemaker_core.main.resources.HyperParameterTuningJob(*, hyper_parameter_tuning_job_name, hyper_parameter_tuning_job_arn=<sagemaker_core.main.utils.Unassigned object>, hyper_parameter_tuning_job_config=<sagemaker_core.main.utils.Unassigned object>, training_job_definition=<sagemaker_core.main.utils.Unassigned object>, training_job_definitions=<sagemaker_core.main.utils.Unassigned object>, hyper_parameter_tuning_job_status=<sagemaker_core.main.utils.Unassigned object>, creation_time=<sagemaker_core.main.utils.Unassigned object>, hyper_parameter_tuning_end_time=<sagemaker_core.main.utils.Unassigned object>, last_modified_time=<sagemaker_core.main.utils.Unassigned object>, training_job_status_counters=<sagemaker_core.main.utils.Unassigned object>, objective_status_counters=<sagemaker_core.main.utils.Unassigned object>, best_training_job=<sagemaker_core.main.utils.Unassigned object>, overall_best_training_job=<sagemaker_core.main.utils.Unassigned object>, warm_start_config=<sagemaker_core.main.utils.Unassigned object>, autotune=<sagemaker_core.main.utils.Unassigned object>, failure_reason=<sagemaker_core.main.utils.Unassigned object>, tuning_job_completion_details=<sagemaker_core.main.utils.Unassigned object>, consumed_resources=<sagemaker_core.main.utils.Unassigned object>)[source]

Class representing resource HyperParameterTuningJob

Parameters:
  • hyper_parameter_tuning_job_name (str)

  • hyper_parameter_tuning_job_arn (str | None)

  • hyper_parameter_tuning_job_config (HyperParameterTuningJobConfig | None)

  • training_job_definition (HyperParameterTrainingJobDefinition | N