Many companies are modernizing their systems as part of mobilization and digitization of the business. DevOps concepts are being employed to increase the delivery velocity of modern applications to the business. With DevOps it is critical to automate all aspects of deploying new software features. The time required for manual steps adds up and defeats DevOps goals. In the example below, we have automated API and policy management to speed deployment, introduce continuous integration concepts and place API artifacts under source code management.
In an effort towards modernization of the API and the organization moving towards Agile from traditional waterfall, DevOps is becoming essential in making sure the development and operations team work towards a common goal. Achieving continuous integration and delivery is key and is aided by multiple tools in the market. As each organization builds APIs for easy consumption and monetization, continuous integration and delivery is integral part of the solution to enable fast to market.
The following steps depict how you can achieve continuous integration and delivery for CA API Gateway, which is widely used across multiple industry for exposing APIs and more importantly to secure the APIs:
- Develop a policy in policy manager
- Export a Policy: Export the policy xml using headless java utility called Gateway Migration Utility, available from CA, and check in the artifacts
- Create an argFile.properties with below arguments
host – host name of the gateway from which the policy has to be exported
port – Port number to connect to the gateway
username – username to connect to the gateway
password – encoded password of the gateway
format – specify as single file if the export is for policy file or folder for a folder
dest= policy XML name for storing the XML
serviceName= Actual Policy name in the gateway
encryptionPassphrase – Passphrase for encryption
- Create an argFile.properties with below arguments
- Before export , validate the connection to the gateway is successful using gateway migration utility command below
- GatewayMigrationUtility.sh browse -z argFile.properties -r –showIds – this should list all the policies running in the gateway.
- Migrate out the policy from the gateway by using the gateway utility command below
- GatewayMigrationUtility.sh migrateOut –argFile argFile.properties
- Externalize the variable with the values from the exported policy xml using the below command
- GatewayMigrationUtility.sh template –bundle policyAPI.xml –template policyTemplate-.properties – This will create the template properties file with the key / value pair having variable names and corresponding values, and the values in the file can be modified with specific environment properties.
- Create a Mapping file for the mappings. These are used to specify the action to be used for a given type and the srcId when importing to different environments.
- Copy the mappings section from the bundle file
- Save the mappings as policyAPIMappings.xml
- Modify the properties for the type as required
- Check in the policy XML, Mappings XML, argFile properties file, and template property files to the code repository
- Import a Policy: Configure Jenkins to poll the files for the policy from code repository
- Package the artifacts (policy XML , mappings XML , argFile and template properties file ) to artifactory or any build file storage
- Configure SSH to send the files over to build server and execute the migrate in command as below
- Configure the test cases for the policy as an test suite to execute the test cases after the migration to the target gateway and publish the results
Note: The above example uses credentials (username/password) of the gateway to import and export the policy out of gateway. You can do this using the certs as a mechanism to import /export the policy.
Reference: CA API Gateway Documentation
It is necessary to automate deployment for all components to optimize the velocity of software innovation. In the example above we have eliminated a manual step associated with API deployment.
Wow. That is so elegant and logical and clearly explained. Brilliantly goes through what could be a complex process and makes it obvious.
Thank you
Hi Anand,
Nice post. I am also working on CA API Gateway. I would request you to share more details on CI/CD. Please message me on linkdin if you can.
Regards,
Jamsheed Chittan
This article is very useful , who want to learn DevOps. DevOps is a development methodology with a set of practices aimed at reducing the time between Development and Operations. Now a days DevOps is best future career for students.
I have read your blog andI got very useful and knowledgeable information from your blog. It’s really a very nice article. You have done a great job.
Thank you
Thanks
Thanks for sharing such a wonderful information on DevOps.
thank you
http://itorigins.com/
DevOps is well technology for continuous delivery of software products…
Hi
nice blog
thanks for sharing this blog
Hey Excellent blog
thanks for sharing this blog
I love to read your articles because your signature method is too good, it is extremely helpful.
Very helpful post!! Followed you over here from Mugwump. Being from India I have never needed such knowledge, but you never know when things will change.
I just want to say that all the information you have given here on is awesome.
Nice Article About devOps. Such a wonderful information.
Thank you for sharing ,such a great post.
My biggest problem for the process is the step 6:
1.Copy the mappings section from the bundle file
2.Save the mappings as policyAPIMappings.xml
3.Modify the properties for the type as required
Those are very manual involved to cut paste a section to create a file and manually identify the ids that need to mapped when environment are different in the ids generated by the deployment. I have not find a good way to automate the things. Can a better way provided to achieve this? Anyway expose internal gateway goid to DevOp people is not an ideal practice. It should be only be used by internal gateway program.