Synchronize Published Service Version between Gateway Groups
Synchronizing published services versions between groups helps promote APIs across environments, especially from lower to higher environments such as from the test
environment to the production
environment. If you are using multiplge gateway groups for segmenting regions or teams, synchronizing APIs will help you distribute APIs globally.
info
- Syncing keeps the service version consistent between gateway groups, while publishing results in new version numbers for each publish.
- You can only sync the currently running service version, no history versions.
Prerequisites
- Obtain a user account with Super Admin or API Provider role.
- Publish a service.
- Add a secondary gateway group and name it
Production Group
. Make this gateway group acts as the API gateway for yourproduction
environment. - Add at least one gateway instance in the Production Group`.
Sync Service Version to Production Group
- Using Upstream Nodes
- Using Service Discovery
- Select Services from the side navigation bar, then click version
1.0.0
under serviceSwagger Petstore
. - Click
Sync to Other Gateway Group
from the Actions list. - In the Gateway Group field, choose
Production Group
, and then click Next. - In the How to find the upstream field, choose
Use Nodes
. - From the Nodes table, edit the Host and Port fields, enter your backend node address in the production environment or the mock server address.
- Click Sync.
- Select Services from the side navigation bar, then click version
1.0.0
under serviceSwagger Petstore
. - Click
Sync to Other Gateway Group
from the Actions list. - In the Gateway Group field, choose
Production Group
, and then click Next. - In the How to find the upstream field, choose
Use Service Discovery
. - In the Service Registry field, choose
Registry for Test
, as well as the Namespace and service name in the Registry. - Click Sync.
Validate APIs in the Production Environment
curl "http://127.0.0.1:9080/pet/1" # Replace 127.0.0.1 to the address of your production group.
You can see the response from upstream:
{
"name": "Dog",
"photoUrls": [
"https://example.com/dog-1.jpg",
"https://example.com/dog-2.jpg"
],
"id": 1,
"category": {
"id": 1,
"name": "pets"
},
"tags": [
{
"id": 1,
"name": "friendly"
},
{
"id": 2,
"name": "smart"
}
],
"status": "available"
}