How to overwrite apiman.gateway-endpoint default property values in Apiman (1.3.1.Final)

340 views Asked by At

Environment

Distributor ID: Ubuntu

Description: Ubuntu 16.04.5 LTS

Release: 16.04

Codename: xenial

Bug

I'm using dockerized apiman version 1.3.1.Final. (Quite old I know...)

I'm trying to overwrite gateway properties for the apiman-default-config.json file :

"Gateways" : [ {
"id" : "TheGateway",
"name" : "The Gateway",
"description" : "This is the gateway.",
"createdBy" : "admin",
"createdOn" : "2016-05-16T12:34:15Z",
"modifiedBy" : "admin",
"modifiedOn" : "2016-05-16T12:34:15Z",
"type" : "REST",
"configuration" : "{\"endpoint\":\"${apiman.gateway-endpoint:https://localhost:8443/apiman-gateway-api}\",\"username\":\"${apiman.gateway-endpoint.username:apimanager}\",\"password\":\"${apiman.gateway-endpoint.password:apiman123!}\"}" } ]

So my thought is that I could overwrite those properties from apiman.properties configuration file. But it seems that, for example, property ${apiman.gateway-endpoint.username} isn't evaluated and use the default value 'apimanager' in any case.

So now, my question is how should be overwriten the following properties ? :

apiman.gateway-endpoint
apiman.gateway-endpoint.username
apiman.gateway-endpoint.password

If it's a bug, is it fix in later Apiman version ?

I could overwrite the entire file, but if I could avoid that, it would be great...

Regards

1

There are 1 answers

0
user3793803 On BEST ANSWER

After diving into Apiman code, I just found out that those variables are replaced by System.env properties. In order to override them, it's possible to add those lines after 'extensions' tag into the standalone-apiman.xml configuration that you are using to run apiman :

<system-properties>
       <property name="apiman.gateway-endpoint" value="http://apiman.gateway.com"/>
       <property name="apiman.gateway-endpoint.username" value="username"/>
       <property name="apiman.gateway-endpoint.password" value="password"/>
</system-properties>