feat(config): add API version selector for v1 and v2

Add configurable API version selection with three methods:
- Config file: api_version: "v1" or "v2" in .edge-connect.yaml
- CLI flag: --api-version v1/v2
- Environment variable: EDGE_CONNECT_API_VERSION=v1/v2

Changes:
- Update root.go to add api_version config and env var support
- Update app.go and instance.go to support both v1 and v2 clients
- Add example config file with api_version documentation
- Default to v2 for backward compatibility
- Apply command always uses v2 (advanced feature)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Richard Robert Reitz 2025-10-20 13:41:50 +02:00
parent 3486b2228d
commit 2a8e99eb63
5 changed files with 319 additions and 108 deletions

View file

@ -0,0 +1,14 @@
# Example EdgeConnect CLI Configuration File
# Place this file at ~/.edge-connect.yaml or specify with --config flag
# Base URL for the EdgeConnect API
base_url: "https://hub.apps.edge.platform.mg3.mdb.osc.live"
# Authentication credentials
username: "your-username@example.com"
password: "your-password"
# API version to use (v1 or v2)
# Default: v2
# Set via config, --api-version flag, or EDGE_CONNECT_API_VERSION env var
api_version: "v2"