Skip to content

list_inference_components async

list_inference_components(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    sort_by: Optional[InferenceComponentSortKey] = None,
    sort_order: Optional[OrderKey] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
    name_contains: Optional[InferenceComponentNameContains] = None,
    creation_time_before: Optional[Timestamp] = None,
    creation_time_after: Optional[Timestamp] = None,
    last_modified_time_before: Optional[Timestamp] = None,
    last_modified_time_after: Optional[Timestamp] = None,
    status_equals: Optional[InferenceComponentStatus] = None,
    endpoint_name_equals: Optional[EndpointName] = None,
    variant_name_equals: Optional[VariantName] = None,
) -> ListInferenceComponentsOutput

Lists the inference components in your account and their properties.

Parameters:

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

    The field by which to sort the inference components in the response. The default is CreationTime.

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

    The sort order for results. The default is Descending.

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

    A token that you use to get the next set of results following a truncated response. If the response to the previous request was truncated, that response provides the value for this token.

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

    The maximum number of inference components to return in the response. This value defaults to 10.

  • name_contains (Optional[InferenceComponentNameContains], default: None ) –

    Filters the results to only those inference components with a name that contains the specified string.

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

    Filters the results to only those inference components that were created before the specified time.

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

    Filters the results to only those inference components that were created after the specified time.

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

    Filters the results to only those inference components that were updated before the specified time.

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

    Filters the results to only those inference components that were updated after the specified time.

  • status_equals (Optional[InferenceComponentStatus], default: None ) –

    Filters the results to only those inference components with the specified status.

  • endpoint_name_equals (Optional[EndpointName], default: None ) –

    An endpoint name to filter the listed inference components. The response includes only those inference components that are hosted at the specified endpoint.

  • variant_name_equals (Optional[VariantName], default: None ) –

    A production variant name to filter the listed inference components. The response includes only those inference components that are hosted at the specified variant.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def list_inference_components(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    sort_by: Optional[
        "capo_sagemaker.types.inference_component_sort_key.InferenceComponentSortKey"
    ] = None,
    sort_order: Optional["capo_sagemaker.types.order_key.OrderKey"] = None,
    next_token: Optional[
        "capo_sagemaker.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    name_contains: Optional[
        "capo_sagemaker.types.inference_component_name_contains.InferenceComponentNameContains"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    last_modified_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    last_modified_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    status_equals: Optional[
        "capo_sagemaker.types.inference_component_status.InferenceComponentStatus"
    ] = None,
    endpoint_name_equals: Optional[
        "capo_sagemaker.types.endpoint_name.EndpointName"
    ] = None,
    variant_name_equals: Optional[
        "capo_sagemaker.types.variant_name.VariantName"
    ] = None,
) -> "capo_sagemaker.types.list_inference_components_output.ListInferenceComponentsOutput":
    """<p>Lists the inference components in your account and their properties.</p>

    Args:
        sort_by: <p>The field by which to sort the inference components in the response. The default is <code>CreationTime</code>.</p>
        sort_order: <p>The sort order for results. The default is <code>Descending</code>.</p>
        next_token: <p>A token that you use to get the next set of results following a truncated response. If the response to the previous request was truncated, that response provides the value for this token.</p>
        max_results: <p>The maximum number of inference components to return in the response. This value defaults to 10.</p>
        name_contains: <p>Filters the results to only those inference components with a name that contains the specified string.</p>
        creation_time_before: <p>Filters the results to only those inference components that were created before the specified time.</p>
        creation_time_after: <p>Filters the results to only those inference components that were created after the specified time.</p>
        last_modified_time_before: <p>Filters the results to only those inference components that were updated before the specified time.</p>
        last_modified_time_after: <p>Filters the results to only those inference components that were updated after the specified time.</p>
        status_equals: <p>Filters the results to only those inference components with the specified status.</p>
        endpoint_name_equals: <p>An endpoint name to filter the listed inference components. The response includes only those inference components that are hosted at the specified endpoint.</p>
        variant_name_equals: <p>A production variant name to filter the listed inference components. The response includes only those inference components that are hosted at the specified variant.</p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.list_inference_components_input.ListInferenceComponentsInput]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.list_inference_components_output.ListInferenceComponentsOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.list_inference_components

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.list_inference_components.async_list_inference_components(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListInferenceComponents")
    )
    input_: capo_sagemaker.types.list_inference_components_input.ListInferenceComponentsInput = {}
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if name_contains is not None:
        input_["name_contains"] = name_contains
    if creation_time_before is not None:
        input_["creation_time_before"] = creation_time_before
    if creation_time_after is not None:
        input_["creation_time_after"] = creation_time_after
    if last_modified_time_before is not None:
        input_["last_modified_time_before"] = last_modified_time_before
    if last_modified_time_after is not None:
        input_["last_modified_time_after"] = last_modified_time_after
    if status_equals is not None:
        input_["status_equals"] = status_equals
    if endpoint_name_equals is not None:
        input_["endpoint_name_equals"] = endpoint_name_equals
    if variant_name_equals is not None:
        input_["variant_name_equals"] = variant_name_equals

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output