Skip to content

Projects API#

Creation#

[source]

create_project#

hopsworks.create_project(name, description=None, feature_store_topic=None)

Create a new project.

Not supported

This is not supported if you are connected to Serverless Hopsworks

Example for creating a new project

import hopsworks

hopsworks.login(...)

hopsworks.create_project("my_project", description="An example Hopsworks project")

Arguments

  • name str: The name of the project.
  • description str | None: optional description of the project
  • feature_store_topic str | None: optional feature store topic name

Returns

Project. The Project object to perform operations on


Properties#

[source]

created#

Timestamp when the project was created


[source]

description#

Description of the project


[source]

id#

Id of the project


[source]

name#

Name of the project


[source]

owner#

Owner of the project


[source]

project_namespace#

Kubernetes namespace used by project


Methods#

[source]

create_featurestore_alert#

Project.create_featurestore_alert(receiver, status, severity)

Create an alert for feature validation and monitoring in this project.

Example for creating a featurestore alert

import hopsworks
project = hopsworks.login()
project.create_featurestore_alert("my_receiver", "feature_validation_success", "info")

Arguments

  • receiver str: The receiver of the alert.
  • status str: The status of the alert. Valid values are "feature_validation_success", "feature_validation_warning", "feature_validation_failure", "feature_monitor_shift_undetected", "feature_monitor_shift_detected".
  • severity str: The severity of the alert. Valid values are "critical", "warning", "info".

Returns

ProjectAlert: The created ProjectAlert object.

Raises

  • ValueError: If the status or severity is invalid.
  • ValueError: If the receiver is None.
  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

create_job_alert#

Project.create_job_alert(receiver, status, severity)

Create an alert for jobs in this project.

Example for creating a job alert

import hopsworks
project = hopsworks.login()
project.create_job_alert("my_receiver", "long_running", "info")

Arguments

  • receiver str: The receiver of the alert.
  • status str: The status of the alert. Valid values are "job_finished", "job_failed", "job_killed", "job_long_running".
  • severity str: The severity of the alert. Valid values are "critical", "warning", "info".

Returns

ProjectAlert: The created ProjectAlert object.

Raises

  • ValueError: If the status or severity is invalid.
  • ValueError: If the receiver is None.
  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

get_alert#

Project.get_alert(alert_id)

Get an alert for the project by ID.

Arguments

  • alert_id int: The ID of the alert.

Returns

ProjectAlert: The ProjectAlert object.


[source]

get_alerts#

Project.get_alerts()

Get all alerts for the project.

Returns

List[ProjectAlert]: List of ProjectAlert objects

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

get_dataset_api#

Project.get_dataset_api()

Get the dataset api for the project.

Returns

DatasetApi: The Datasets Api handle


[source]

get_environment_api#

Project.get_environment_api()

Get the Python environment AP

Returns

EnvironmentApi: The Python Environment Api handle


[source]

get_feature_store#

Project.get_feature_store(name=None)

Connect to Project's Feature Store.

Defaulting to the project name of default feature store. To get a shared feature store, the project name of the feature store is required.

Example for getting the Feature Store API of a project

import hopsworks

project = hopsworks.login()

fs = project.get_feature_store()

Arguments

  • name str | None: Project name of the feature store.

Returns

hsfs.feature_store.FeatureStore: The Feature Store API

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

Project.get_flink_cluster_api()

Get the flink cluster API for the project.

Returns

FlinkClusterApi: The Flink Cluster Api handle


[source]

get_git_api#

Project.get_git_api()

Get the git repository api for the project.

Returns

GitApi: The Git Api handle


[source]

get_job_api#

Project.get_job_api()

Get the job API for the project.

Returns

JobApi: The Job Api handle


[source]

get_kafka_api#

Project.get_kafka_api()

Get the kafka api for the project.

Returns

KafkaApi: The Kafka Api handle


[source]

get_model_registry#

Project.get_model_registry()

Connect to Project's Model Registry API.

Example for getting the Model Registry API of a project

import hopsworks

project = hopsworks.login()

mr = project.get_model_registry()

Returns

hsml.model_registry.ModelRegistry: The Model Registry API

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

get_model_serving#

Project.get_model_serving()

Connect to Project's Model Serving API.

Example for getting the Model Serving API of a project

import hopsworks

project = hopsworks.login()

ms = project.get_model_serving()

Returns

hsml.model_serving.ModelServing: The Model Serving API

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

get_opensearch_api#

Project.get_opensearch_api()

Get the opensearch api for the project.

Returns

OpenSearchApi: The OpenSearch Api handle


[source]

get_url#

Project.get_url()