Cloud API Reference (0.26.61)
Cloud API Reference (0.26.61)
This is archived documentation for version 0.26.61. For the current documentation, see current documentation.
Customer-hosted cloud features
Some features are only available on customer-hosted clouds. Reach out to support@anyscale.com for info.
Cloud CLI
anyscale cloud setup
Usage
anyscale cloud setup [OPTIONS]
Set up a cloud provider.
Options
--provider: The cloud provider type.--region: Region to set up the credentials in.--name/-n: Name of the cloud.--project-id: Globally Unique project ID for GCP clouds (e.g., my-project-abc123)--functional-verify: Verify the cloud is functional. This will check that the cloud can launch workspace/service.--anyscale-managed: Let anyscale create all the resources.--enable-head-node-fault-tolerance: Whether to enable head node fault tolerance for services.--yes/-y: Skip asking for confirmation.--disable-auto-add-user: All users in the organization will be added to clouds created withanyscale cloud setupby default. Specify --disable-auto-add-user to disable this and instead manually grant users permissions to the cloud.--shared-storage: The type of shared storage to use for the cloud. Use 'object-storage' for cloud bucket-based storage (e.g., S3, GCS), or 'nfs' for network file systems.
anyscale cloud register
Usage
anyscale cloud register [OPTIONS]
Register an anyscale cloud with your own resources.
Options
--provider: The cloud provider type.--region: Region to set up the credentials in.--compute-stack: The compute stack type (VM or K8S).--name/-n: Name of the cloud.--vpc-id: The ID of the VPC.--subnet-ids: Comma separated list of subnet ids.--file-storage-id: File storage ID (e.g. EFS ID for AWS, Filestore instance ID for GCP)--efs-id: The EFS ID.--anyscale-iam-role-id: The Anyscale IAM Role ARN.--instance-iam-role-id: The instance IAM role ARN.--security-group-ids: IDs of the security groups.--s3-bucket-id: S3 bucket ID.--external-id: The trust policy external ID for the cross account IAM role.--memorydb-cluster-id: Memorydb cluster ID--project-id: Globally Unique project ID for GCP clouds (e.g., my-project-abc123)--vpc-name: VPC name for GCP clouds--subnet-names: Comma separated list of subnet names for GCP clouds--filestore-instance-id: Filestore instance ID for GCP clouds.--filestore-location: Filestore location for GCP clouds.--anyscale-service-account-email: Anyscale service account email for GCP clouds.--instance-service-account-email: Instance service account email for GCP clouds.--provider-name: Workload Identity Federation provider name for Anyscale access.--firewall-policy-names: Filewall policy names for GCP clouds--cloud-storage-bucket-name: A fully qualified storage bucket name for cloud storage, e.g. s3://bucket-name, gs://bucket-name, or abfss://bucket-name@account.dfs.core.windows.net.--cloud-storage-bucket-endpoint: An endpoint for cloud storage, e.g. used to override the default cloud storage scheme's endpoint (e.g. for S3, this would be passed to the AWS_ENDPOINT_URL environment variable).--cloud-storage-bucket-region: The region of the cloud storage bucket. If not provided, the region of the cloud will be used to access the cloud storage bucket.--nfs-mount-target: A comma-separated value representing a (zone, mount target) tuple, e.g. us-west-2a,1.2.3.4 (may be provided multiple times, one for each zone). If only one value is provided (e.g. 1.2.3.4), then that value will be used for all zones.--nfs-mount-path: The path of the NFS server to mount from (e.g. nfs-target-address/nfs-path will be mounted).--persistent-volume-claim: For Kubernetes deployments only, the name of the persistent volume claim used to mount shared storage into pods. Mutually exclusive with NFS configurations.--csi-ephemeral-volume-driver: For Kubernetes deployments only, the CSI ephemeral volume driver used to mount shared storage into pods. Mutually exclusive with NFS configurations.--memorystore-instance-name: Memorystore instance name for GCP clouds--host-project-id: Host project ID for shared VPC--kubernetes-zones: On the Kubernetes compute stack, a comma-separated list of zones to launch pods in.--anyscale-operator-iam-identity: On the Kubernetes compute stack, the cloud provider IAM identity federated with the Anyscale Operator's kubernetes service account, which will be used by Anyscale control plane for validation during Anyscale Operator bootstrap in the dataplane. IN AWS EKS, this is the ARN of the IAM role. For GCP GKE, this is the service account email.--private-network: Use private network.--functional-verify: Verify the cloud is functional. This will check that the cloud can launch workspace/service.--yes/-y: Skip asking for confirmation.--skip-verifications: Skip verifications. This will skip all verifications.--enable-auto-add-user: If --enable-auto-add-user is specified for a cloud, all users in the organization will be added to the cloud by default. Otherwise users will need to be manually granted permissions to the cloud. Note: There may be up to 30 sec delay for all users to be granted permissions after the cloud is created.
anyscale cloud edit
Usage
anyscale cloud edit [OPTIONS] [CLOUD_NAME]
Edit registered cloud resource on Anyscale. Only applicable for anyscale registered clouds.
Options
--name/-n: Edit cloud by name.--cloud-id/--id: Edit cloud by id, alternative to cloud name.--aws-s3-id: New S3 bucket ID.--aws-efs-id: New EFS ID.--aws-efs-mount-target-ip: New EFS mount target IP.--memorydb-cluster-id: New AWS Memorydb cluster ID.--gcp-filestore-instance-id: New GCP filestore instance id.--gcp-filestore-location: New GCP filestore location.--gcp-cloud-storage-bucket-name: New GCP Cloud storage bucket name.--memorystore-instance-name: New Memorystore instance name for GCP clouds--functional-verify: Verify the cloud is functional. This will check that the cloud can launch workspace/service.--enable-auto-add-user/--disable-auto-add-user: If --enable-auto-add-user is specified for a cloud, all users in the organization will be added to the cloud by default. Note: There may be up to 30 sec delay for all users to be granted permissions after this feature is enabled.
Specifying --disable-auto-add-user will require that users are manually granted permissions to access the cloud. No existing cloud permissions are altered by specifying this flag.
anyscale cloud update
Usage
anyscale cloud update [OPTIONS] [CLOUD_NAME]
Update a cloud.
Options
--cloud-id/--id: Cloud id to update. Alternative to cloud name.--name/-n: Update configuration of cloud by name.--yes/-y: Skip asking for confirmation.--functional-verify: Verify the cloud is functional. This will check that the cloud can launch workspace/service.--enable-head-node-fault-tolerance: Whether to enable head node fault tolerance for services.--enable-auto-add-user/--disable-auto-add-user: If --enable-auto-add-user is specified for a cloud, all users in the organization will be added to the cloud by default. Note: There may be up to 30 sec delay for all users to be granted permissions after this feature is enabled.
Specifying --disable-auto-add-user will require that users are manually granted permissions to access the cloud. No existing cloud permissions are altered by specifying this flag.
--resources-file/-f: EXPERIMENTAL: Path to a YAML file defining a list of cloud resources. Schema: https://docs.anyscale.com/reference/cloud/#cloudresource.--skip-verification: Skip cloud resource verification.
anyscale cloud delete
Usage
anyscale cloud delete [OPTIONS] [CLOUD_NAME]
Delete a cloud.
Options
--name/-n: Delete cloud by name.--cloud-id/--id: Cloud id to delete. Alternative to cloud name.--yes/-y: Don't ask for confirmation.
anyscale cloud verify
Usage
anyscale cloud verify [OPTIONS] [CLOUD_NAME]
Checks the healthiness of a cloud.
Options
--name/-n: Verify cloud by name.--cloud-id/--id: Verify cloud by cloud id, alternative to cloud name.--functional-verify: Verify the cloud is functional. This will check that the cloud can launch workspace/service.--strict: Strict Verify. Treat warnings as failures.
anyscale cloud list
Usage
anyscale cloud list [OPTIONS]
List information about clouds in your Anyscale organization.
Options
--name/-n: Name of cloud to get information about.--cloud-id/--id: Id of cloud to get information about.--max-items: Max items to show in list.
anyscale cloud resource create Alpha
This command is in early development and may change. Users must be tolerant of change.
Usage
anyscale cloud resource create [OPTIONS]
Create a new cloud resource in an existing cloud.
Options
--cloud: The name of the cloud to add the new resource to.--cloud-id: The ID of the cloud to add the new resource to.--file/-f: Path to a YAML file defining the cloud resource. Schema: https://docs.anyscale.com/reference/cloud/#cloudresource.--skip-verification: Skip cloud resource verification.--yes/-y: Skip asking for confirmation.
Examples
- CLI
$ anyscale cloud resource create --cloud my-cloud -f new-cloud-resource.yaml
Successfully created cloud resource my-new-resource in cloud my-cloud.
$ cat new-cloud-resource.yaml
name: my-new-resource
provider: AWS
compute_stack: VM
region: us-west-2
networking_mode: PUBLIC
object_storage:
bucket_name: s3://my-bucket
file_storage:
file_storage_id: fs-123
aws_config:
vpc_id: vpc-123
subnet_ids:
- subnet-123
security_group_ids:
- sg-123
anyscale_iam_role_id: arn:aws:iam::123456789012:role/anyscale-role-123
cluster_iam_role_id: arn:aws:iam::123456789012:role/cluster-role-123
memorydb_cluster_name: my-memorydb-cluster
anyscale cloud resource delete Alpha
This command is in early development and may change. Users must be tolerant of change.
Usage
anyscale cloud resource delete [OPTIONS]
Remove a cloud resource from an existing cloud.
Options
--cloud: The name of the cloud to remove the resource from.--resource: The name of the cloud resource to remove.--yes/-y: Skip asking for confirmation.
Examples
- CLI
$ anyscale cloud resource delete --cloud my-cloud --resource my-resource
Output
Please confirm that you would like to remove resource my-resource from cloud my-cloud. [y/N]: y
(anyscale +3.5s) Successfully removed resource my-resource from cloud my-cloud!
anyscale cloud config get
Usage
anyscale cloud config get [OPTIONS] [CLOUD_NAME]
Get the current configuration for a cloud.
Options
--name/-n: Update configuration of cloud by name.--cloud-id/--id: Cloud id to get details about. Alternative to cloud name.
anyscale cloud config update
Usage
anyscale cloud config update [OPTIONS] [CLOUD_NAME]
Update the current configuration for a cloud.
Options
--name/-n: Update configuration of cloud by name.--cloud-id/--id: Cloud id to update. Alternative to cloud name.--enable-log-ingestion/--disable-log-ingestion: If --enable-log-ingestion is specified for a cloud, it will enable the log viewing and querying UI features for the clusters on this cloud. This will enable easier debugging. The logs produced by the clusters will be sent from the data plane to the control plane. Anyscale does not share this data with any third party or use it for any purpose other than serving the log UI for the customer. The log will be stored at most 30 days.Please note by disable this feature again, Anyscale doesn't delete the logs that have already been ingested. Your clusters may incur extra data transfer cost from the cloud provider by enabling this feature.--enable-system-cluster/--disable-system-cluster: Enable or disable system cluster functionality.--spec-file: Provide a path to a specification file.
Examples
- CLI
$ anyscale cloud config update --cloud-id cloud_id --enable-log-ingestion --enable-system-cluster
--enable-log-ingestion is specified. [...] If you are sure you want to enable this feature, please type "consent": consent
Output
(anyscale +7.3s) Successfully updated log ingestion configuration for cloud, cloud_id to True
--enable-system-cluster is specified. [...] Are you sure you want to enable system cluster? [y/N]: y
Output
(anyscale +11.4s) Successfully enabled system cluster for cloud cloud_id
anyscale cloud set-default
Usage
anyscale cloud set-default [OPTIONS] [CLOUD_NAME]
Sets default cloud for your organization. This operation can only be performed by organization admins, and the default cloud must have organization level permissions.
Options
--name/-n: Set cloud as default by name.--cloud-id/--id: Cloud id to set as default. Alternative to cloud name.
anyscale cloud add-collaborators
Usage
anyscale cloud add-collaborators [OPTIONS]
Add collaborators to the cloud.
Options
--cloud/-c: Name of the cloud to add collaborators to.--users-file: Path to a YAML file containing a list of users to add to the cloud.
Examples
- CLI
$ anyscale cloud add-collaborators --cloud cloud_name --users-file collaborators.yaml
(anyscale +1.3s) Successfully added 2 collaborators to cloud cloud_name.
$ cat collaborators.yaml
collaborators:
- email: "test1@anyscale.com"
permission_level: "write"
- email: "test2@anyscale.com"
permission_level: "readonly"
anyscale cloud get
Usage
anyscale cloud get [OPTIONS]
Get information about a specific cloud.
Options
--name/-n: Name of the cloud to get information about.--cloud-id/--id: ID of the cloud to get information about.--output/-o: File to write the output YAML to.
Examples
- CLI
$ anyscale cloud get --name my-cloud
id: cld_123
name: my-cloud
created_at: 2022-10-18 05:12:13.335803+00:00
is_default: true
resources:
- cloud_resource_id: cldrsrc_123
name: vm-aws-us-west-2
provider: AWS
compute_stack: VM
region: us-west-2
networking_mode: PUBLIC
object_storage:
bucket_name: s3://my-bucket
file_storage:
file_storage_id: fs-123
aws_config:
vpc_id: vpc-123
subnet_ids:
- subnet-123
security_group_ids:
- sg-123
anyscale_iam_role_id: arn:aws:iam::123456789012:role/anyscale-role-123
cluster_iam_role_id: arn:aws:iam::123456789012:role/cluster-role-123
memorydb_cluster_name: my-memorydb-cluster
anyscale cloud get-default
Usage
anyscale cloud get-default [OPTIONS]
Get the default cloud for your organization.
Options
Examples
- CLI
$ anyscale cloud get-default
name: anyscale_v2_default_cloud
id: cld_abc
provider: AWS
region: us-west-2
created_at: 2022-10-18 05:12:13.335803+00:00
is_default: true
compute_stack: VM
anyscale cloud terminate-system-cluster
Usage
anyscale cloud terminate-system-cluster [OPTIONS]
Terminate the system cluster for a specific given cloud.
Options
--cloud-id/--id: ID of the cloud to terminate the system cluster for.-w/--wait: Block this CLI command and print logs until the job finishes.
Examples
- CLI
$ anyscale cloud terminate-system-cluster --cloud-id cloud_id --wait
(anyscale +1.3s) Waiting for system cluster termination............
(anyscale +1m22.9s) System cluster for cloud 'cloud_id' is Terminated.
Cloud SDK
anyscale.cloud.add_collaborators
Batch add collaborators to a cloud.
:param cloud: The cloud to add users to. :param collaborators: The list of collaborators to add to the cloud.
Arguments
cloud(str): The cloud to add users to.collaborators(List[CreateCloudCollaborator]): The list of collaborators to add to the cloud.
Returns: str
Examples
- Python
import anyscale
from anyscale.cloud.models import CloudPermissionLevel, CreateCloudCollaborator
anyscale.cloud.add_collaborators(
cloud="cloud_name",
collaborators=[
CreateCloudCollaborator(
email="test1@anyscale.com",
permission_level=CloudPermissionLevel.WRITE,
),
CreateCloudCollaborator(
email="test2@anyscale.com",
permission_level=CloudPermissionLevel.READONLY,
),
],
)
anyscale.cloud.get
Get the cloud model for the provided cloud ID or name.
If neither ID nor name is provided, returns None.
:param id: The ID of the cloud to retrieve.
:param name: The name of the cloud to retrieve.
:return: A Cloud object if found, otherwise None.
Arguments
id(str | None) = None: The ID of the cloud to retrieve.name(str | None) = None: The name of the cloud to retrieve.
Returns: Cloud | None
Examples
- Python
import anyscale
# Get a cloud by ID
cloud_by_id = anyscale.cloud.get(id="cloud_id")
# Get a cloud by name
cloud_by_name = anyscale.cloud.get(name="cloud_name")
anyscale.cloud.get_default
Get the user's default cloud.
:return: The default Cloud object if it exists, otherwise None.
Arguments
Returns: Cloud | None
Examples
- Python
import anyscale
# Get the user's default cloud
default_cloud = anyscale.cloud.get_default()
anyscale.cloud.terminate_system_cluster
Terminate the system cluster for the specified cloud.
:param cloud: The name of the cloud whose system cluster should be terminated. :param wait: If True, wait for the system cluster to be terminated before returning. Defaults to False. :return: ID of the terminated system cluster.
Arguments
cloud_id(str): The ID of the cloud whose system cluster should be terminated.wait(bool | None) = False: If True, wait for the system cluster to be terminated before returning. Defaults to False.
Returns: str
Examples
- Python
import anyscale
# Terminate the system cluster for the cloud with the specified ID
anyscale.cloud.terminate_system_cluster(cloud_id="cloud_id", wait=True)