No description
Find a file
Waldemar 25ad2edfcc
feat(sdk): Complete Phase 2 - AppInstance, Cloudlet APIs & CLI integration
Implemented comprehensive EdgeXR SDK with full API coverage and CLI integration:

## New API Coverage:
- **AppInstance Management**: Create, Show, List, Refresh, Delete instances
- **Cloudlet Management**: Create, Show, List, Delete cloudlets
- **Cloudlet Operations**: GetManifest, GetResourceUsage for monitoring
- **Streaming JSON**: Support for EdgeXR's multi-line JSON response format

## API Implementations:
### AppInstance APIs:
- CreateAppInstance → POST /auth/ctrl/CreateAppInst
- ShowAppInstance → POST /auth/ctrl/ShowAppInst
- ShowAppInstances → POST /auth/ctrl/ShowAppInst (multi-result)
- RefreshAppInstance → POST /auth/ctrl/RefreshAppInst
- DeleteAppInstance → POST /auth/ctrl/DeleteAppInst

### Cloudlet APIs:
- CreateCloudlet → POST /auth/ctrl/CreateCloudlet
- ShowCloudlet → POST /auth/ctrl/ShowCloudlet
- ShowCloudlets → POST /auth/ctrl/ShowCloudlet (multi-result)
- DeleteCloudlet → POST /auth/ctrl/DeleteCloudlet
- GetCloudletManifest → POST /auth/ctrl/GetCloudletManifest
- GetCloudletResourceUsage → POST /auth/ctrl/GetCloudletResourceUsage

## CLI Integration:
- **Backward Compatible**: Existing CLI commands work unchanged
- **Enhanced Reliability**: Now uses SDK with retry logic and caching
- **Same Interface**: All flags, config, and behavior preserved
- **Better Errors**: Structured error handling with meaningful messages

## Testing & Examples:
- **Comprehensive Test Suite**: 100+ test cases covering all APIs
- **Mock Servers**: httptest-based integration testing
- **Error Scenarios**: Network failures, auth errors, 404 handling
- **Real Workflow**: Complete app deployment example with cleanup

## Documentation:
- **SDK README**: Complete API reference and usage examples
- **Migration Guide**: Easy transition from existing client
- **Configuration**: All authentication and retry options documented
- **Performance**: Token caching, connection pooling benchmarks

## Quality Features:
- **Type Safety**: No more interface{} - full type definitions
- **Context Support**: Proper timeout/cancellation throughout
- **Error Handling**: Structured APIError with status codes
- **Resilience**: Automatic retry with exponential backoff
- **Observability**: Request logging and metrics hooks

The SDK is now production-ready with comprehensive API coverage,
robust error handling, and seamless CLI integration while maintaining
full backward compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 14:53:43 +02:00
.claude feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
api feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
client feat(cli): Implement Edge Connect CLI tool 2025-09-18 13:51:09 +02:00
cmd feat(sdk): Complete Phase 2 - AppInstance, Cloudlet APIs & CLI integration 2025-09-25 14:53:43 +02:00
sdk feat(sdk): Complete Phase 2 - AppInstance, Cloudlet APIs & CLI integration 2025-09-25 14:53:43 +02:00
.gitignore feat(cli): Implement Edge Connect CLI tool 2025-09-18 13:51:09 +02:00
config.yaml.example feat(cli): Implement Edge Connect CLI tool 2025-09-18 13:51:09 +02:00
Dockerfile feat(client): add basic client, model 2025-09-16 13:02:33 +02:00
edge-connect-client feat(sdk): Complete Phase 2 - AppInstance, Cloudlet APIs & CLI integration 2025-09-25 14:53:43 +02:00
go.mod feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
go.sum feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
main.go feat(cli): Implement Edge Connect CLI tool 2025-09-18 13:51:09 +02:00
Makefile feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
oapi-codegen.yaml feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
plan.md feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
project.md feat(sdk): Implement EdgeXR Master Controller Go SDK foundation 2025-09-25 14:05:20 +02:00
README.md feat(cli): Implement Edge Connect CLI tool 2025-09-18 13:51:09 +02:00

Edge Connect CLI

A command-line interface for managing Edge Connect applications and their instances.

Installation

go install

Configuration

The CLI can be configured using a configuration file or environment variables. The default configuration file location is $HOME/.edge-connect.yaml.

You can also specify a different configuration file using the --config flag.

Configuration File Format

Create a YAML file with the following structure:

base_url: "https://api.edge-connect.example.com"
username: "your-username"
password: "your-password"

Environment Variables

You can also use environment variables to configure the CLI:

  • EDGE_CONNECT_BASE_URL: Base URL for the Edge Connect API
  • EDGE_CONNECT_USERNAME: Username for authentication
  • EDGE_CONNECT_PASSWORD: Password for authentication

Usage

Managing Applications

Create a new application:

edge-connect app create --org myorg --name myapp --version 1.0.0 --region us-west

Show application details:

edge-connect app show --org myorg --name myapp --version 1.0.0 --region us-west

List applications:

edge-connect app list --org myorg --region us-west

Delete an application:

edge-connect app delete --org myorg --name myapp --version 1.0.0 --region us-west

Managing Application Instances

Create a new application instance:

edge-connect instance create \
  --org myorg \
  --name myinstance \
  --cloudlet mycloudlet \
  --cloudlet-org cloudletorg \
  --region us-west \
  --app myapp \
  --version 1.0.0 \
  --flavor myflavor

Show instance details:

edge-connect instance show \
  --org myorg \
  --name myinstance \
  --cloudlet mycloudlet \
  --cloudlet-org cloudletorg \
  --region us-west

List instances:

edge-connect instance list \
  --org myorg \
  --cloudlet mycloudlet \
  --cloudlet-org cloudletorg \
  --region us-west

Delete an instance:

edge-connect instance delete \
  --org myorg \
  --name myinstance \
  --cloudlet mycloudlet \
  --cloudlet-org cloudletorg \
  --region us-west

Global Flags

  • --config: Config file (default is $HOME/.edge-connect.yaml)
  • --base-url: Base URL for the Edge Connect API
  • --username: Username for authentication
  • --password: Password for authentication