Synchronize APIs across groups
You can synchronize API definitions between API groups. Before you synchronize, review the synchronization scope and complete the required preparations.
1. Synchronization scope
The following information is synchronized:
-
The configuration of selected APIs in an API group
The following information is not synchronized:
-
API group information displayed on the API Groups page, including the public second-level domain name, private domain name, HTTPS security policy, custom domain name, and environment variables
-
API information, including authorization information, bound plug-ins, version history, monitoring information, security information, and API configurations in Alibaba Cloud Marketplace
-
Authentication information of APIs that use OpenID Connect
-
Model configurations
-
During API configuration comparison, the system checks whether API definitions are consistent based on referenced model names, not model definitions.
-
If an API in the source group references a model that is not referenced in the destination group, the model definition is automatically synchronized to the destination group.
-
If the destination group already references a model with the same name as one in the source group, the source model definition is not synchronized.
-
-
Environment variables defined in the source group are not synchronized to the destination group.
-
To synchronize APIs from an existing group to a new group, you must create the new group first. To create a group, click Create Group on the API Groups page.
Do not modify the definitions of APIs that are being synchronized. Doing so may cause errors.
2. Synchronize an API group
-
Log on to the API Gateway console. In the left-side navigation pane, choose Manage APIs > API Groups. On the page that appears, click Sync Configurations of API Groups.
-
In the Prepare for Synchronization step, read the notes, select I have read and agree to the content, and click Next. For more information about the preparation, see section 1 of this topic.
-
Select the source API group, destination API group, and the API version to synchronize. The available versions include the current version and the latest version deployed in the test, staging, or production environment.
The current version refers to the latest definition of an API in the group, regardless of whether the API is published.
-
Compare the APIs. The system compares the APIs based on the following metrics:
-
New APIs: APIs that exist in the source group but not in the destination group.
-
APIs with Different VPC Backend Service Information: APIs that differ only in VPC backend configuration.
-
APIs with Different Definitions: APIs that have different definitions. APIs that differ only in VPC backend configuration are not included.
-
Missing APIs: APIs that exist in the destination group but not in the source group. Such APIs are not synchronized.
-
APIs with Same Definitions: APIs that have the same definitions. These APIs are not synchronized.
-
If there are many APIs to be synchronized, select Select All on Each Page to select all APIs at a time.
-
The environment variables displayed on the page are for reference only. They will not be synchronized.
-
Change the VPC name. You can change the VPC name for multiple APIs at a time by selecting a value from the Change Value of Vpc Name for Selected APIs To drop-down list. Then, click Start Sync.
You can select only APIs whose backend service type is VPC.
-
The system synchronizes the APIs. You can view the synchronization result.
3. View the synchronization history
Log on to the API Gateway console. In the left-side navigation pane, choose Manage APIs > API Groups. On the API Groups page, click Sync Records to view the synchronization history. You can also click View Details in the Actions column to view the details of each synchronization record.