Deploy script will update the existing API with new version of API and copy all of existing API dependencies like applications, organizations, quotas to New API without any downtime.
This project successfully tested with following versions:
- Axway AMPLIFY API Management v7.7.20211130
- Axway AMPLIFY API Management 7.7
- JDK 1.8.0_xxx
- Apache Maven 3.3.9 or above
$mvn clean package
-c, --clusterurl=<urls> Space seperated API Manager Cluster URLs
-e, --url=<url> API Manager URL
-h, --help Show this help message and exit.
-i, --openapi=<openAPI> Open API File location
-n, --name=<apiName> API name
-o, --organization_name=<orgName> API Manager Development Organization name
-p, --password=<password> API Manager Password
-s, --skipSSL SKIP SSL server validation
-u, --username=<username> API Manager Username
-V, --version Print version information and exit.
Deployment script does the following.
- Authenticate with API manager using command line parameters username and password.
- Fetch Organization id from organization name.
- Fetch Frontend API by passing api name as a parameter.
- If step 3 is success, fetch backend details and compare openapi from API manager and input openapi parameter.
- If there are no differences in input and existing open api, the process stops.
- If there are differences, it goes to step 4
- Creates backend api
- Creates frontend api
- Copy frontend API security from existing API
- publish frontend API
- Copy all dependencies (applications, organizations, quotas) from existing API to new API.
- Poll API Gateway catalog until new APIs are updated with status published. ( if clusters of API gateway is provided as input, it polls all API Gateways catalog for status published)
- Deprecate the exiting API with retirement date.
- The retired API could be deleted in two ways
- Enable retirement alert on API manager, and enhance alert policy to delete API. Sample policy.
- If more than one API Gateways are deployed, add check on alert policy via evaluate filter like ${environment.alert.equals(“true”)}
- Set up an environment variable ( $export alert=true) on an API Gateway machine which needs to process alerts.
- If the environment variable is set, it will process the alert polices otherwise it will ignore it.
- Wait for retirement date in effect and delete API.
- Enable retirement alert on API manager, and enhance alert policy to delete API. Sample policy.
$java -jar apim-deployment-1.0.1.jar -e https://10.129.58.31:8077 -u apiadmin -p changeme -n petstore -o Development -i swagger.json -s
$java -jar apim-deployment-1.0.1.jar -e https://10.129.58.31:8077 -c https://10.129.58.32:8077 https://10.129.58.33:8077 -u apiadmin -p changeme -n pestore -o Westpac -i swagger.json -s
Please read Contributing.md for details on our code of conduct, and the process for submitting pull requests to us.