Skip to content

list_cluster_nodes async

list_cluster_nodes(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    cluster_name: Optional[ClusterNameOrArn] = None,
    creation_time_after: Optional[Timestamp] = None,
    creation_time_before: Optional[Timestamp] = None,
    instance_group_name_contains: Optional[ClusterInstanceGroupName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    sort_by: Optional[ClusterSortBy] = None,
    sort_order: Optional[SortOrder] = None,
    include_node_logical_ids: Optional[IncludeNodeLogicalIdsBoolean] = None,
) -> ListClusterNodesResponse

Retrieves the list of instances (also called nodes interchangeably) in a SageMaker HyperPod cluster.

Parameters:

  • cluster_name (Optional[ClusterNameOrArn], default: None ) –

    The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster in which you want to retrieve the list of nodes.

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

    A filter that returns nodes in a SageMaker HyperPod cluster created after the specified time. Timestamps are formatted according to the ISO 8601 standard.

    Acceptable formats include:

    • YYYY-MM-DDThh:mm:ss.sssTZD (UTC), for example, 2014-10-01T20:30:00.000Z

    • YYYY-MM-DDThh:mm:ss.sssTZD (with offset), for example, 2014-10-01T12:30:00.000-08:00

    • YYYY-MM-DD, for example, 2014-10-01

    • Unix time in seconds, for example, 1412195400. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC.

    For more information about the timestamp format, see Timestamp in the Amazon Web Services Command Line Interface User Guide.

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

    A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for CreationTimeAfter. For more information about the timestamp format, see Timestamp in the Amazon Web Services Command Line Interface User Guide.

  • instance_group_name_contains (Optional[ClusterInstanceGroupName], default: None ) –

    A filter that returns the instance groups whose name contain a specified string.

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

    The maximum number of nodes to return in the response.

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

    If the result of the previous ListClusterNodes request was truncated, the response includes a NextToken. To retrieve the next set of cluster nodes, use the token in the next request.

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

    The field by which to sort results. The default value is CREATION_TIME.

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

    The sort order for results. The default value is Ascending.

  • include_node_logical_ids (Optional[IncludeNodeLogicalIdsBoolean], default: None ) –

    Specifies whether to include nodes that are still being provisioned in the response. When set to true, the response includes all nodes regardless of their provisioning status. When set to False (default), only nodes with assigned InstanceIds are returned.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def list_cluster_nodes(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    cluster_name: Optional[
        "capo_sagemaker.types.cluster_name_or_arn.ClusterNameOrArn"
    ] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    instance_group_name_contains: Optional[
        "capo_sagemaker.types.cluster_instance_group_name.ClusterInstanceGroupName"
    ] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    sort_by: Optional["capo_sagemaker.types.cluster_sort_by.ClusterSortBy"] = None,
    sort_order: Optional["capo_sagemaker.types.sort_order.SortOrder"] = None,
    include_node_logical_ids: Optional[
        "capo_sagemaker.types.include_node_logical_ids_boolean.IncludeNodeLogicalIdsBoolean"
    ] = None,
) -> "capo_sagemaker.types.list_cluster_nodes_response.ListClusterNodesResponse":
    """<p>Retrieves the list of instances (also called <i>nodes</i> interchangeably) in a SageMaker HyperPod cluster.</p>

    Args:
        cluster_name: <p>The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster in which you want to retrieve the list of nodes.</p>
        creation_time_after: <p>A filter that returns nodes in a SageMaker HyperPod cluster created after the specified time. Timestamps are formatted according to the ISO 8601 standard. </p> <p>Acceptable formats include:</p> <ul> <li> <p> <code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code> </p> </li> <li> <p> <code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (with offset), for example, <code>2014-10-01T12:30:00.000-08:00</code> </p> </li> <li> <p> <code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code> </p> </li> <li> <p>Unix time in seconds, for example, <code>1412195400</code>. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC.</p> </li> </ul> <p>For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
        creation_time_before: <p>A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for <code>CreationTimeAfter</code>. For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
        instance_group_name_contains: <p>A filter that returns the instance groups whose name contain a specified string.</p>
        max_results: <p>The maximum number of nodes to return in the response.</p>
        next_token: <p>If the result of the previous <code>ListClusterNodes</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of cluster nodes, use the token in the next request.</p>
        sort_by: <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
        sort_order: <p>The sort order for results. The default value is <code>Ascending</code>.</p>
        include_node_logical_ids: <p>Specifies whether to include nodes that are still being provisioned in the response. When set to true, the response includes all nodes regardless of their provisioning status. When set to <code>False</code> (default), only nodes with assigned <code>InstanceIds</code> are returned.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.list_cluster_nodes_request.ListClusterNodesRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.list_cluster_nodes_response.ListClusterNodesResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_cluster_nodes

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListClusterNodes")
    )
    input_: capo_sagemaker.types.list_cluster_nodes_request.ListClusterNodesRequest = {}
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if creation_time_after is not None:
        input_["creation_time_after"] = creation_time_after
    if creation_time_before is not None:
        input_["creation_time_before"] = creation_time_before
    if instance_group_name_contains is not None:
        input_["instance_group_name_contains"] = instance_group_name_contains
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if include_node_logical_ids is not None:
        input_["include_node_logical_ids"] = include_node_logical_ids

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