VK Cloud logo

Working with Cloud Spark clusters

These methods allow you to manage the Cloud Spark clusters available in the project.

get_clusters

Get a list of all available Cloud Spark clusters.

Required token role: Administrator or User. Learn more about token roles.

Method arguments

No arguments.

Return value

A list of K8sClusterInfo class objects with information about the available Cloud Spark clusters.

Method signature and usage example

get_cluster_info

Get detailed information about a Cloud Spark cluster by its identifier.

Required token role: Administrator or User. Learn more about token roles.

Method arguments

Argument

Type

Description

cluster_id

(required)

str

Cloud Spark cluster identifier

The list of Cloud Spark clusters and their identifiers can be obtained using the get_clusters method

Return value

A K8sClusterInfo class object with information about the cluster.

Method signature and usage example

set_cluster_delete_time

Set the cluster idle time after which the cluster will be automatically deleted.

Required token role: Administrator. Learn more about token roles.

Method arguments

Argument

Type

Description

cluster_id

(required)

str

Cloud Spark cluster identifier.

The list of Cloud Spark clusters and their identifiers can be obtained using the get_clusters method

minutes

(required)

int

Maximum cluster idle time in minutes

Return value

A K8sClusterInfo class object. If successful, the delete_after_inactive_min field of the object will contain the specified maximum cluster idle time.

Method signature and usage example

remove_cluster_delete_time

Remove the maximum cluster idle time after which the cluster will be automatically deleted.

Required token role: Administrator. Learn more about token roles.

Method arguments

Argument

Type

Description

cluster_id

(required)

str

Cloud Spark cluster identifier.

The list of Cloud Spark clusters and their identifiers can be obtained using the get_clusters method

Return value

A K8sClusterInfo class object. If successful, the delete_after_inactive_min field of the object will contain the value None.

Method signature and usage example

set_cluster_suspend_time

Set the cluster idle time after which the cluster will be automatically stopped.

Required token role: Administrator. Learn more about token roles.

Method arguments

Argument

Type

Description

cluster_id

(required)

str

Cloud Spark cluster identifier.

The list of Cloud Spark clusters and their identifiers can be obtained using the get_clusters method

minutes

(required)

int

Maximum cluster idle time in minutes

Return value

A K8sClusterInfo class object. If successful, the suspend_after_inactive_min field of the object will contain the specified maximum cluster idle time.

Method signature and usage example

remove_cluster_suspend_time

Remove the maximum cluster idle time after which the cluster will be automatically stopped.

Required token role: Administrator. Learn more about token roles.

Method arguments

Argument

Type

Description

cluster_id

(required)

str

Cloud Spark cluster identifier.

The list of Cloud Spark clusters and their identifiers can be obtained using the get_clusters method

Return value

A K8sClusterInfo class object. If successful, the suspend_after_inactive_min field of the object will contain the value None.

Method signature and usage example

stop

Terminate all current connections to the cluster.

Required token role: Administrator. Learn more about token roles.

Method arguments

No arguments.

Return value

No return value.

Method signature and usage example

wake_up_cluster

Activate the cluster.

Required token role: Administrator. Learn more about token roles.

Method arguments

Argument

Type

Description

cluster_id

(required)

str

Cloud Spark cluster identifier.

The list of Cloud Spark clusters and their identifiers can be obtained using the get_clusters method

Return value

No return value.

Method signature and usage example

Was this article helpful?