or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/python-libmaas@0.6.x

docs

index.md
tile.json

tessl/pypi-python-libmaas

tessl install tessl/pypi-python-libmaas@0.6.0

Python client library for MAAS 2.0+ with sync/async support, providing machine provisioning, network management, and storage configuration.

files.mddocs/reference/

File Management

Store and retrieve files in MAAS for use during machine deployment, such as configuration files, scripts, or cloud-init data. Files uploaded to MAAS can be referenced during commissioning, deployment, or other machine operations.

Capabilities

Listing Files

Retrieve metadata about all files stored in MAAS.

client.files.list()
from maas.client import connect

client = connect('http://maas.example.com:5240/MAAS/', apikey='key')

# List all files
files = client.files.list()
for file in files:
    print(f"Filename: {file.filename}")

File Properties

Each File object provides:

  • filename (str): Name of the file as stored in MAAS

Accessing Files

Files stored in MAAS can be accessed via the MAAS API using the file management endpoints. The python-libmaas library provides read-only access to file metadata through the Files.list() method.

For uploading files or performing write operations, use the MAAS REST API directly or the MAAS CLI tool:

# Using MAAS CLI to upload a file
maas <profile> files create filename=cloud-config.yaml content@=/path/to/file.yaml

# Using MAAS CLI to delete a file
maas <profile> file delete <filename>

File Usage in Deployments

Files stored in MAAS can be referenced in curtin configs, cloud-init data, or commissioning scripts. They are typically accessed by machines during deployment via internal MAAS URLs.

from maas.client import connect

client = connect('http://maas.example.com:5240/MAAS/', apikey='key')

# Check available files
files = client.files.list()
print(f"Available files: {[f.filename for f in files]}")

# Deploy a machine that references stored files
machine = client.machines.allocate()
# Files can be referenced in user_data or curtin config during deployment

Types

class File:
    """A file stored in MAAS."""

    filename: str