2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00
2025-10-11 17:06:14 +00:00

Wild Central Daemon

The Wild Central Daemon is a lightweight service that runs on a local machine (e.g., a Raspberry Pi) to manage Wild Cloud instances on the local network. It provides an interface for users to interact with and manage their Wild Cloud environments.

Development

make dev

Usage

Batch Configuration Update Endpoint

Overview

The batch configuration update endpoint allows updating multiple configuration values in a single atomic request.

Endpoint

PATCH /api/v1/instances/{name}/config

Request Format

{
  "updates": [
    {"path": "string", "value": "any"},
    {"path": "string", "value": "any"}
  ]
}

Response Format

Success (200 OK):

{
  "message": "Configuration updated successfully",
  "updated": 3
}

Error (400 Bad Request / 404 Not Found / 500 Internal Server Error):

{
  "error": "error message"
}

Usage Examples

Example 1: Update Basic Configuration Values
curl -X PATCH http://localhost:8080/api/v1/instances/my-cloud/config \
  -H "Content-Type: application/json" \
  -d '{
    "updates": [
      {"path": "baseDomain", "value": "example.com"},
      {"path": "domain", "value": "wild.example.com"},
      {"path": "internalDomain", "value": "int.wild.example.com"}
    ]
  }'

Response:

{
  "message": "Configuration updated successfully",
  "updated": 3
}
Example 2: Update Nested Configuration Values
curl -X PATCH http://localhost:8080/api/v1/instances/my-cloud/config \
  -H "Content-Type: application/json" \
  -d '{
    "updates": [
      {"path": "cluster.name", "value": "prod-cluster"},
      {"path": "cluster.loadBalancerIp", "value": "192.168.1.100"},
      {"path": "cluster.ipAddressPool", "value": "192.168.1.100-192.168.1.200"}
    ]
  }'
Example 3: Update Array Values
curl -X PATCH http://localhost:8080/api/v1/instances/my-cloud/config \
  -H "Content-Type: application/json" \
  -d '{
    "updates": [
      {"path": "cluster.nodes.activeNodes[0]", "value": "node-1"},
      {"path": "cluster.nodes.activeNodes[1]", "value": "node-2"}
    ]
  }'
Example 4: Error Handling - Invalid Instance
curl -X PATCH http://localhost:8080/api/v1/instances/nonexistent/config \
  -H "Content-Type: application/json" \
  -d '{
    "updates": [
      {"path": "baseDomain", "value": "example.com"}
    ]
  }'

Response (404):

{
  "error": "Instance not found: instance nonexistent does not exist"
}
Example 5: Error Handling - Empty Updates
curl -X PATCH http://localhost:8080/api/v1/instances/my-cloud/config \
  -H "Content-Type: application/json" \
  -d '{
    "updates": []
  }'

Response (400):

{
  "error": "updates array is required and cannot be empty"
}
Example 6: Error Handling - Missing Path
curl -X PATCH http://localhost:8080/api/v1/instances/my-cloud/config \
  -H "Content-Type: application/json" \
  -d '{
    "updates": [
      {"path": "", "value": "example.com"}
    ]
  }'

Response (400):

{
  "error": "update[0]: path is required"
}

Configuration Path Syntax

The path field uses YAML path syntax as implemented by the yq tool:

  • Simple fields: baseDomain
  • Nested fields: cluster.name
  • Array elements: cluster.nodes.activeNodes[0]
  • Array append: cluster.nodes.activeNodes[+]

Refer to the yq documentation for advanced path syntax.

Description
The daemon that exposes the web API on a Wild Central device.
Readme AGPL-3.0 875 KiB
Languages
Go 90.2%
Shell 9.5%
Makefile 0.3%