Skip to main content

User API Reference

Customer-hosted cloud features

note

Some features are only available on customer-hosted clouds. Reach out to support@anyscale.com for info.

User CLI

user batch-create

Usage

user batch-create [OPTIONS]

Batch create, as an admin, users without email verification.

Options

  • --users-file/-f: Path to a YAML file that contains the information for user accounts to be created.

Examples

$ anyscale user batch-create --users-file users.yaml
(anyscale +0.5s) Creating users...
(anyscale +0.8s) 2 users created.

$ cat users_file.yaml
create_users:
- name: name1
email: test1@anyscale.com
password: ''
is_sso_user: false
lastname: lastname1
title: title1
- name: name2
email: test2@anyscale.com
password: ''
is_sso_user: false
lastname: lastname2
title: title2

User SDK

anyscale.user.admin_batch_create

Batch create, as an admin, users without email verification.

Arguments

  • admin_create_users (List[AdminCreateUser]): Users to be created by an admin.

Returns: List[AdminCreatedUser]

Examples

import anyscale
from anyscale.user.models import AdminCreateUser

anyscale.user.admin_batch_create(
[AdminCreateUser(
name="name",
email="test@anyscale.com",
password="",
is_sso_user=False,
lastname="lastname",
title="title",
),],
)

User Models

AdminCreateUser

User to be created by an admin.

Fields

  • name (str): First name of the user to be created.
  • email (str): Email of the user to be created.
  • password (str | None): Password for the user account being created.
  • is_sso_user (bool): Whether the user is an SSO user. SSO users can log in using SSO.
  • lastname (str | None): Optional last name of the user to be created.
  • title (str | None): Optional title of the user to be created.

Python Methods

def to_dict(self) -> Dict[str, Any]
"""Return a dictionary representation of the model."""

Examples

import anyscale
from anyscale.user.models import AdminCreateUser

admin_create_user = AdminCreateUser(
# First name of the user to be created.
name="name",
# Email of the user to be created.
email="test@anyscale.com",
# Password for the user account being created.
password="",
# Whether the user is an SSO user. SSO users can log in using SSO.
is_sso_user=False,
# Optional last name of the user to be created.
lastname="lastname",
# Optional title of the user to be created.
title="title",
)

AdminCreatedUser

User account created by an admin that has organization collaborator permissions.

Fields

  • user_id (str): ID of the user that has been created.
  • name (str): First name of the user that has been created.
  • email (str): Email of the user that has been created.
  • created_at (datetime): The timestamp of when the user is created.
  • is_sso_user (bool): Whether the user is an SSO user. SSO users can log in using SSO.
  • lastname (str | None): Optional last name of the user that has been created.
  • title (str | None): Optional title of the user that has been created.

Python Methods

def to_dict(self) -> Dict[str, Any]
"""Return a dictionary representation of the model."""

Examples

import anyscale
from anyscale.user.models import AdminCreatedUser

admin_create_user = AdminCreateUser(
# First name of the user to be created.
name="name",
# Email of the user to be created.
email="test@anyscale.com",
# Password for the user account being created.
password="",
# Whether the user is an SSO user. SSO users can log in using SSO.
is_sso_user=False,
# Optional last name of the user to be created.
lastname="lastname",
# Optional title of the user to be created.
title="title",
)
admin_created_users: List[AdminCreatedUser] = anyscale.user.admin_batch_create([admin_create_user])