VDK Control CLI allows user to create, delete, manage and their Data Jobs in Kubernetes runtime.
npx @tessl/cli install tessl/pypi-vdk-control-cli@1.3.0VDK Control CLI is a command-line interface tool designed for Data Engineers to manage the complete lifecycle of Data Jobs in Kubernetes runtime environments. It provides comprehensive functionality for creating, deleting, deploying, and configuring Data Jobs through a unified console application.
pip install vdk-control-clivdkcliFor plugin development:
from vdk.api.control.plugin.markers import hookimpl, hookspec, PROJECT_NAME
from vdk.api.control.plugin.specs import CliHookSpecsFor accessing internal functionality (advanced usage):
from vdk.internal.control.main import run, cli
from vdk.internal.control.plugin.control_plugin_manager import PluginsAfter installation, use the vdkcli command to interact with Data Jobs:
# Show help and available commands
vdkcli --help
# Authenticate with Control Service
vdkcli login
# Create a new Data Job
vdkcli create my-job --team my-team --cloud --local
# Deploy a Data Job
vdkcli deploy my-job --team my-team
# List Data Jobs
vdkcli list --team my-team
# Show Data Job details
vdkcli show my-job --team my-team
# Delete a Data Job
vdkcli delete my-job --team my-team
# Logout
vdkcli logoutConfigure CLI behavior using environment variables:
# Override configuration folder location
export VDK_BASE_CONFIG_FOLDER=/custom/config/path
# Set default Control Service URL
export VDK_CONTROL_SERVICE_REST_API_URL=https://control-service.example.com
# Set API token for authentication
export VDK_API_TOKEN=your-api-token
export VDK_API_TOKEN_AUTHORIZATION_URL=https://auth.example.com
# Override OAuth port for credential flow
export OAUTH_PORT=8080Complete set of CLI commands for Data Job lifecycle management.
# CLI commands (available via vdkcli):
# vdkcli login [OPTIONS]
# vdkcli logout [OPTIONS]The login command authenticates with the Control Service using various methods:
The logout command clears stored authentication credentials.
# CLI commands (available via vdkcli):
# vdkcli create [OPTIONS] NAME
# vdkcli delete [OPTIONS] NAME
# vdkcli deploy [OPTIONS] NAME
# vdkcli list [OPTIONS]
# vdkcli show [OPTIONS] NAME
# vdkcli execute [OPTIONS] NAME
# vdkcli download-job [OPTIONS] NAME
# vdkcli download-key [OPTIONS] NAMEcreate: Creates new Data Jobs locally and/or in the clouddelete: Removes Data Jobs from the cloud runtimedeploy: Deploys Data Job source code to cloud runtimelist: Lists Data Jobs for a teamshow: Displays detailed information about a specific Data Jobexecute: Runs Data Job locally or remotelydownload-job: Downloads Data Job source codedownload-key: Downloads Data Job deployment key# CLI commands (available via vdkcli):
# vdkcli properties [OPTIONS] NAME
# vdkcli secrets [OPTIONS] NAME
# vdkcli set-default [OPTIONS]
# vdkcli reset-default [OPTIONS]properties: Manages Data Job properties and configurationsecrets: Manages Data Job secretsset-default: Sets default values for CLI optionsreset-default: Resets default values# CLI commands (available via vdkcli):
# vdkcli info [OPTIONS]
# vdkcli version [OPTIONS]info: Displays system and environment informationversion: Shows version informationExtensible plugin architecture for customizing CLI behavior.
PROJECT_NAME = "vdk_control_cli.plugin"
# Decorator for marking hook specifications
hookspec: pluggy.HookspecMarker
# Decorator for marking hook implementations
hookimpl: pluggy.HookimplMarker
class CliHookSpecs:
"""Hook specifications for CLI plugins."""
@hookspec(firstresult=True)
def get_default_commands_options(self):
"""
Hook for setting default CLI command options.
Returns:
dict: Default options matching click default_map format.
Example: {"login": {"oauth2_authorize_uri": "https://auth.example.com"}}
"""class Plugins:
"""Plugin management system for VDK Control CLI."""
def __init__(self, project_name=PROJECT_NAME, load_registered=True):
"""
Initialize plugin manager.
Args:
project_name: Plugin project name for entry point discovery
load_registered: Whether to load registered plugins (True by default)
"""
def load_builtin_plugin(self, builtin_plugin_module):
"""
Register a built-in plugin module.
Args:
builtin_plugin_module: Module containing plugin implementations
"""
def hook(self) -> PluginHookRelay:
"""
Get hook relay for executing plugin hooks.
Returns:
PluginHookRelay: Interface for executing plugin hooks
"""
class PluginHookRelay:
"""Helper for executing plugin hooks with type safety."""
def __init__(self, pm: pluggy.PluginManager):
"""Initialize with plugin manager."""
def get_default_commands_options(self):
"""Execute default options hook, returns array of results from all plugins."""To create a VDK Control CLI plugin:
from vdk.api.control.plugin.markers import hookimpl
@hookimpl
def get_default_commands_options():
"""Set default CLI options."""
return {
"login": {
"auth_type": "api-token",
"api_token_authorization_url": "https://custom-auth.example.com"
}
}setup.py:setup(
name="vdk-control-cli-custom",
entry_points={
'vdk_control_cli.plugin': [
'custom_plugin = my_package.plugin_module'
]
}
)pip install vdk-control-cli-customCore application entry points for advanced usage.
def run():
"""
Main entry point for the CLI application.
Sets up all CLI commands and executes the click interface.
"""
@click.group(help="Command line tool for Data Jobs lifecycle management.")
@click.option("-d", "--dev", is_flag=True, help="Run in developer mode")
@click_log.simple_verbosity_option(logging.getLogger())
@click.version_option()
@click.pass_context
def cli(ctx: click.Context, dev: bool):
"""
Main CLI group function that initializes the application.
Args:
ctx: Click context object
dev: Enable developer mode for extra logging
"""The CLI recognizes these environment variables for configuration:
# Configuration environment variables:
VDK_BASE_CONFIG_FOLDER: str
# Override local base configuration folder (default: $HOME/.vdk.internal)
VDK_CONTROL_SERVICE_REST_API_URL: str
# Default Control Service URL if not specified as command line argument
VDK_API_TOKEN: str
# Default API Token for authentication
VDK_API_TOKEN_AUTHORIZATION_URL: str
# Default API token authorization URL
OAUTH_PORT: str
# Port for OAuth2 credential flow (default: 31113)# Plugin system types
PluginManager = pluggy.PluginManager
HookspecMarker = pluggy.HookspecMarker
HookimplMarker = pluggy.HookimplMarker
# Click context for CLI commands
Context = click.Context