Skip to content

hopsworks.core.flink_cluster_api #

setup_cluster(
    name: str, config=None
) -> flink_cluster.FlinkCluster

Create a new flink job representing a flink cluster, or update an existing one.

import hopsworks

project = hopsworks.login()

flink_cluster_api = project.get_flink_cluster_api()

flink_config = flink_cluster_api.get_configuration()

flink_config['appName'] = "myFlinkCluster"

flink_cluster = flink_cluster_api.setup_cluster(name="myFlinkCluster", config=flink_config)
PARAMETER DESCRIPTION
name

Name of the cluster.

TYPE: str

config

Configuration of the cluster.

DEFAULT: None

RETURNS DESCRIPTION
flink_cluster.FlinkCluster

The FlinkCluster object representing the cluster.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

get_cluster(name: str) -> flink_cluster.FlinkCluster | None

Get the job corresponding to the flink cluster.

import hopsworks

project = hopsworks.login()

flink_cluster_api = project.get_flink_cluster_api()

flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
PARAMETER DESCRIPTION
name

Name of the cluster.

TYPE: str

RETURNS DESCRIPTION
flink_cluster.FlinkCluster | None

The FlinkCluster object representing the cluster or None if it does not exist.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.