Gateway's REST v1 and REST v2 clients provide access to the legacy
Address Manager Legacy v1 API and Address Manager RESTful
v2 APIs, respectively. Only one of the REST v1 or REST v2 clients can be configured to
be available on a single instance of Gateway. To change the
available version, you must set the bam_api_version
variable either in
the config.json
file (in the built-in or custom workspace), or as an
environment variable when starting the Gateway container. For more
details, see Setting the Address Manager REST API client version.
When each setting specifies different version numbers, it can be difficult to determine which REST API version will be available. In general, Gateway:
-
If the
BAM_API_VERSION
environment variable was specified when Gateway was started, Gateway will use that value. -
Otherwise, if the
bam_api_version
setting appears in theconfig.json
file in the custom workspace, Gateway will use that value. -
Otherwise, if the
bam_api_version
setting appears in theconfig.json
file in the built-in workspace, Gateway will use that value. -
Otherwise, Gateway will use the Legacy REST v1 client.
The table below illustrates the actual REST API Client version that's active under each scenario.
Setting | Scenarios | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
bam_api_version value in config.json file (Built-in
workspace) |
Not set | 1 | 2 | 2 | 2 | Not set | Not set | 1 | Not set | Not set |
bam_api_version value in config.json file (Custom
workspace) |
Not set | Not set | Not set | 1 | Not set | 1 | 2 | 1 | Not set | Not set |
BAM_API_VERSION environment variable |
Not set | Not set | Not set | Not set | 1 | Not set | 1 | 2 | 1 | 2 |
Actual active REST API version in Gateway | v1 | v1 | v2 | v1 | v1 | v1 | v1 | v2 | v1 | v1 |
For example, if:
- The
bam_api_version
value is not set at all in the config.json file in the built-in workspace; - The
bam_api_version
value is set to 2 in the config.json file in the custom workspace; and - The
BAM_API_VERSION
environment variable is set to 1 when Gateway was started,
Then Gateway will set the REST v1 client as active. That is, it will use the REST v1 API from Address Manager and provide the REST v1 client to Gateway workflows.