Commands¶
The commands layer implements the business logic for the Kelvin CLI. Each command class orchestrates services to perform operations, defines result data models, and raises domain-specific exceptions.
Commands are instantiated via the dependency injection container
(kelvin.sdk.container.Services) and receive their dependencies
through constructor injection.
App Commands¶
Business logic for local application creation, building, and uploading.
App command business logic.
- class kelvin.sdk.commands.app.AppCreateResult(app_name, app_path, template_name, files_created, symlinks_created)[source]¶
Bases:
objectResult of app creation.
- Parameters:
- class kelvin.sdk.commands.app.TemplateListResult(templates)[source]¶
Bases:
objectResult of template list operation.
- Parameters:
templates (list[TemplateInfo])
- templates: list[TemplateInfo]¶
- class kelvin.sdk.commands.app.LegacyDockerfileGenerated(dockerfile_path, entry_point, python_version, builder_version)[source]¶
Bases:
objectInformation about a generated legacy Dockerfile.
- class kelvin.sdk.commands.app.AppBuildResult(app_name, app_version, image_name, platforms, legacy_dockerfile_generated=None)[source]¶
Bases:
objectResult of app build operation.
- Parameters:
- legacy_dockerfile_generated: LegacyDockerfileGenerated | None = None¶
- class kelvin.sdk.commands.app.AppUploadResult(app_name, app_version, image_name, platforms, legacy_dockerfile_generated=None)[source]¶
Bases:
objectResult of app upload operation.
- Parameters:
- legacy_dockerfile_generated: LegacyDockerfileGenerated | None = None¶
- exception kelvin.sdk.commands.app.AppCommandsError(message=None, exit_code=None)[source]¶
Bases:
CLIErrorBase exception for app command operations.
- exception kelvin.sdk.commands.app.AppAlreadyExistsError(app_path)[source]¶
Bases:
AppCommandsErrorRaised when trying to create an app that already exists.
- Parameters:
app_path (Path)
- exception kelvin.sdk.commands.app.InvalidAppNameError(app_name, reason)[source]¶
Bases:
AppCommandsErrorRaised when app name is invalid.
- exception kelvin.sdk.commands.app.AppConfigNotFoundError(app_dir)[source]¶
Bases:
AppCommandsErrorRaised when app config file is not found.
- Parameters:
app_dir (Path)
- exception kelvin.sdk.commands.app.DockerfileNotFoundError(app_dir)[source]¶
Bases:
AppCommandsErrorRaised when Dockerfile is not found.
- Parameters:
app_dir (Path)
- exception kelvin.sdk.commands.app.AppVersionExistsError(app_name, app_version)[source]¶
Bases:
AppCommandsErrorRaised when app version already exists on the platform.
- exception kelvin.sdk.commands.app.RegistryNotConfiguredError[source]¶
Bases:
AppCommandsErrorRaised when Docker registry is not configured.
- Return type:
None
- exception kelvin.sdk.commands.app.AppManifestError(message)[source]¶
Bases:
AppCommandsErrorRaised when app manifest generation fails.
- Parameters:
message (str)
- exception kelvin.sdk.commands.app.SchemaValidationFailedError(errors)[source]¶
Bases:
AppCommandsErrorRaised when app config fails schema validation.
- class kelvin.sdk.commands.app.AppCommands(template_service, docker_service, schema_service)[source]¶
Bases:
objectApp command business logic.
Handles application creation, build, upload, and management operations. Receives complete, validated inputs from CLI layer.
Note: api_client and registry_url are passed to upload() method directly to avoid requiring authentication for local-only operations (create, build).
- Parameters:
template_service (TemplateService)
docker_service (DockerService)
schema_service (SchemaService)
- create_app(app_name, *, template='app', app_dir=None, description=None, version='0.1.0')[source]¶
Create a new application from a template.
- Parameters:
app_name (
str) – Name of the application (used as directory name).template (
str) – Template to use (default: “app”).app_dir (
Optional[Path]) – Parent directory for the app (default: current directory).description (
Optional[str]) – Application description (default: app_name).version (
str) – Application version (default: “0.1.0”).
- Return type:
- Returns:
AppCreateResult with paths to created files.
- Raises:
InvalidAppNameError – If app name is invalid.
AppAlreadyExistsError – If app directory already exists.
TemplateNotFoundError – If template doesn’t exist.
- build(app_dir=None, *, build_args=None, architectures=None, fresh=False, skip_schema_validation=False)[source]¶
Build an application into a Docker image.
Reads the app configuration from app.yaml, validates that a Dockerfile exists, and builds the Docker image using buildx.
For legacy apps without a Dockerfile, one is automatically generated from the legacy template using the entry_point from app.yaml.
- Parameters:
app_dir (
Optional[Path]) – Directory containing the application (default: current directory).build_args (
Optional[dict[str,str]]) – Docker build arguments.architectures (
Optional[list[str]]) – Target architectures (default: [“amd64”]).fresh (
bool) – If True, build without cache.skip_schema_validation (
bool) – If True, skip JSON schema validation.
- Return type:
- Returns:
AppBuildResult with build information.
- Raises:
AppConfigNotFoundError – If app.yaml is not found.
DockerfileNotFoundError – If Dockerfile is not found and app is not legacy.
DockerBuildError – If build fails.
- upload(api_client, registry_url, app_dir=None, *, build_args=None, architectures=None, fresh=False, skip_schema_validation=False, config_injection_callback=None)[source]¶
Build and upload an application to the platform.
This performs the following steps: 1. Loads app configuration from app.yaml 2. Checks if the app version already exists on the platform 3. Builds the Docker image and pushes to registry using buildx –push 4. Creates the app version on the platform via API
- Parameters:
api_client (
Client) – Authenticated API client.registry_url (
str) – Docker registry URL.app_dir (
Optional[Path]) – Directory containing the application (default: current directory).build_args (
Optional[dict[str,str]]) – Docker build arguments.architectures (
Optional[list[str]]) – Target architectures (default: [“amd64”]).fresh (
bool) – If True, build without cache.skip_schema_validation (
bool) – If True, skip JSON schema validation.config_injection_callback (
Optional[Callable[[dict[str,object]],bool]]) – Optional callback to decide whether to inject config.yaml into manifest defaults. Receives the parsed config dict, returns True to inject.
- Return type:
- Returns:
AppUploadResult with upload information.
- Raises:
AppConfigNotFoundError – If app.yaml is not found.
DockerfileNotFoundError – If Dockerfile is not found and app is not legacy.
AppVersionExistsError – If app version already exists on platform.
AppManifestError – If manifest generation fails.
DockerBuildError – If build fails.
APIError – If API call fails.
App Image Commands¶
Business logic for local Docker image management operations.
App images command business logic.
Handles local application image management operations. These are Docker-only operations that don’t require authentication.
- class kelvin.sdk.commands.app_images.LocalImage(name, version, tag, created_at, size)[source]¶
Bases:
objectLocal application image information.
- class kelvin.sdk.commands.app_images.ImageListResult(images)[source]¶
Bases:
objectResult of listing local images.
- Parameters:
images (list[LocalImage])
- images: list[LocalImage]¶
- class kelvin.sdk.commands.app_images.ImageRemoveResult(image_name, removed)[source]¶
Bases:
objectResult of removing a local image.
- class kelvin.sdk.commands.app_images.ImageUnpackResult(image_name, container_path, output_path)[source]¶
Bases:
objectResult of unpacking an image.
- exception kelvin.sdk.commands.app_images.AppImageError(message=None, exit_code=None)[source]¶
Bases:
CLIErrorBase exception for app image operations.
- exception kelvin.sdk.commands.app_images.InvalidImageNameError(image_name)[source]¶
Bases:
AppImageErrorRaised when image name format is invalid.
- Parameters:
image_name (str)
- class kelvin.sdk.commands.app_images.AppImageCommands(docker_service)[source]¶
Bases:
objectApp image command business logic.
Handles local Docker image operations. These are local-only operations that don’t require authentication to the platform.
- Parameters:
docker_service (DockerService)
- list_images()[source]¶
List all locally built application images.
Lists Docker images that were built by KSDK (identified by labels).
- Return type:
- Returns:
ImageListResult containing list of local images.
- remove_image(app_name_with_version)[source]¶
Remove an application image from the local registry.
- Parameters:
app_name_with_version (
str) – Image name with version (e.g., “my-app:1.0.0”).- Return type:
- Returns:
ImageRemoveResult indicating success.
- Raises:
InvalidImageNameError – If image name format is invalid.
DockerImageNotFoundError – If image does not exist.
- unpack_image(app_name_with_version, output_dir, container_dir=None)[source]¶
Extract content from an application image.
Extracts files from a Docker image to a local directory.
- Parameters:
- Return type:
- Returns:
ImageUnpackResult with extraction details.
- Raises:
InvalidImageNameError – If image name format is invalid.
DockerImageNotFoundError – If image does not exist.
Apps Commands¶
Business logic for platform application registry operations.
Apps command business logic.
Platform application registry operations. These commands interact with the API to manage apps on the platform.
- class kelvin.sdk.commands.apps.AppInfo(name, title, app_type, latest_version, updated_at)[source]¶
Bases:
objectApplication information.
- Parameters:
- class kelvin.sdk.commands.apps.AppListResult(apps, total)[source]¶
Bases:
objectResult of listing apps.
- class kelvin.sdk.commands.apps.AppVersionInfo(version, updated_at)[source]¶
Bases:
objectApplication version information.
- class kelvin.sdk.commands.apps.AppDetailResult(name, title, app_type, description, latest_version, created_at, updated_at, versions)[source]¶
Bases:
objectResult of showing app details.
- Parameters:
- versions: list[AppVersionInfo]¶
- class kelvin.sdk.commands.apps.AppVersionDetailResult(name, version, title, app_type, description, created_at, updated_at)[source]¶
Bases:
objectResult of showing app version details.
- Parameters:
- class kelvin.sdk.commands.apps.AppDeleteResult(app_name, version, deleted)[source]¶
Bases:
objectResult of deleting an app.
- class kelvin.sdk.commands.apps.AppDownloadResult(app_name, version, image_name)[source]¶
Bases:
objectResult of downloading an app.
- exception kelvin.sdk.commands.apps.AppsCommandsError(message=None, exit_code=None)[source]¶
Bases:
CLIErrorBase exception for apps command operations.
- exception kelvin.sdk.commands.apps.AppNotFoundError(app_name, version=None)[source]¶
Bases:
AppsCommandsErrorRaised when an app is not found.
- exception kelvin.sdk.commands.apps.InvalidAppNameFormatError(app_name)[source]¶
Bases:
AppsCommandsErrorRaised when app name format is invalid.
- Parameters:
app_name (str)
- class kelvin.sdk.commands.apps.AppsCommands(client)[source]¶
Bases:
objectPlatform application registry commands.
Handles operations for managing applications on the platform’s registry. These are API-based operations that require authentication.
- Parameters:
client (Client)
- list(query=None)[source]¶
List all applications on the platform.
- search(query)[source]¶
Search for apps matching the query.
- Parameters:
query (
str) – Search query string.- Return type:
- Returns:
AppListResult containing matching apps.
- show(app_name)[source]¶
Show details of an application.
If app_name includes a version (e.g., “my-app:1.0.0”), shows version details. Otherwise, shows app details with all versions.
- Parameters:
app_name (
str) – Application name, optionally with version.- Return type:
- Returns:
AppDetailResult or AppVersionDetailResult with app details.
- Raises:
AppNotFoundError – If app is not found.
- delete(app_name)[source]¶
Delete an application or app version from the platform.
If app_name includes a version (e.g., “my-app:1.0.0”), deletes that version. Otherwise, deletes the entire app with all versions.
- Parameters:
app_name (
str) – Application name, optionally with version.- Return type:
- Returns:
AppDeleteResult indicating success.
- Raises:
AppNotFoundError – If app is not found.
- download(docker_service, registry_url, app_name, tag_local_name=True)[source]¶
Download an application from the platform.
Pulls the Docker image from the platform’s registry.
- Parameters:
docker_service (
DockerService) – Docker service for pulling images.registry_url (
str) – Docker registry URL.app_name (
str) – Application name with version (e.g., “my-app:1.0.0”).tag_local_name (
bool) – If True, tag image with local name (without registry).
- Return type:
- Returns:
AppDownloadResult with download information.
- Raises:
InvalidAppNameFormatError – If app name doesn’t include version.
AppNotFoundError – If app is not found.
Auth Commands¶
Business logic for authentication workflows (login, logout, token management).
Authentication command business logic.
- class kelvin.sdk.commands.auth.DockerLoginInfo(login_url, is_custom_registry=False, login_failed=False)[source]¶
Bases:
objectDocker registry login status from auth flow.
- class kelvin.sdk.commands.auth.VersionInfo(current, recommended)[source]¶
Bases:
objectCLI version compatibility info.
- class kelvin.sdk.commands.auth.LoginResult(url, docker=None, version=None)[source]¶
Bases:
objectResult of login operation.
- Parameters:
url (str)
docker (DockerLoginInfo | None)
version (VersionInfo | None)
- docker: DockerLoginInfo | None = None¶
- version: VersionInfo | None = None¶
- class kelvin.sdk.commands.auth.TokenResult(access_token, expires_at, full_credentials=None)[source]¶
Bases:
objectResult of token operation.
- exception kelvin.sdk.commands.auth.AuthCommandsError(message=None, exit_code=None)[source]¶
Bases:
AuthenticationErrorBase exception for auth command operations.
- exception kelvin.sdk.commands.auth.MissingSessionError(message=None, exit_code=None)[source]¶
Bases:
AuthCommandsErrorRaised when no active session is found.
- exception kelvin.sdk.commands.auth.MissingCredentialsError(message=None, exit_code=None)[source]¶
Bases:
AuthCommandsErrorRaised when credentials are missing for a session.
- exception kelvin.sdk.commands.auth.TokenRefreshError(message=None, exit_code=None)[source]¶
Bases:
AuthCommandsErrorRaised when token refresh is not possible.
- class kelvin.sdk.commands.auth.AuthCommands(auth, credentials, session, docker)[source]¶
Bases:
objectAuthentication command business logic.
Receives complete, validated inputs from CLI layer. Orchestrates multiple services to implement workflows.
- Parameters:
auth (AuthService)
credentials (CredentialStore)
session (SessionService)
docker (DockerService)
- auth: AuthService¶
- credentials: CredentialStore¶
- session: SessionService¶
- docker: DockerService¶
- login_browser(url, open_browser=True, on_auth_url=None)[source]¶
Browser SSO login workflow.
- Return type:
- Parameters:
- login_password(url, username, password, totp=None)[source]¶
Password login workflow.
- Return type:
- Parameters:
- login_with_stored_credentials(url)[source]¶
Attempt login using stored keyring credentials.
Checks for stored credentials, validates or refreshes tokens, and verifies against Keycloak. Returns None if stored credentials are unavailable or invalid, signaling the caller to prompt.
- Return type:
- Parameters:
url (str)
- login_client_credentials(url, client_id, client_secret)[source]¶
Client credentials login workflow.
- Return type:
- Parameters:
MLflow Commands¶
Business logic for MLflow-based application creation and model import.
MLflow command business logic.
This module contains the business logic for MLflow commands, orchestrating the MLflow service with the template service to create and manage MLflow-based Kelvin applications.
- exception kelvin.sdk.commands.mlflow.MLflowCommandsError(message=None, exit_code=None)[source]¶
Bases:
CLIErrorBase exception for MLflow command errors.
- exception kelvin.sdk.commands.mlflow.AppDirectoryExistsError(app_path)[source]¶
Bases:
MLflowCommandsErrorRaised when app directory already exists.
- Parameters:
app_path (Path)
- Return type:
None
- exception kelvin.sdk.commands.mlflow.AppDirectoryNotFoundError(app_path)[source]¶
Bases:
MLflowCommandsErrorRaised when app directory doesn’t exist for import.
- Parameters:
app_path (Path)
- Return type:
None
- exception kelvin.sdk.commands.mlflow.MissingRequiredOptionError(option_name)[source]¶
Bases:
MLflowCommandsErrorRaised when a required option is missing in no-prompt mode.
- Parameters:
option_name (str)
- Return type:
None
- exception kelvin.sdk.commands.mlflow.NoModelsFoundError(registry_uri)[source]¶
Bases:
MLflowCommandsErrorRaised when no models found in registry.
- Parameters:
registry_uri (str)
- Return type:
None
- class kelvin.sdk.commands.mlflow.ModelInfo(name, description, latest_version)[source]¶
Bases:
objectModel information from MLflow registry.
Encapsulates MLflow RegisteredModel details to avoid exposing MLflow internals to outer layers.
- class kelvin.sdk.commands.mlflow.MLflowListResult(models)[source]¶
Bases:
objectResult of listing MLflow models.
- class kelvin.sdk.commands.mlflow.MLflowCreateResult(app_name, app_path, files_created, model_inputs, model_outputs)[source]¶
Bases:
objectResult of creating app from MLflow model.
- Parameters:
- class kelvin.sdk.commands.mlflow.MLflowImportResult(app_path, model_path, config_updated, model_inputs, model_outputs)[source]¶
Bases:
objectResult of importing MLflow model into app.
- Parameters:
- class kelvin.sdk.commands.mlflow.MLflowCommands(mlflow_service, template_service)[source]¶
Bases:
objectMLflow command business logic.
Orchestrates MLflow service operations with template service for creating and managing MLflow-based Kelvin applications.
- Parameters:
mlflow_service (MLflowService)
template_service (TemplateService)
- __init__(mlflow_service, template_service)[source]¶
Initialize MLflowCommands.
- Parameters:
mlflow_service (
MLflowService) – Service for MLflow registry operations.template_service (
TemplateService) – Service for template operations.
- Return type:
None
- list_models(registry_uri)[source]¶
List models in MLflow registry.
- Parameters:
registry_uri (
str) – URI of the MLflow registry.- Return type:
- Returns:
MLflowListResult with list of models.
- Raises:
MLflowNotInstalledError – If MLflow is not installed.
RegistryConnectionError – If cannot connect to registry.
- get_model_versions(registry_uri, model_name)[source]¶
Get versions of a model.
- Parameters:
- Return type:
list[ModelVersion]- Returns:
List of model versions.
- Raises:
MLflowNotInstalledError – If MLflow is not installed.
RegistryConnectionError – If cannot connect to registry.
ModelNotFoundError – If model doesn’t exist.
- create_app(registry_uri, model_name, model_version, app_name, app_dir=None, app_version='1.0.0', overwrite=False)[source]¶
Create a Kelvin app from an MLflow model.
- Parameters:
registry_uri (
str) – URI of the MLflow registry.model_name (
str) – Name of the model.model_version (
str) – Version of the model.app_name (
str) – Name for the new app.app_dir (
Optional[Path]) – Parent directory for the app (default: current directory).app_version (
str) – Version for the new app (default: “1.0.0”).overwrite (
bool) – If True, overwrite existing app directory.
- Return type:
- Returns:
MLflowCreateResult with created app information.
- Raises:
MLflowNotInstalledError – If MLflow is not installed.
RegistryConnectionError – If cannot connect to registry.
ModelVersionNotFoundError – If model version doesn’t exist.
AppDirectoryExistsError – If app directory exists and not overwriting.
- import_model(registry_uri, model_name, model_version, app_dir, update_config=False, overwrite=False)[source]¶
Import an MLflow model into an existing Kelvin app.
- Parameters:
registry_uri (
str) – URI of the MLflow registry.model_name (
str) – Name of the model.model_version (
str) – Version of the model.app_dir (
Path) – Path to the existing app directory.update_config (
bool) – If True, update app.yaml with model inputs/outputs.overwrite (
bool) – If True, overwrite existing model directory.
- Return type:
- Returns:
MLflowImportResult with import information.
- Raises:
MLflowNotInstalledError – If MLflow is not installed.
RegistryConnectionError – If cannot connect to registry.
ModelVersionNotFoundError – If model version doesn’t exist.
AppDirectoryNotFoundError – If app directory doesn’t exist.
Secret Commands¶
Business logic for platform secret management operations.
Secret command business logic.
Platform secret management operations. These commands interact with the API to manage secrets on the platform.
- class kelvin.sdk.commands.secret.SecretInfo(name, created_at, updated_at)[source]¶
Bases:
objectSecret information.
- class kelvin.sdk.commands.secret.SecretListResult(secrets, total)[source]¶
Bases:
objectResult of listing secrets.
- Parameters:
secrets (list[SecretInfo])
total (int)
- secrets: list[SecretInfo]¶
- class kelvin.sdk.commands.secret.SecretCreateResult(name, created)[source]¶
Bases:
objectResult of creating a secret.
- class kelvin.sdk.commands.secret.SecretUpdateResult(name, updated)[source]¶
Bases:
objectResult of updating a secret.
- class kelvin.sdk.commands.secret.SecretDeleteResult(name, deleted)[source]¶
Bases:
objectResult of deleting a secret.
- exception kelvin.sdk.commands.secret.SecretCommandsError(message=None, exit_code=None)[source]¶
Bases:
CLIErrorBase exception for secret command operations.
- exception kelvin.sdk.commands.secret.SecretNotFoundError(secret_name)[source]¶
Bases:
SecretCommandsErrorRaised when a secret is not found.
- Parameters:
secret_name (str)
- exception kelvin.sdk.commands.secret.SecretAlreadyExistsError(secret_name)[source]¶
Bases:
SecretCommandsErrorRaised when a secret already exists.
- Parameters:
secret_name (str)
- class kelvin.sdk.commands.secret.SecretCommands(client)[source]¶
Bases:
objectPlatform secret commands.
Handles operations for managing secrets on the platform. These are API-based operations that require authentication.
- Parameters:
client (Client)
- list(query=None)[source]¶
List all secrets on the platform.
- create(name, value)[source]¶
Create a new secret on the platform.
- Parameters:
- Return type:
- Returns:
SecretCreateResult indicating success.
- Raises:
SecretAlreadyExistsError – If secret already exists.
- update(name, value)[source]¶
Update an existing secret on the platform.
- Parameters:
- Return type:
- Returns:
SecretUpdateResult indicating success.
- Raises:
SecretNotFoundError – If secret is not found.
- delete(name)[source]¶
Delete a secret from the platform.
- Parameters:
name (
str) – The name of the secret to delete.- Return type:
- Returns:
SecretDeleteResult indicating success.
- Raises:
SecretNotFoundError – If secret is not found.
Workload Commands¶
Business logic for workload deployment and management operations.
Workload command business logic.
- class kelvin.sdk.commands.workload.WorkloadInfo(name, title, cluster_name, app_name, app_version, status_state, status_message, last_seen)[source]¶
Bases:
objectSummary info for a workload in list view.
- Parameters:
- class kelvin.sdk.commands.workload.WorkloadDetails(name, title, cluster_name, node_name, app_name, app_version, app_type, status_state, status_message, last_seen, download_status, download_error, created_at, created_by, updated_at, updated_by, runtime)[source]¶
Bases:
objectFull workload details for show command.
- Parameters:
name (str)
title (str | None)
cluster_name (str | None)
node_name (str | None)
app_name (str | None)
app_version (str | None)
app_type (str | None)
status_state (str | None)
status_message (str | None)
last_seen (datetime | None)
download_status (str | None)
download_error (str | None)
created_at (datetime | None)
created_by (str | None)
updated_at (datetime | None)
updated_by (str | None)
- class kelvin.sdk.commands.workload.WorkloadListResult(workloads, total_count)[source]¶
Bases:
objectResult of list workloads operation.
- Parameters:
workloads (list[WorkloadInfo])
total_count (int)
- workloads: list[WorkloadInfo]¶
- class kelvin.sdk.commands.workload.WorkloadLogsResult(workload_name, logs, has_logs)[source]¶
Bases:
objectResult of get logs operation.
- class kelvin.sdk.commands.workload.DeployResult(workload_name, app_name, app_version, cluster_name, is_legacy)[source]¶
Bases:
objectResult of deploy workload operation.
- Parameters:
- class kelvin.sdk.commands.workload.UpdateResult(workload_name, app_name, app_version, is_legacy)[source]¶
Bases:
objectResult of update workload operation.
- exception kelvin.sdk.commands.workload.WorkloadCommandsError(message=None, exit_code=None)[source]¶
Bases:
CLIErrorBase exception for workload command operations.
- exception kelvin.sdk.commands.workload.WorkloadNotFoundError(workload_name)[source]¶
Bases:
WorkloadCommandsErrorRaised when workload is not found.
- Parameters:
workload_name (str)
- exception kelvin.sdk.commands.workload.AppConfigError(message=None, exit_code=None)[source]¶
Bases:
WorkloadCommandsErrorRaised when app configuration is invalid or cannot be parsed.
- exception kelvin.sdk.commands.workload.RuntimeConfigRequiredError[source]¶
Bases:
WorkloadCommandsErrorRaised when runtime config is required but not provided.
- Return type:
None
- exception kelvin.sdk.commands.workload.LegacyDeployMissingArgsError(missing_fields)[source]¶
Bases:
WorkloadCommandsErrorRaised when legacy deploy is missing required arguments.
- exception kelvin.sdk.commands.workload.SchemaValidationFailedError(errors)[source]¶
Bases:
WorkloadCommandsErrorRaised when app config fails schema validation.
- kelvin.sdk.commands.workload.get_status_category(state)[source]¶
Get the display category for a status state.
- class kelvin.sdk.commands.workload.WorkloadCommands(client, schema_service)[source]¶
Bases:
objectWorkload command business logic.
Receives complete, validated inputs from CLI layer. Uses API client to perform operations.
- Parameters:
client (Client)
schema_service (SchemaService)
- list_workloads(*, search=None, app_name=None, node_name=None, cluster_name=None, status=None)[source]¶
List workloads with optional filters.
- show_workload(workload_name)[source]¶
Get detailed information about a workload.
- Return type:
- Parameters:
workload_name (str)
- get_logs(workload_name, *, tail_lines=None, since_time=None)[source]¶
Get workload logs.
- Return type:
- Parameters:
- follow_logs(workload_name, *, tail_lines=None, poll_interval=5.0)[source]¶
Follow workload logs, yielding new logs as they arrive.
This is a generator that polls for new logs.
- Return type:
- Parameters:
- deploy_workload(*, app_config_path, runtime_path=None, cluster_name=None, workload_name=None, workload_title=None)[source]¶
Deploy a new workload.
Parses the app configuration, determines if it is a legacy or new-style app, and creates the workload via the appropriate API.