Project CLI reference
Project CLI reference
Customer-hosted cloud features
note
Some features are only available on customer-hosted clouds. Reach out to support@anyscale.com for info.
Project CLI
anyscale project get
Usage
anyscale project get [OPTIONS]
Get details of a project.
Options
--id/-i: ID of the project.--json/-j: Output the details in a structured JSON format.
Examples
- CLI
$ anyscale project get --id my-project-id
anyscale project list
Usage
anyscale project list [OPTIONS]
List all projects with optional filters.
Options
--name/-n: A string to filter projects by name.--creator/-u: The ID of a creator to filter projects.--cloud/-c: The ID of a parent cloud to filter projects.--include-defaults/--exclude-defaults: Whether to include default projects.--max-items: The maximum number of projects to return.--page-size: The number of projects to return per page.--sort: Sort by FIELD (prefix with '-' for desc). Allowed: NAME--interactive/--no-interactive: Use interactive paging.--json/-j: Output the list in a structured JSON format.
Examples
- CLI
$ anyscale project list --include-defaults --non-interactive --max-items 2
anyscale project create
Usage
anyscale project create [OPTIONS]
Create a new project.
Options
--name/-n: Name of the project.--cloud/-c: Parent cloud ID for the project.--description/-d: Description of the project.--initial-cluster-config/-f: Initial cluster config for the project.
Examples
- CLI
$ anyscale project create --name "my-project" --cloud "my-cloud-id"
anyscale project delete
Usage
anyscale project delete [OPTIONS]
Delete a project.
Options
--id/-i: ID of the project to delete.
Examples
- CLI
$ anyscale project delete --id project-id
anyscale project get-default
Usage
anyscale project get-default [OPTIONS]
Get the default project for a cloud.
Options
--cloud/-c: Parent cloud ID for the project.--json/-j: Output the project in a structured JSON format.
Examples
- CLI
$ anyscale project get-default --cloud my-cloud-id --json
anyscale project add-collaborators
Usage
anyscale project add-collaborators [OPTIONS]
Add collaborators to the project.
Options
--cloud/-c: Name of the cloud that the project belongs to.--project/-p: Name of the project to add collaborators to.--users-file: Path to a YAML file containing a list of users to add to the project.
Examples
- CLI
$ anyscale project add-collaborators --cloud cloud_name --project project_name --users-file collaborators.yaml
(anyscale +1.3s) Successfully added 3 collaborators to project project_name.
$ cat collaborators.yaml
collaborators:
- email: "test1@anyscale.com"
permission_level: "collaborator"
- email: "test2@anyscale.com"
permission_level: "readonly"
- email: "test3@anyscale.com"
permission_level: "owner"
Project models
Project
Project object.
Fields
id(str): ID of the project.name(str): Name of the project.description(str): Description of the project.created_at(str): Datetime of the project creation.creator_id(str | None): ID of the creator of the project.parent_cloud_id(str | None): ID of the parent cloud.is_owner(bool): Whether the user is the owner of the project.is_read_only(bool): Whether the user has read-only access to the project.directory_name(str): Directory name of project to be used as working directory of clusters.is_default(bool): Whether the project is the default project for the organization.initial_cluster_config(str | Dict[str, Any] | None): Initial cluster config associated with the project.last_used_cloud_id(str | None): ID of the last cloud used in this project, or by the user if this is a new project.owners(List[str]): List of IDs of users who have owner access to the project.
Python Methods
def to_dict(self) -> Dict[str, Any]
"""Return a dictionary representation of the model."""
Examples
- Python
import anyscale
from anyscale.project.models import Project
project: Project = anyscale.project.get(project_id="my-project-id")
ProjectSortField
Field to sort projects by.
Values
NAME: Sort by project name.
ProjectSortOrder
Direction of sorting.
Values
ASC: Sort in ascending order.DESC: Sort in descending order.
CreateProjectCollaborator
User to be added as a collaborator to a project.
Fields
email(str): Email of the user to be added as a collaborator.permission_level(ProjectPermissionLevel): Permission level the added user should have for the project (one of: OWNER,WRITE,READONLY).
Python Methods
def to_dict(self) -> Dict[str, Any]
"""Return a dictionary representation of the model."""
Examples
- Python
import anyscale
from anyscale.project.models import ProjectPermissionLevel, CreateProjectCollaborator
create_project_collaborator = CreateProjectCollaborator(
# Email of the user to be added as a collaborator
email="test@anyscale.com",
# Permission level for the user to the project (ProjectPermissionLevel.OWNER, ProjectPermissionLevel.WRITE, ProjectPermissionLevel.READONLY)
permission_level=ProjectPermissionLevel.READONLY,
)
ProjectPermissionLevel
Permission levels for project collaborators.
Values
OWNER: Owner permission level for the projectWRITE: Write permission level for the projectREADONLY: Readonly permission level for the project