FlexDeploy has various REST API that can be used for many useful purposes. For example, you can create Topology configurations or execute Build and Deploy workflows using REST API. See details at FlexDeploy REST API Guide.

In this blog entry, I will demonstrate use of REST API to setup Git Integrations in FlexDeploy with inputs from CSV file. This task can be done from FlexDeploy UI, but it is good idea to use REST API to speed up the configuration process. We will use POST method of Source Control Management Instance API.

For example, I have prepared CSV file with 10 Git Integrations with columns for Code, Name and URL to be used in FlexDeploy Git Integration. In this example, I am using same user ID and password for all Git repositories but you can always adjust this script as necessary.

With FlexDeploy you can use REST API to setup Git Integrations.Adjust run.sh file (shown below) for various properties like FD_HOST, FD_PORT, FD_USER, FD_PASSWORD, GITUSER and GITPASSWORD. When you run this script, it will invoke FlexDeploy REST API to create Git Integration configurations with data from scm.csv file.

Here is sample scm.csv file.


run.sh code that will use scm.csv file.



export IFS=","
cat scm.csv | while read CODE NAME GITURL
   echo Create FlexDeploy Git Connection using $CODE $NAME $GITURL
   curl -u $FD_USER:$FD_PASSWORD -i -X POST -H "Content-Type:application/json" http://$FD_HOST:$FD_PORT/flexdeploy/rest/v1/topology/integrations/scminstance -d '{"instanceName":"'$NAME'","properties":[{"propertyName":"FDGIT_URL","propertyValue":"'$GITURL'"},{"propertyName":"FDGIT_USER","propertyValue":"'$GITUSER'"},{"propertyName":"FDGIT_PASSWORD","propertyValue":"'$GITPASSWORD'"}],"scmType":"GIT","instanceCode":"'$CODE'","isActive":true}'

There are many possibilities with API, this was just a simple example for API usage.

Chandresh Patel

I have been working with Java EE technologies since 2000. After implementing IBM WebSphere and custom framework solutions, my past 10 years have been focused on Oracle Fusion Middleware such as WebLogic, ADF, WebCenter and Coherence. I have been part of many automation projects in the past and have a passion for automation capabilities to help our customers deliver software faster and with higher quality. In my current role as a Principal Architect at Flexagon, I am driving the FlexDeploy product strategy and development to build DevOps/CI/CD features that help our customers.

More posts by Chandresh Patel

Leave a Reply

Your email address will not be published. Required fields are marked *