---
title: Example: Device Management / System
slug: sdk/example-usages/device-management-system
docTags: 
createdAt: 2025-03-20T19:52:03.238Z
---

End-to-end walkthrough: export a configuration template from a "golden" Edge and apply it on another, plus manage users, tokens, and certificates.

## Setup

```python
from litmussdk.system import templates, users, tokens, certificates
```

## 1. Export a Configuration Template

The full template captures everything: devices, tags, flows, marketplace registries, NTP, DNS, OPC, etc.

```python
# What can be exported?
items = templates.list_available_configurable_items()

# Export everything
full = templates.download_template_complete()
```

:::BlockQuote
**2.6.0 fix**: in versions \<2.6.0, `download_template_complete()` raised `TypeError` on every call. Fixed in 2.6.0 - now works as documented.
:::

For a partial export:

```python
partial = templates.download_template(
    dns=True,
    ntp=True,
    timezone=True,
    devices=["device-id-1", "device-id-2"],
    flows=["flow-id-1"],
)
```

## 2. Save and Apply on Another Edge

```python
import json

with open("plant-floor-config.json", "w") as f:
    json.dump(full, f, indent=2)

# On another Edge with its own connection:
with open("plant-floor-config.json") as f:
    templates.apply_template(json.load(f))
```

For air-gap deployments, see [Air gap Features](#) for a programmatic builder.

## 3. Users and Groups

```python
all_users = users.list_users()

new_user = users.create_user(
    username="ops-jane",
    email="jane@example.com",
    full_name="Jane Smith",
    password="...",
    group_id=group_id,
)

users.delete_user(new_user.id)
```

## 4. API Tokens (OAuth Clients)

```python
all_tokens = tokens.list_tokens()

new_token = tokens.create_oauth_token(
    name="ci-pipeline",
    scope="admin",
)
client_id = new_token["client_id"]
client_secret = new_token["client_secret"]   # store securely; not retrievable later

tokens.delete_token(new_token["id"])
```

## 5. Certificates

```python
all_certs = certificates.list_certificates()

certificates.upload_certificate(
    cert_path="/path/to/cert.pem",
    key_path="/path/to/key.pem",
    name="my-https-cert",
)

certificates.delete_certificate(cert_id)
```

## 6. Network and System Info

```python
from litmussdk.system import network, general

# Network interfaces
interfaces = network.list_interfaces()

# System version and uptime
info = general.get_system_info()
version = general.get_version()
```

## 7. Events and Audit Log

```python
from litmussdk.system import events

recent = events.list_events(limit=100)
for evt in recent:
    print(f"{evt['timestamp']} {evt['type']} {evt['message']}")
```

## See Also

- [Air gap Features](docId\:dmvQ8b6h_Macksn07230r) - programmatic template builder for offline deployment
- [Managing Connections](docId\:vwtFo9SXcMRbFX9cAfENw) - if you're sourcing the template from one Edge and applying on another

