API Declarative CLI (ADC)
API Declarative CLI (ADC) manages API7 Gateway configuration from local YAML or JSON files.
This document introduces how ADC fits into API7 Gateway configuration management. For installation instructions, command usage, configuration format, OpenAPI conversion, and additional ADC reference material, see the ADC documentation.
Manage Configuration as Code
Use ADC when API7 Gateway configuration should be managed as code instead of through individual Dashboard edits or Admin API calls. ADC works with local declarative files that describe the desired gateway state, then compares those files with the running gateway before changes are applied.
This workflow helps teams:
- Review and audit gateway configuration changes through version control.
- Promote the same configuration across gateway groups or environments.
- Preview create, update, and delete operations before syncing.
- Export existing gateway group configuration as a baseline for future changes.
ADC is well suited for teams that manage gateway configuration through CI/CD pipelines.
How ADC Works with API7 Gateway
ADC connects to the API7 Gateway Control Plane and applies declarative configuration to a gateway group. This lets teams manage routes, services, upstreams, consumers, plugins, and other gateway resources through files instead of manual Dashboard or Admin API changes.
Before applying changes, ADC can check local files, ask the backend to validate resources, and show the difference between the local desired state and the running gateway. This makes configuration changes easier to review before they reach API7 Gateway.
See Supported Versions and Interoperability for the backend validation boundary.
Reconciliation Scope and Ownership
adc sync can delete in-scope remote resources that are absent from the local files. Select the intended gateway group, run adc diff, and review the generated diff.yaml before synchronizing. See the ADC workflow and label selector guides for current scoping behavior.
By default, ADC adds or overwrites the managed-by: adc label in the local configuration before diff, validate, and sync. The first comparison of existing resources can therefore show label-only updates. This label identifies ADC-managed resources but does not limit reconciliation scope. Use --no-managed-by-label when the managed-by label must remain unchanged.
For details beyond API7 Gateway connection setup, refer to the ADC documentation.