Cloud (Launchpad)#

This page provides examples for managing users and access on Dataiku Cloud spaces through the Launchpad API.

Creating a Launchpad client#

Use LaunchpadClient as the entry point for all operations. To create an API key, go to your space and select Users & Access Management > API keys.

from dataikuapi.launchpad_client import LaunchpadClient

space_id = "<space-id>"
api_key_id = "<api-key-id>"
api_key_secret = "<api-key-secret>"

client = LaunchpadClient(
    space_id=space_id,
    api_key_id=api_key_id,
    api_key_secret=api_key_secret
)

Creating groups#

Create groups first, then add invites and users. build_group() returns a handle; the group is created in the Launchpad on save. In the following example, the group has no permissions on Govern or Dataiku nodes.

group = client.build_group(
    name="analytics-team",
    description="Analytics users"
)
group.launchpad_permissions = {"mayTurnOnSpace": True}
group.save()

Creating invites#

Invites are used to provision users. Once an invite is accepted, the person appears as a user in list_users().

group_name = "analytics-team"
# Single invite
invite = client.build_invite(
    email="[email protected]",
    profile="reader",
    groups=[group_name]
)
successes, errors = client.create_invites([invite])

# Bulk invites
invites = [
    client.build_invite("[email protected]", "reader", [group_name]),
    client.build_invite("[email protected]", "reader", [group_name]),
]
successes, errors = client.create_invites(invites)

Updating users#

Users are available only after an invite is accepted.

# List users currently present in the space
users = client.list_users()

# Update profile and groups for existing users
user = client.get_user("[email protected]")
user.set_profile("designer", is_trial=False)
user.add_groups(["analytics-team"])

updated, update_errors = client.update_users([user])

Adding multiple groups to a user#

Use add_groups() to add multiple groups to one user.

user = client.get_user("[email protected]")
user.add_groups(["analytics-team", "data-scientists", "designers"])
updated, update_errors = client.update_users([user])

Adding users to a group#

Use add_users() to add existing users to a group.

group = client.get_group("analytics-team")
group.add_users(["[email protected]", "[email protected]"])
group.save()

Permissions#

Permissions are managed on groups and assigned to nodes that have been granted access to the group.

Note

Permissions need to be consistent across all nodes of the same type accessible by the same group.
Permissions differ for the Launchpad, Dataiku nodes, and Govern nodes.

Note

update_permissions() grants node access by default. It can be disabled by using grant_node_access=False as a parameter.

# List permissions on the group, a group need to have access to the nodes to list permissions
group.launchpad_permissions
group.dataiku_permissions
group.govern_permissions

# List accessible nodes by the group
group.accessible_nodes

# Grant access to node "design-0" with no permissions
group.grant_node_access(
    node_name="design-0",
)
group.save()

# List default permissions for design-0
group.dataiku_permissions

# Grant access and copy permissions from another node
group.grant_node_access(
    node_name="automation-0",
    copy_permissions_from_node="design-0"
)

# Update permissions for all Dataiku nodes
group.update_permissions(
    permissions={"mayCreateProjects": True},
    node_type="dataiku"
)

# Update permissions for one specific node
group.update_permissions(
    permissions={"mayCreateProjects": True},
    node_name="design-0"
)

# Update permissions for the Govern node
group.update_permissions(
    permissions={"mayManageGovern": True},
    node_type="govern"
)

group.save()

Inspecting profiles and nodes#

Before provisioning users, check available profiles (seats) and target nodes.

profiles = client.list_profiles()
nodes = client.list_nodes()

# Optional: filter nodes by type
dataiku_nodes = client.list_nodes(type="dataiku")
govern_nodes = client.list_nodes(type="govern")

Other useful operations#

You may also need:

  • client.update_invites(...) to modify profiles or groups on pending invites

  • client.delete_invites(["user@example.com"]) to delete invites

  • client.delete_users(["user@example.com"]) to delete users

  • group.revoke_node_access(node_type="dataiku") or group.revoke_node_access(node_name="design-0") to remove a node from a group

Reference documentation#

Classes#

dataikuapi.launchpad_client.LaunchpadClient(...)

Entry point for the Launchpad API client

dataikuapi.launchpad.group.LaunchpadGroup(...)

A group on the Cloud space

dataikuapi.launchpad.user.LaunchpadInvite(...)

An invite on the Cloud space

dataikuapi.launchpad.user.LaunchpadUser(...)

A user on the Cloud space

Functions#

add_groups(groups)

Add the user to the specified groups

add_users(emails)

Add the users to the group

build_group(name[, description, emails, ...])

Get a handle for a new group

build_invite(email, profile[, groups])

Get a handle for a new invite

create_invites(invites[, fail_all_on_error])

Create invites on the Cloud space

get_user(email)

Get a handle to interact with an existing user on the Cloud space

list_users([emails])

List users on the Cloud space

save([wait_for_propagation])

Saves the group

set_profile(name[, is_trial])

Set the user's profile

update_permissions(permissions, *[, ...])

Update permissions for the specified node type or node name

update_users(users[, fail_all_on_error, ...])

Update users on the Cloud space

See Cloud for class-level API details.