Skip to content

list_hub_contents

list_hub_contents(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hub_name: Optional[HubNameOrArn] = None,
    hub_content_type: Optional[HubContentType] = None,
    name_contains: Optional[NameContains] = None,
    max_schema_version: Optional[DocumentSchemaVersion] = None,
    creation_time_before: Optional[Timestamp] = None,
    creation_time_after: Optional[Timestamp] = None,
    sort_by: Optional[HubContentSortBy] = None,
    sort_order: Optional[SortOrder] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListHubContentsResponse

List the contents of a hub.

Parameters:

  • hub_name (Optional[HubNameOrArn], default: None ) –

    The name of the hub to list the contents of.

  • hub_content_type (Optional[HubContentType], default: None ) –

    The type of hub content to list.

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

    Only list hub content if the name contains the specified string.

  • max_schema_version (Optional[DocumentSchemaVersion], default: None ) –

    The upper bound of the hub content schema verion.

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

    Only list hub content that was created before the time specified.

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

    Only list hub content that was created after the time specified.

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

    Sort hub content versions 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 amount of hub content to list.

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

    If the response to a previous ListHubContents request was truncated, the response includes a NextToken. To retrieve the next set of hub content, use the token in the next request.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_hub_contents(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hub_name: Optional["capo_sagemaker.types.hub_name_or_arn.HubNameOrArn"] = None,
    hub_content_type: Optional[
        "capo_sagemaker.types.hub_content_type.HubContentType"
    ] = None,
    name_contains: Optional[
        "capo_sagemaker.types.name_contains.NameContains"
    ] = None,
    max_schema_version: Optional[
        "capo_sagemaker.types.document_schema_version.DocumentSchemaVersion"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    sort_by: Optional[
        "capo_sagemaker.types.hub_content_sort_by.HubContentSortBy"
    ] = 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_hub_contents_response.ListHubContentsResponse":
    """<p>List the contents of a hub.</p>

    Args:
        hub_name: <p>The name of the hub to list the contents of.</p>
        hub_content_type: <p>The type of hub content to list.</p>
        name_contains: <p>Only list hub content if the name contains the specified string.</p>
        max_schema_version: <p>The upper bound of the hub content schema verion.</p>
        creation_time_before: <p>Only list hub content that was created before the time specified.</p>
        creation_time_after: <p>Only list hub content that was created after the time specified.</p>
        sort_by: <p>Sort hub content versions by either name or creation time.</p>
        sort_order: <p>Sort hubs by ascending or descending order.</p>
        max_results: <p>The maximum amount of hub content to list.</p>
        next_token: <p>If the response to a previous <code>ListHubContents</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of hub content, use the token in the next request.</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_hub_contents_request.ListHubContentsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_hub_contents_response.ListHubContentsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_hub_contents

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListHubContents")
    )
    input_: capo_sagemaker.types.list_hub_contents_request.ListHubContentsRequest = {}
    if hub_name is not None:
        input_["hub_name"] = hub_name
    if hub_content_type is not None:
        input_["hub_content_type"] = hub_content_type
    if name_contains is not None:
        input_["name_contains"] = name_contains
    if max_schema_version is not None:
        input_["max_schema_version"] = max_schema_version
    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 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