Skip to content

Commit

Permalink
docs: update readme for release (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
pottekkat authored and bzp2010 committed Jul 12, 2024
1 parent a2d0d15 commit 35e59b9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 36 deletions.
81 changes: 52 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# API Declarative CLI (ADC)

ADC is a command line utility to interface with API7 Enterprise and Apache APISIX Admin API.
ADC is a command line utility that interfaces with API7 Enterprise and Apache APISIX Admin APIs.

## Supported Backend
## Supported Backends

| Backend | Documentation |
| --------------- | --------------------------------------- |
| API7 Enterprise | [README](libs/backend-api7/README.md) |
| Apache APISIX | [README](libs/backend-apisix/README.md) |
The following backend types are supported in ADC:

## Supported Converter
1. [API7 Enterprise](libs/backend-api7/README.md)
2. [Apache APISIX](libs/backend-apisix/README.md)

| Converter | Documentation |
| -------------- | ------------------------------------------ |
| OpenAPI Spec 3 | [README](libs/converter-openapi/README.md) |
## Supported Converters

The following converters are supported to convert API specifications to ADC configuration:

1. [OpenAPI Spec 3](libs/converter-openapi/README.md)

## Installation

Expand All @@ -27,71 +27,94 @@ mv adc /usr/local/bin/adc

Pre-built binaries for `amd64` and `arm64` on Linux, Windows, and macOS are available now.

## Usage

### Initial setup

The easiest way to persist configurations is to use environment variables. You can check the environment variables in `adc help`.
## Configure ADC

The ADC supports dotenv, so you can create `.env` files to store environment variables.
You can configure ADC through environment variables or command line flags. Run `adc help [command]` to see the available configuration options for a command.

You need to set the `token` to the ADC so that the ADC can access API7 Enterprise and the Apache APISIX Admin API.
ADC supports dotenv, so you can store and use your environment variables in a `.env` file. The examples below show how to configure ADC for both API7 Enterprise and Apache APISIX backends.

#### API7 Enterprise
### Example API7 Enterprise Configuration

```bash
ADC_BACKEND=api7ee
ADC_SERVER=https://localhost:7443
ADC_TOKEN=<generate token on API7 Dashboard>
ADC_TOKEN=<token generated from the dashboard>
```

#### Apache APISIX
### Example Apache APISIX Configuration

```bash
ADC_SERVER=http://localhost:9180
ADC_TOKEN=<Admin API key in the configuration file>
ADC_TOKEN=<APISIX Admin API key>
```

### Common commands
## Usage

#### Check connectivity
This section highlights some of the common ADC commands.

### Check Connectivity

The `ping` command verifies the configuration by trying to connect to the configured backend:

```bash
adc ping
```

#### Dump configurations to ADC format
### Dump Configuration in ADC Format

The `dump` command fetches the current configuration of the backend and saves it in the ADC configuration file format:

```bash
adc dump -o adc.yaml
```

#### Check for differences between local and remote configurations
### Show the Difference between Local and Remote Configuration

The `diff` command compares the configuration in the specified ADC configuration file with the current configuration of the backend:

```bash
adc diff -f adc.yaml
```

#### Synchronize local configuration
### Synchronize Local Configuration

The `sync` command synchronizes the configuration in the specified ADC configuration file with the backend:

```bash
adc sync -f adc.yaml
```

#### Convert API configuration
### Convert API Specifications

For example, it supports the conversion of OpenAPI 3 to ADC configurations.
The `convert` command converts API specifications to ADC configuration. Currently, it supports converting an OpenAPI 3 specification to ADC configuration.

```bash
adc convert openapi -f openapi.yaml
```

#### Verify ADC configuration
### Verify ADC Configuration

The `lint` command verifies the provided ADC configuration file locally.

```bash
adc lint -f adc.yaml
```

## Development

To build ADC from source, [install Nx](https://nx.dev/getting-started/installation) and run:

```bash
pnpm install
nx build cli
```

To use the binary, run:

```bash
node dist/apps/cli/main.js -h
```

## License

This project is licensed under the [Apache 2.0 License](LICENSE).
6 changes: 3 additions & 3 deletions libs/backend-api7/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# API7 Enterprise backend for ADC
# API7 Enterprise Backend for ADC

## Supported Features

| Features | Supported |
| ------------- | --------- |
| Dump to ADC | |
| Sync from ADC | |
| Dump to ADC ||
| Sync from ADC ||
8 changes: 4 additions & 4 deletions libs/backend-apisix/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Apache APISIX backend for ADC
# Apache APISIX Backend for ADC

**This backend is experimental and still has many unresolved issues.**

## Supported Features

| Features | Supported |
| ------------- | --------- |
| Dump to ADC | |
| Sync from ADC | |
| Dump to ADC ||
| Sync from ADC ||

## Known issues/limitations
## Known Issues/Limitations

### ID-based upstream references are not supported

Expand Down

0 comments on commit 35e59b9

Please sign in to comment.