BusinessConnect Container Edition 1.4.0 added a new component, called the
Configuration API Server. This server:
- Enables you to configure TIBCO BusinessConnectâ„¢ Container Edition settings without logging into Admin Server UI.
- Supports importing and exporting of configuration files.
The server is referenced as bcce-cas in the BCCE implementation
The bcce-cas service will access the bcce-cms service and the bcce-cas APIs will call the bcce-cms APIs with the valid token. It uses Swagger to implement the API interface.
There are 4 Swagger APIs:
- Get the token with authenticate user by username and password
- Import BCCE Configuration
- Export BCCE Configuration
- Export Gateway Token zip
The CAS server is configured through these properties in the $BCCE/config/deployment.properties file:
cas_host=%host_ip%
cas_port=30020
and the
Service URL Swagger interface is http
s://<bcce-cas-loadbalancer>:30020/swagger/index.html
After you get on this Swagger APIs page, you should see all the info there: Some example screens:
Main screen:
You start out by POSTing to the /configuration/auth screen. You get to this screen by clicking on the method, and then clicking on the "Try it out" button to expand the screen to enter your parameters.
A successful login returns a token which you can use to upload or download configurations. Save this token for future calls:
NOTE: All of the return screen return the curl command that you can use to invoke the interface from a command line, as well as the URL for the CAS interface;
For export, use the /configuration/export GET method, pasting the token into the x-atmosphere-token field
To import a configuration, use the /configuration/import POST method
To export the GS token, use the /configuration/export/gs GET method:
This script shows how to do a .csx import into BCCE configuration store. The script name is mport-configuration.sh
#!/bin/sh
host_ip=10.xx.xx.xx
token_file=tmp.txt
if [ ! "$1" = "" ]; then
host_ip=$1
fi
curl -X POST "http://${host_ip}:30020/cas/v1/configuration/auth" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"userName\": \"admin\", \"password\": \"Password\"}" --output ${token_file}
token=`cat ${token_file}`
token2=`echo ${token} | jq -r '.token'`
curl -X POST "http://${host_ip}:30020/cas/v1/configuration/import" -H "accept: application/json" -H "x-atmosphere-token: ${token2}" -H "Content-Type: multipart/form-data" -F "file=@/Users/tibco/BCCE/build/automation/BCCE-CONTAINER-QA.bcce-${host_ip}"
rm -f ${token_file}
.