Skip to content

list_hubs

list_hubs(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    name_contains: Optional[NameContains] = 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,
    sort_by: Optional[HubSortBy] = None,
    sort_order: Optional[SortOrder] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListHubsResponse

List all existing hubs.

Parameters:

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

    Only list hubs with names that contain the specified string.

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

    Only list hubs that were created before the time specified.

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

    Only list hubs that were created after the time specified.

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

    Only list hubs that were last modified before the time specified.

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

    Only list hubs that were last modified after the time specified.

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

    Sort hubs by either name or creation time.

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

    Sort hubs by ascending or descending order.

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

    The maximum number of hubs to list.

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

    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.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_hubs(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    name_contains: Optional[
        "capo_sagemaker.types.name_contains.NameContains"
    ] = 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,
    sort_by: Optional["capo_sagemaker.types.hub_sort_by.HubSortBy"] = 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_hubs_response.ListHubsResponse":
    """<p>List all existing hubs.</p>

    Args:
        name_contains: <p>Only list hubs with names that contain the specified string.</p>
        creation_time_before: <p>Only list hubs that were created before the time specified.</p>
        creation_time_after: <p>Only list hubs that were created after the time specified.</p>
        last_modified_time_before: <p>Only list hubs that were last modified before the time specified.</p>
        last_modified_time_after: <p>Only list hubs that were last modified after the time specified.</p>
        sort_by: <p>Sort hubs by either name or creation time.</p>
        sort_order: <p>Sort hubs by ascending or descending order.</p>
        max_results: <p>The maximum number of hubs to list.</p>
        next_token: <p>If the response to a previous <code>ListHubs</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of hubs, use the token in the next request.</p>

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

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.list_hubs_request.ListHubsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_hubs_response.ListHubsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_hubs

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListHubs")
    )
    input_: capo_sagemaker.types.list_hubs_request.ListHubsRequest = {}
    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 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