Skip to content

list_trial_components

list_trial_components(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    experiment_name: Optional[ExperimentEntityName] = None,
    trial_name: Optional[ExperimentEntityName] = None,
    source_arn: Optional[String256] = None,
    created_after: Optional[Timestamp] = None,
    created_before: Optional[Timestamp] = None,
    sort_by: Optional[SortTrialComponentsBy] = None,
    sort_order: Optional[SortOrder] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListTrialComponentsResponse

Lists the trial components in your account. You can sort the list by trial component name or creation time. You can filter the list to show only components that were created in a specific time range. You can also filter on one of the following:

  • ExperimentName

  • SourceArn

  • TrialName

Parameters:

  • experiment_name (Optional[ExperimentEntityName], default: None ) –

    A filter that returns only components that are part of the specified experiment. If you specify ExperimentName, you can't filter by SourceArn or TrialName.

  • trial_name (Optional[ExperimentEntityName], default: None ) –

    A filter that returns only components that are part of the specified trial. If you specify TrialName, you can't filter by ExperimentName or SourceArn.

  • source_arn (Optional[String256], default: None ) –

    A filter that returns only components that have the specified source Amazon Resource Name (ARN). If you specify SourceArn, you can't filter by ExperimentName or TrialName.

  • created_after (Optional[Timestamp], default: None ) –

    A filter that returns only components created after the specified time.

  • created_before (Optional[Timestamp], default: None ) –

    A filter that returns only components created before the specified time.

  • sort_by (Optional[SortTrialComponentsBy], default: None ) –

    The property used to sort results. The default value is CreationTime.

  • sort_order (Optional[SortOrder], default: None ) –

    The sort order. The default value is Descending.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of components to return in the response. The default value is 10.

  • next_token (Optional[NextToken], default: None ) –

    If the previous call to ListTrialComponents didn't return the full set of components, the call returns a token for getting the next set of components.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_trial_components(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    experiment_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    trial_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    source_arn: Optional["capo_sagemaker.types.string256.String256"] = None,
    created_after: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    created_before: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    sort_by: Optional[
        "capo_sagemaker.types.sort_trial_components_by.SortTrialComponentsBy"
    ] = None,
    sort_order: Optional["capo_sagemaker.types.sort_order.SortOrder"] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
) -> "capo_sagemaker.types.list_trial_components_response.ListTrialComponentsResponse":
    """<p>Lists the trial components in your account. You can sort the list by trial component name or creation time. You can filter the list to show only components that were created in a specific time range. You can also filter on one of the following:</p> <ul> <li> <p> <code>ExperimentName</code> </p> </li> <li> <p> <code>SourceArn</code> </p> </li> <li> <p> <code>TrialName</code> </p> </li> </ul>

    Args:
        experiment_name: <p>A filter that returns only components that are part of the specified experiment. If you specify <code>ExperimentName</code>, you can't filter by <code>SourceArn</code> or <code>TrialName</code>.</p>
        trial_name: <p>A filter that returns only components that are part of the specified trial. If you specify <code>TrialName</code>, you can't filter by <code>ExperimentName</code> or <code>SourceArn</code>.</p>
        source_arn: <p>A filter that returns only components that have the specified source Amazon Resource Name (ARN). If you specify <code>SourceArn</code>, you can't filter by <code>ExperimentName</code> or <code>TrialName</code>.</p>
        created_after: <p>A filter that returns only components created after the specified time.</p>
        created_before: <p>A filter that returns only components created before the specified time.</p>
        sort_by: <p>The property used to sort results. The default value is <code>CreationTime</code>.</p>
        sort_order: <p>The sort order. The default value is <code>Descending</code>.</p>
        max_results: <p>The maximum number of components to return in the response. The default value is 10.</p>
        next_token: <p>If the previous call to <code>ListTrialComponents</code> didn't return the full set of components, the call returns a token for getting the next set of components.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.list_trial_components_request.ListTrialComponentsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_trial_components_response.ListTrialComponentsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_trial_components

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTrialComponents")
    )
    input_: capo_sagemaker.types.list_trial_components_request.ListTrialComponentsRequest = {}
    if experiment_name is not None:
        input_["experiment_name"] = experiment_name
    if trial_name is not None:
        input_["trial_name"] = trial_name
    if source_arn is not None:
        input_["source_arn"] = source_arn
    if created_after is not None:
        input_["created_after"] = created_after
    if created_before is not None:
        input_["created_before"] = created_before
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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