View Cluster Cleanup Activity

GET /api/v1.3/clusters/<cluster_id>/cleanup_activity

This API returns the status of the last cleanup check. It is supported with QDS version R57 onwards. Invoke this API with the cluster ID or a label that is assigned to it. The supported versions are v1.2, v1.3, v2, v2.1, and v2.2.

Note

Viewing the Cluster Cleanup Status describes how to see the cleanup status through the UI.

Required Role

The following users can make this API call:

  • Users who belong to the system-user or system-admin group.

  • Users who belong to a group associated with a role that allows viewing clusters. See Managing Groups and Managing Roles for more information.

Parameters

Note

Parameters marked in bold are mandatory. Others are optional and have default values.

Parameter

Description

cluster_id

The cluster ID of the cluster.

cluster_inst_id

The ID of a particular cluster instance. If it is provided, the API returns the last cleanup activity of that particular cluster instance. If it is not provided, the status of the last/active cluster instance is provided.

Request API Syntax

curl -i -X GET -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
"https://api.qubole.com/api/v1.3/clusters/<cluster_id>/cleanup_activity?cluster_inst_id=<cluster_inst_id>"

Note

The above syntax uses https://api.qubole.com as the endpoint. Qubole provides other endpoints to access QDS that are described in Supported Qubole Endpoints on Different Cloud Providers.

Sample API Request

curl -i -X GET -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
"https://api.qubole.com/api/v1.3/clusters/210/cleanup_activity?cluster_inst_id=1230"

Sample Response

{
 "data": {
    "last_cleanup_at": "2019-09-26T09:07:24Z",
    "action": "NOT_TERMINATING",
    "reason": {
        "type": "IDLE_TIMEOUT_NOT_CROSSED",
        "display_string": "Waiting for idle cluster timeout."
              },
    "next_cleanup_at": 2019-09-26T09:12:24Z”
   }
}

action Types

In the API response, the following table describes the two values for the action response parameter.

action

Description

TERMINATING

It implies that it is the last cleanup status when the cluster is terminating.

NOT_TERMINATING

It implies that it is the last cleanup status when the cluster is not terminating.

reason Types

The following table lists the possible reasons that can be returned in the API response under the reason section. It provides the reason why a particular action took place.

Type

Description

ACCOUNT_USAGE_CROSSED

The account usage (QCUH) limit has been crossed.

MAX_RUNNING_TIME_CROSSED

The maximum running time for the cluster has been crossed.

CHILD_RM_IS_NOT_FREE

The HS2 cluster’s resource manager is not free on the cluster.

RM_IS_NOT_FREE

The resource manager is not free on the cluster.

IDLE_TIMEOUT_NOT_CROSSED

The cluster has not crossed the idle timeout set.

WHITELISTED

The cluster is whitelisted to not terminate.

HS2_CLUSTER

An HS2 cluster cannot be cleaned on its own.

TERMINATION_DISALLOWED

Disallowed termination has been checked in the configuration.

QUERY_RUNNING

A query/queries is/are still running on the cluster.

TERMINATED_SUCCESSFULLY

The cluster has been successfully cleaned.

TERMINATED_UNSUCCESSFULLY

Cluster cleanup was initiated, but the termination failed due to an error.

TERMINATED_TIMEDOUT

Cluster cleanup was initiated, but the termination timed out due to an error.