Creates a new command-line interface for managing Edge Connect applications and instances with the following features: - Configuration management via YAML files and environment variables - Application lifecycle commands (create, show, list, delete) - Instance management with cloudlet support - Improved error handling and authentication flow - Comprehensive documentation with usage examples The CLI provides a user-friendly interface for managing Edge Connect resources while following best practices for command-line tool development using Cobra and Viper.
108 lines
No EOL
2.3 KiB
Markdown
108 lines
No EOL
2.3 KiB
Markdown
# Edge Connect CLI
|
|
|
|
A command-line interface for managing Edge Connect applications and their instances.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
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:
|
|
|
|
```yaml
|
|
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:
|
|
```bash
|
|
edge-connect app create --org myorg --name myapp --version 1.0.0 --region us-west
|
|
```
|
|
|
|
Show application details:
|
|
```bash
|
|
edge-connect app show --org myorg --name myapp --version 1.0.0 --region us-west
|
|
```
|
|
|
|
List applications:
|
|
```bash
|
|
edge-connect app list --org myorg --region us-west
|
|
```
|
|
|
|
Delete an application:
|
|
```bash
|
|
edge-connect app delete --org myorg --name myapp --version 1.0.0 --region us-west
|
|
```
|
|
|
|
### Managing Application Instances
|
|
|
|
Create a new application instance:
|
|
```bash
|
|
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:
|
|
```bash
|
|
edge-connect instance show \
|
|
--org myorg \
|
|
--name myinstance \
|
|
--cloudlet mycloudlet \
|
|
--cloudlet-org cloudletorg \
|
|
--region us-west
|
|
```
|
|
|
|
List instances:
|
|
```bash
|
|
edge-connect instance list \
|
|
--org myorg \
|
|
--cloudlet mycloudlet \
|
|
--cloudlet-org cloudletorg \
|
|
--region us-west
|
|
```
|
|
|
|
Delete an instance:
|
|
```bash
|
|
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 |