Versatile Data Kit SDK plugin exposing CLI commands for managing the lifecycle of a Data Jobs.
Comprehensive configuration system for Control Service integration including authentication settings, HTTP parameters, service endpoints, and operational options. The configuration system bridges vdk-core configuration with vdk-control-cli requirements.
from vdk.internal.core.config import Configuration, ConfigurationBuilderWrapper class that provides typed access to Control Service configuration values.
class ControlServiceConfiguration:
def __init__(self, config: Configuration) -> None:
"""
Initialize configuration wrapper.
Parameters:
- config: Configuration - VDK core configuration instance
"""
def api_token(self):
"""
Get API token for OAuth2 provider.
Returns:
str or None: API token used for authentication
"""
def api_token_authorization_url(self):
"""
Get API token authorization URL.
Returns:
str or None: OAuth2 provider URL for token exchange
"""
def control_service_rest_api_url(self):
"""
Get Control Service REST API base URL.
Returns:
str or None: Base REST API URL (e.g., http://server)
"""
def control_sample_job_directory(self):
"""
Get sample job directory path.
Returns:
str or None: Directory path for sample job creation
"""
def control_http_verify_ssl(self):
"""
Get SSL verification setting.
Returns:
bool: Whether to verify SSL certificates
"""
def control_http_total_retries(self):
"""
Get total HTTP retries setting.
Returns:
int or None: Total number of HTTP retries allowed
"""
def control_http_read_retries(self):
"""
Get read HTTP retries setting.
Returns:
int or None: Number of read retries allowed
"""
def control_http_read_timeout_seconds(self):
"""
Get read timeout setting.
Returns:
int or None: Read timeout in seconds
"""
def control_http_connect_retries(self):
"""
Get connection retries setting.
Returns:
int or None: Number of connection retries allowed
"""
def control_http_connect_timeout_seconds(self):
"""
Get connection timeout setting.
Returns:
int or None: Connection timeout in seconds
"""Function that adds all Control Service configuration definitions to the configuration builder.
def add_definitions(config_builder: ConfigurationBuilder):
"""
Add all Control Service configuration definitions.
Parameters:
- config_builder: ConfigurationBuilder - Builder to add configuration options to
Adds configuration for:
- API_TOKEN: OAuth2 refresh token for authentication
- API_TOKEN_AUTHORIZATION_URL: OAuth2 provider URL
- CONTROL_SERVICE_REST_API_URL: Base REST API URL
- CONTROL_SAMPLE_JOB_DIRECTORY: Sample job directory path
- CONTROL_HTTP_VERIFY_SSL: SSL verification setting
- CONTROL_HTTP_TOTAL_RETRIES: Total HTTP retries
- CONTROL_HTTP_READ_RETRIES: Read HTTP retries
- CONTROL_HTTP_READ_TIMEOUT_SECONDS: Read timeout
- CONTROL_HTTP_CONNECT_RETRIES: Connection retries
- CONTROL_HTTP_CONNECT_TIMEOUT_SECONDS: Connection timeout
"""API_TOKEN = "API_TOKEN"
API_TOKEN_AUTHORIZATION_URL = "API_TOKEN_AUTHORIZATION_URL"CONTROL_SERVICE_REST_API_URL = "CONTROL_SERVICE_REST_API_URL"
CONTROL_SAMPLE_JOB_DIRECTORY = "CONTROL_SAMPLE_JOB_DIRECTORY"CONTROL_HTTP_VERIFY_SSL = "CONTROL_HTTP_VERIFY_SSL"
CONTROL_HTTP_TOTAL_RETRIES = "CONTROL_HTTP_TOTAL_RETRIES"
CONTROL_HTTP_READ_RETRIES = "CONTROL_HTTP_READ_RETRIES"
CONTROL_HTTP_READ_TIMEOUT_SECONDS = "CONTROL_HTTP_READ_TIMEOUT_SECONDS"
CONTROL_HTTP_CONNECT_RETRIES = "CONTROL_HTTP_CONNECT_RETRIES"
CONTROL_HTTP_CONNECT_TIMEOUT_SECONDS = "CONTROL_HTTP_CONNECT_TIMEOUT_SECONDS"from vdk.internal.core.config import ConfigurationBuilder
from vdk.plugin.control_cli_plugin.control_service_configuration import (
ControlServiceConfiguration,
add_definitions
)
# Add configuration definitions
config_builder = ConfigurationBuilder()
add_definitions(config_builder)
# Use configuration in code
config = config_builder.build()
control_config = ControlServiceConfiguration(config)
# Access configuration values
api_url = control_config.control_service_rest_api_url()
verify_ssl = control_config.control_http_verify_ssl()
api_token = control_config.api_token()
if api_url and api_token:
print(f"Connecting to {api_url} with SSL verification: {verify_ssl}")The plugin automatically sets environment variables for vdk-control-cli integration:
# Authentication
export VDK_API_TOKEN="your-api-token"
export VDK_API_TOKEN_AUTHORIZATION_URL="https://auth.example.com/oauth/token"
# Service endpoint
export VDK_CONTROL_SERVICE_REST_API_URL="https://api.example.com"
# HTTP settings
export VDK_CONTROL_HTTP_VERIFY_SSL="true"
export VDK_CONTROL_HTTP_TOTAL_RETRIES="3"
export VDK_CONTROL_HTTP_CONNECT_TIMEOUT_SECONDS="30"Configuration values are validated during plugin initialization:
Install with Tessl CLI
npx tessl i tessl/pypi-vdk-plugin-control-cli