Projects API
Listing projects
To list all projects, call:
- Python
- Scala
client.projects.list()
This method returns a Python generator which can be used to lazily iterate over all projects.
client.projects.list()
This method returns a Scala iterator which can be used to lazily iterate over all projects.
Listing feature sets across multiple projects
Each project entity allows you to list projects in it as:
- Python
- Scala
client.projects.get("..").list()
client.projects.get("..").list()
however this only lists feature sets in that specific project. To list feature sets across multiple projects, run:
- Python
- Scala
client.projects.list_feature_sets(["project_name_A", "project_name_B"])
client.projects.listFeatureSets(["project_name_A", "project_name_B"])
The single argument of this method is always an array containing the names of projects in which to perform the feature set search.
The list method does not return feature sets directly, but instead returns an iterator which obtains the feature sets lazily.
Create a project
To create a project, call:
- Python
- Scala
project = client.projects.create(project_name="project", description="description", secret=False, locked=None)
If the secret
argument is set to True
, the project is visible only
to its owner. Other users in the system cannot see the project in the
output of the list projects call and can not view the project details.
If the locked
argument is set to True
, only users with consumer
permission can list and get feature sets from this project. If this
parameter is provided, the default value provided by the backend is
used.
val project = client.projects.create(projectName="project", description="description", secret=false, locked=None)
If the locked
argument is set to Some(true)
, only users with
consumer permission can list and get feature sets from this project. If
this parameter is provided, the default value provided by the backend is
used.
To see naming conventions for project names, visit Default naming rules.
Get an existing project
To get an existing project, call:
- Python
- Scala
project = client.projects.get("project")
val project = client.projects.get("project")
Remove a project
To remove the project, call:
- Python
- Scala
project.delete()
project.delete()
This will remove all feature sets and features stored inside this project.
Update project fields
The following fields are modifiable on the project api:
- Python
- Scala
- locked
- secret
- description
- custom_data
- locked
- secret
- description
- customData
To update the field, simply call the setter of that field. For example, to update the secret, call:
- Python
- Scala
project.secret = False
project.secret = false
To retrospectively find out who and when updated project, call:
- Python
- Scala
project.last_updated_by
project.last_updated_date_time
project.lastUpdatedBy
project.lastUpdatedDateTime
To see how to set permissions on projects, visit Authentication.
Listing project users
From project owner's perspective, it may be needed to understand who is actually allowed to access and modify the given project. Therefore, there are convenience methods to list project users according to their rights. Each of these methods returns list of users that have specified or higher rights, their actual access rights and a resource type specifying, where the access right permission comes from.
The list method does not return users directly. Instead, it returns an iterator which obtains the users lazily.
- Python
- Scala
# listing users by access rights
project = client.projects.get("training_project")
owners = project.list_owners()
editors = project.list_editors()
sensitive_consumers = project.list_sensitive_consumers()
consumers = project.list_consumers()
viewers = project.list_viewers()
# accessing returned element
owner = next(owners)
owner.user
owner.access_type
owner.resource_type
// listing users by access rights
val project = client.projects.get("training_project")
val owners = project.listOwners()
val editors = project.listEditors()
val sensitiveConsumers = project.listSensitiveConsumers()
val consumers = project.listConsumers()
val viewers = project.listViewers()
// accessing returned element
val owner = owners.next
owner.user
owner.accessType
owner.resourceType
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai