CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-vdk-plugin-control-cli

Versatile Data Kit SDK plugin exposing CLI commands for managing the lifecycle of a Data Jobs.

Overview
Eval results
Files

cli-commands.mddocs/

CLI Command Integration

The vdk-plugin-control-cli extends the vdk CLI with comprehensive data job lifecycle management commands from the vdk-control-cli package. These commands enable cloud-based data job operations including authentication, deployment, and management.

Types

import click
from vdk.internal.core.config import ConfigurationBuilder
from vdk.internal.core.context import CoreContext

Capabilities

Command Registration

Hook implementation that adds CLI commands to the vdk root command group during initialization.

@hookimpl(tryfirst=True)
def vdk_command_line(root_command: click.Group):
    """
    Hook implementation that adds CLI commands to vdk.
    
    Parameters:
    - root_command: click.Group - The root CLI command group to extend
    
    Adds commands: login, logout, delete, create, download_key, list_command, 
    deploy, execute, download_job, set_default_command, reset_default_command, 
    show_command, properties_command, info, secrets_command
    """

Configuration Setup

Hook implementation that adds configuration definitions for Control Service integration.

@hookimpl(tryfirst=True)
def vdk_configure(config_builder: ConfigurationBuilder) -> None:
    """
    Hook implementation that adds configuration definitions.
    
    Parameters:
    - config_builder: ConfigurationBuilder - Builder for adding configuration options
    """

Plugin Initialization

Hook implementation that initializes the plugin by setting environment variables for vdk-control-cli integration.

@hookimpl
def vdk_initialize(context: CoreContext) -> None:
    """
    Update vdk-control-cli configuration by setting environment variables.
    
    Parameters:
    - context: CoreContext - VDK core context containing configuration
    
    Sets environment variables for:
    - API_TOKEN
    - API_TOKEN_AUTHORIZATION_URL
    - CONTROL_SERVICE_REST_API_URL
    - CONTROL_SAMPLE_JOB_DIRECTORY
    - CONTROL_HTTP_VERIFY_SSL
    - CONTROL_HTTP_TOTAL_RETRIES
    - CONTROL_HTTP_READ_RETRIES
    - CONTROL_HTTP_READ_TIMEOUT_SECONDS
    - CONTROL_HTTP_CONNECT_RETRIES
    - CONTROL_HTTP_CONNECT_TIMEOUT_SECONDS
    """

Available CLI Commands

When the plugin is installed, the following commands are added to the vdk CLI:

Authentication Commands

  • vdk login - Authentication against the Control Service
  • vdk logout - Logout the user from the Data Jobs Service

Data Job Management Commands

  • vdk create - Creates a new data job in cloud and locally
  • vdk delete - Deletes a data job from the cloud
  • vdk deploy - Deploys a data job
  • vdk execute - Executes a data job
  • vdk download_job - Downloads a data job from the cloud
  • vdk list - Lists data jobs
  • vdk show - Shows data job details

Configuration Commands

  • vdk set_default - Sets default command values
  • vdk reset_default - Resets default command values
  • vdk info - Shows data job information

Data Management Commands

  • vdk properties - Manages data job properties
  • vdk secrets - Manages data job secrets
  • vdk download_key - Downloads keys for data job access

Usage Examples

# Authenticate with Control Service
vdk login

# Create a new data job both locally and in the cloud
vdk create my-data-job --cloud

# Deploy the data job to the cloud
vdk deploy my-data-job

# List all data jobs
vdk list

# Set a property for a data job
vdk properties --set 'database-url' 'postgresql://localhost:5432/mydb'

# Deploy and execute a data job
vdk deploy my-data-job
vdk execute my-data-job

# Get information about a data job
vdk show my-data-job

# Clean up
vdk delete my-data-job
vdk logout

Install with Tessl CLI

npx tessl i tessl/pypi-vdk-plugin-control-cli

docs

cli-commands.md

configuration.md

error-handling.md

execution-control.md

index.md

properties-backend.md

secrets-backend.md

tile.json