CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-python-on-whales

A Docker client for Python, designed to be fun and intuitive!

Pending
Overview
Eval results
Files

config.mddocs/

Config Management

Docker swarm configuration management for securely storing non-sensitive configuration data like application settings, environment-specific values, and template files. Configs are stored in the swarm cluster and can be mounted to services without exposing sensitive information.

Capabilities

Config Creation

Create configurations from files or data with labeling and template support.

def create(
    name: str,
    file: Optional[str] = None,
    labels: Optional[Dict[str, str]] = None,
    template_driver: Optional[str] = None
) -> Config:
    """
    Create a configuration object.
    
    Parameters:
    - name: Configuration name
    - file: Path to file containing configuration data
    - labels: Metadata labels for the configuration
    - template_driver: Template driver to use for processing
    
    Returns:
    Config object
    """

Usage Examples:

from python_on_whales import docker

# Create config from file
config = docker.config.create(
    "app-config",
    file="./config/app.conf",
    labels={"environment": "production", "version": "1.0"}
)

# Create config from string data
with open("temp_config.txt", "w") as f:
    f.write("debug=false\nport=8080")
    
config = docker.config.create("server-config", file="temp_config.txt")

Config Inspection

Inspect configuration details including metadata, creation time, and specification.

def inspect(x: Union[str, List[str]]) -> Union[Config, List[Config]]:
    """
    Inspect one or more configurations.
    
    Parameters:
    - x: Configuration name(s) or ID(s)
    
    Returns:
    Config object(s) with detailed information
    """

Config Listing

List all configurations with optional filtering.

def list(filters: Optional[Dict[str, str]] = None) -> List[Config]:
    """
    List all configurations.
    
    Parameters:
    - filters: Filter results (e.g., {"name": "app-*"})
    
    Returns:
    List of Config objects
    """

Config Removal

Remove configurations from the swarm.

def remove(x: Union[str, List[str]]) -> None:
    """
    Remove one or more configurations.
    
    Parameters:
    - x: Configuration name(s) or ID(s)
    """

Types

class Config:
    id: str
    version: DockerObjectVersion
    created_at: datetime
    updated_at: datetime
    spec: ConfigSpec
    
    def remove(self) -> None:
        """Remove this configuration."""

class ConfigSpec:
    name: str
    labels: Dict[str, str]
    data: Optional[str]
    template_driver: Optional[str]

class DockerObjectVersion:
    index: int

Install with Tessl CLI

npx tessl i tessl/pypi-python-on-whales

docs

build.md

client.md

compose.md

config.md

containers.md

context.md

images.md

index.md

manifest.md

networks.md

node.md

plugin.md

pod.md

secret.md

service.md

stack.md

swarm.md

system.md

task.md

trust.md

volumes.md

tile.json