Skip to content

list_cluster_events

list_cluster_events(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_name: Optional[ClusterNameOrArn] = None,
    instance_group_name: Optional[ClusterInstanceGroupName] = None,
    node_id: Optional[ClusterNodeId] = None,
    event_time_after: Optional[Timestamp] = None,
    event_time_before: Optional[Timestamp] = None,
    sort_by: Optional[EventSortBy] = None,
    sort_order: Optional[SortOrder] = None,
    resource_type: Optional[ClusterEventResourceType] = None,
    max_results: Optional[ClusterEventMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListClusterEventsResponse

Retrieves a list of event summaries for a specified HyperPod cluster. The operation supports filtering, sorting, and pagination of results. This functionality is only supported when the NodeProvisioningMode is set to Continuous.

Parameters:

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

    The name or Amazon Resource Name (ARN) of the HyperPod cluster for which to list events.

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

    The name of the instance group to filter events. If specified, only events related to this instance group are returned.

  • node_id (Optional[ClusterNodeId], default: None ) –

    The EC2 instance ID to filter events. If specified, only events related to this instance are returned.

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

    The start of the time range for filtering events. Only events that occurred after this time are included in the results.

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

    The end of the time range for filtering events. Only events that occurred before this time are included in the results.

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

    The field to use for sorting the event list. Currently, the only supported value is EventTime.

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

    The order in which to sort the results. Valid values are Ascending or Descending (the default is Descending).

  • resource_type (Optional[ClusterEventResourceType], default: None ) –

    The type of resource for which to filter events. Valid values are Cluster, InstanceGroup, or Instance.

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

    The maximum number of events to return in the response. Valid range is 1 to 100.

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

    A token to retrieve the next set of results. This token is obtained from the output of a previous ListClusterEvents call.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_cluster_events(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_name: Optional[
        "capo_sagemaker.types.cluster_name_or_arn.ClusterNameOrArn"
    ] = None,
    instance_group_name: Optional[
        "capo_sagemaker.types.cluster_instance_group_name.ClusterInstanceGroupName"
    ] = None,
    node_id: Optional["capo_sagemaker.types.cluster_node_id.ClusterNodeId"] = None,
    event_time_after: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    event_time_before: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    sort_by: Optional["capo_sagemaker.types.event_sort_by.EventSortBy"] = None,
    sort_order: Optional["capo_sagemaker.types.sort_order.SortOrder"] = None,
    resource_type: Optional[
        "capo_sagemaker.types.cluster_event_resource_type.ClusterEventResourceType"
    ] = None,
    max_results: Optional[
        "capo_sagemaker.types.cluster_event_max_results.ClusterEventMaxResults"
    ] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
) -> "capo_sagemaker.types.list_cluster_events_response.ListClusterEventsResponse":
    """<p>Retrieves a list of event summaries for a specified HyperPod cluster. The operation supports filtering, sorting, and pagination of results. This functionality is only supported when the <code>NodeProvisioningMode</code> is set to <code>Continuous</code>.</p>

    Args:
        cluster_name: <p>The name or Amazon Resource Name (ARN) of the HyperPod cluster for which to list events.</p>
        instance_group_name: <p>The name of the instance group to filter events. If specified, only events related to this instance group are returned.</p>
        node_id: <p>The EC2 instance ID to filter events. If specified, only events related to this instance are returned.</p>
        event_time_after: <p>The start of the time range for filtering events. Only events that occurred after this time are included in the results.</p>
        event_time_before: <p>The end of the time range for filtering events. Only events that occurred before this time are included in the results.</p>
        sort_by: <p>The field to use for sorting the event list. Currently, the only supported value is <code>EventTime</code>.</p>
        sort_order: <p>The order in which to sort the results. Valid values are <code>Ascending</code> or <code>Descending</code> (the default is <code>Descending</code>).</p>
        resource_type: <p>The type of resource for which to filter events. Valid values are <code>Cluster</code>, <code>InstanceGroup</code>, or <code>Instance</code>.</p>
        max_results: <p>The maximum number of events to return in the response. Valid range is 1 to 100.</p>
        next_token: <p>A token to retrieve the next set of results. This token is obtained from the output of a previous <code>ListClusterEvents</code> call.</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_cluster_events_request.ListClusterEventsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_cluster_events_response.ListClusterEventsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_cluster_events

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListClusterEvents")
    )
    input_: capo_sagemaker.types.list_cluster_events_request.ListClusterEventsRequest = {}
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if instance_group_name is not None:
        input_["instance_group_name"] = instance_group_name
    if node_id is not None:
        input_["node_id"] = node_id
    if event_time_after is not None:
        input_["event_time_after"] = event_time_after
    if event_time_before is not None:
        input_["event_time_before"] = event_time_before
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if resource_type is not None:
        input_["resource_type"] = resource_type
    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