Connection API#
Creation#
connection#
Connection.connection(
host=None,
port=443,
project=None,
hostname_verification=True,
trust_store_path=None,
cert_folder="/tmp",
api_key_file=None,
api_key_value=None,
)
Connection factory method, accessible through hopsworks.connection()
.
Properties#
api_key_file#
api_key_value#
cert_folder#
host#
hostname_verification#
port#
project#
trust_store_path#
Methods#
close#
Connection.close()
Close a connection gracefully.
This will clean up any materialized certificates on the local file system of external environments such as AWS SageMaker.
Usage is optional.
connect#
Connection.connect()
Instantiate the connection.
Creating a Connection
object implicitly calls this method for you to instantiate the connection. However, it is possible to close the connection gracefully with the close()
method, in order to clean up materialized certificates. This might be desired when working on external environments such as AWS SageMaker. Subsequently you can call connect()
again to reopen the connection.
Example
import hopsworks
conn = hopsworks.connection()
conn.close()
conn.connect()
connection#
Connection.connection(
host=None,
port=443,
project=None,
hostname_verification=True,
trust_store_path=None,
cert_folder="/tmp",
api_key_file=None,
api_key_value=None,
)
Connection factory method, accessible through hopsworks.connection()
.
create_project#
Connection.create_project(name, description=None, feature_store_topic=None)
Create a new project.
Example for creating a new project
import hopsworks
connection = hopsworks.connection()
connection.create_project("my_hopsworks_project", description="An example Hopsworks project")
- name
str
: The name of the project. - description
str
: optional description of the project - feature_store_topic
str
: optional feature store topic name
Returns
Project
. A project handle object to perform operations on.
get_project#
Connection.get_project(name=None)
Get an existing project.
Arguments
- name
str
: The name of the project.
Returns
Project
. A project handle object to perform operations on.
get_projects#
Connection.get_projects()
Get all projects.
Returns
List[Project]
: List of Project objects
get_secrets_api#
Connection.get_secrets_api()
Get the secrets api.
Returns
SecretsApi
: The Secrets Api handle
project_exists#
Connection.project_exists(name)
Check if a project exists.
Arguments
- name
str
: The name of the project.
Returns
bool
. True if project exists, otherwise False