Skip to content

create_action

create_action(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    action_name: Optional[ExperimentEntityName] = None,
    source: Optional[ActionSource] = None,
    action_type: Optional[String256] = None,
    description: Optional[ExperimentDescription] = None,
    status: Optional[ActionStatus] = None,
    properties: Optional[LineageEntityParameters] = None,
    metadata_properties: Optional[MetadataProperties] = None,
    tags: Optional[TagList] = None,
) -> CreateActionResponse

Creates an action. An action is a lineage tracking entity that represents an action or activity. For example, a model deployment or an HPO job. Generally, an action involves at least one input or output artifact. For more information, see Amazon SageMaker ML Lineage Tracking.

Parameters:

Raises:

  • ResourceLimitExceeded –

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

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_action(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    action_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    source: Optional["capo_sagemaker.types.action_source.ActionSource"] = None,
    action_type: Optional["capo_sagemaker.types.string256.String256"] = None,
    description: Optional[
        "capo_sagemaker.types.experiment_description.ExperimentDescription"
    ] = None,
    status: Optional["capo_sagemaker.types.action_status.ActionStatus"] = None,
    properties: Optional[
        "capo_sagemaker.types.lineage_entity_parameters.LineageEntityParameters"
    ] = None,
    metadata_properties: Optional[
        "capo_sagemaker.types.metadata_properties.MetadataProperties"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_action_response.CreateActionResponse":
    """<p>Creates an <i>action</i>. An action is a lineage tracking entity that represents an action or activity. For example, a model deployment or an HPO job. Generally, an action involves at least one input or output artifact. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking.html">Amazon SageMaker ML Lineage Tracking</a>.</p>

    Args:
        action_name: <p>The name of the action. Must be unique to your account in an Amazon Web Services Region.</p>
        source: <p>The source type, ID, and URI.</p>
        action_type: <p>The action type.</p>
        description: <p>The description of the action.</p>
        status: <p>The status of the action.</p>
        properties: <p>A list of properties to add to the action.</p>
        tags: <p>A list of tags to apply to the action.</p>

    Raises:
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_action_request.CreateActionRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_action_response.CreateActionResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_action

        output, http_response = (
            capo_sagemaker._operations.sage_maker.create_action.create_action(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAction")
    )
    input_: capo_sagemaker.types.create_action_request.CreateActionRequest = {}
    if action_name is not None:
        input_["action_name"] = action_name
    if source is not None:
        input_["source"] = source
    if action_type is not None:
        input_["action_type"] = action_type
    if description is not None:
        input_["description"] = description
    if status is not None:
        input_["status"] = status
    if properties is not None:
        input_["properties"] = properties
    if metadata_properties is not None:
        input_["metadata_properties"] = metadata_properties
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output