Service Account API Reference (0.26.100)
Service Account API Reference (0.26.100)
This is archived documentation for version 0.26.100. 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.
Service Account CLI
anyscale service-account create
Usage
anyscale service-account create [OPTIONS]
Create a service account.
Options
--name/-n: Name for the service account.
anyscale service-account create-api-key
Usage
anyscale service-account create-api-key [OPTIONS]
Create a new API key for a service account.
Options
--email: Email of the service account to create the new key for.--name: Name of the service account to create the new key for.
anyscale service-account list
Usage
anyscale service-account list [OPTIONS]
List service accounts.
Options
--max-items: Max items to show in list.
anyscale service-account delete
Usage
anyscale service-account delete [OPTIONS]
Delete a service account.
Options
--email: Email of the service account to delete.--name: Name of the service account to delete.
Service Account SDK
anyscale.service_account.create
Create a service account and return the API key.
Arguments
name(str): Name for the service account.
Returns: str
Examples
- Python
import anyscale
api_key = anyscale.service_account.create(
name="my-service-account",
)
anyscale.service_account.create_api_key
Create an API key for the service account and return the API key.
Arguments
email(str | None) = None: Email of the service account to create the new key for.name(str | None) = None: Name of the service account to create the new key for.
Returns: str
Examples
- Python
import anyscale
api_key = anyscale.service_account.create_api_key(
name="my-service-account",
)
anyscale.service_account.rotate_api_keys
Rotate all api keys of a service account and return the new API key.
Arguments
email(str | None) = None: Rotate API keys for the service account with this email.name(str | None) = None: Rotate API keys for the service account with this name.
Returns: str
Examples
- Python
import anyscale
anyscale.service_account.rotate_api_keys(
name="my-service-account",
)
anyscale.service_account.list
List service accounts.
Arguments
max_items(int) = 20: Maximum number of items to return.
Returns: List[ServiceAccount]
Examples
- Python
import anyscale
anyscale.service_account.list(
max_items=20,
)
anyscale.service_account.delete
Delete a service account.
Arguments
email(str | None) = None: Email of the service account to delete.name(str | None) = None: Name of the service account to delete.
Examples
- Python
import anyscale
anyscale.service_account.delete(
name="my-service-account",
)
Service Account Models
ServiceAccount
Service account