webMethods Microgateway Help 10.3 | webMethods Microgateway Help | Asset and Configuration Provisioning | Asset provisioning
 
Asset provisioning
Provisioning assets in Microgateway makes assets available for use in Microgateway. The assets you can provision in Microgateway are, APIs including policies and policy properties, runtime aliases, applications, and global policies.
Note: Microgateway only supports the REST APIs and do not support the SOAP and OData APIs.
Asset provisioning in Microgateway covers the following:
*Reading APIs, policies and applications from API Gateway on Microgateway start
*Updating APIs and policies from API Gateway
*Updating Applications from API Gateway
*Reading APIs, policies, and applications from a file system by exporting an archive
*Reading administrative settings from API Gateway
You can provision assets to a Microgateway in one of the following ways:
*API Gateway export archive-based provisioning
*Pulling assets from API Gateway
Microgateway also supports a mixed provisioning. If case of same API names the API Gateway archives are preferred over the assets being pulled from API Gateway.
Asset Provisioning through API Gateway Export Archive
You can start the Microgateway server with one or more API Gateway export archives that contain the assets to be provisioned. Microgateway supports export archives of version 10.3 or higher. All the supported assets are imported during Microgateway startup.
You can pass on the API Gateway export archive in the start command through the archive parameter:
microgateway.cmd start -p 9090 --archive apigw_archive.zip
You can specify multiple archives using a comma separated list. Ensure that there is no space within the comma separated list.
microgateway.cmd start -p 9090
--archive apigw_archive1.zip,apigw_archive2.zip
The Microgateway reads the archives in the specified order. If there are any assets provisioned by an earlier archive, they are overwritten by the assets present in the later archives.
Creating API Gateway Archives using Command Line
You can use the createAssetArchive command that Microgateway CLI provides for reading an archive. The command has the following parameters:
*api_gateway: API Gateway url
*api_gateway_user: API Gateway user
*api_gateway_password: API Gateway password
*apis: List of APIs, comma separated, specified using name, identifier or name and version combination (name and version are separated using /). You can use the wildcard character * for API name.
*policies: List of global policies, comma separated, specified using name or identifier
*applications: List of global applications, comma separated, specified using name or identifier.
*archive: Archive to create.
A Sample workflow for Asset Provisioning using import package
A sample sequence for asset provisioning by using import package looks as follows. A sample archive BayernAndEmployeeService.zip is used to describe the example.
1. Start API Gateway with given archive BayernAndEmployeeService.zip
microgateway.bat start -p 9090 -a
"C:\Users\tfi\Work\API-Gateway\ExportArchives\10.3\BayernAndEmployeeService.zip"
2. Check status.
GET http://localhost:9090/rest/microgateway/status
The status response looks like this:
{
"description": "webMethods Microgateway",
"publisher": "Software AG",
"version": ""
}
3. For fetching details about the deployed APIs, applications and global policies send the following request.
GET http://localhost:9090/rest/microgateway/assets
The details show the provisioned APIs.
4. Invoke the Employee API.
GET http://localhost:9090/gateway/EmployeeService/employees
5. Stop the Microgateway listening on port 9090.
microgateway.bat stop -p 9090
Pulling Assets from API Gateway
You can start the Microgateway server with a URL and credentials pointing to an API Gateway. Microgateway pulls the assets from the referenced API Gateway.
Microgateway can only pull assets from API Gateways with version 10.3 or higher. Multiple Microgateways can pull assets from the same API Gateway. To pull assets from API Gateway, Microgateway start command offers the following options:
*api_gateway: API Gateway url
*api_gateway_user:API Gateway user
*api_gateway_password: API Gateway password
*apis: List of APIs, comma separated, specified using name, identifier or name and version combination (name and version are separated using /). You can use the wildcard character * for API name.
*policies: List of global policies, comma separated, specified using name or identifier
*applications: List of global applications, comma separated, specified using name, identifier or name and version combination (name and version are separated using /)
Connecting to API Gateway
Microgateway connects to the API Gateway during startup. If the API Gateway can't be contacted, then Microgateway terminates with an error message as follows:
Can't connect to API Gateway, going down ...
Host not reachable.
Please check your Microgateway configuration.
Pulling Specific Assets
An API, policy or application is identified either using its unique identifier or by the combination of name and version. If an asset name or identifier can't be resolved, a respective error message is written to the Microgateway log.
For an identified API, the API along with the API-level policies and policy properties, registered applications, and referenced runtime aliases are pulled from API Gateway.
For an identified global policy, the policy, the policy properties, and referenced runtime aliases are pulled from API Gateway.
For an identified global application, only the application is pulled. For runtime aliases, the default values become effective.
Pulling All Assets
If you do not specify an API, application or policy, then no assets are pulled from the API Gateway.
*If an API has a unsupported policy, the provisioning of the API is rejected.
*If a global policy references an unsupported policy, then import of the global policy is rejected.
*When provisioning runtime aliases the default values become effective.
A Sample workflow for Asset Provisioning by pulling API Gateway
A sample sequence for asset provisioning by pulling API Gateway looks as follows. A sample imported file BayernAndEmployeeService.zip is used to describe the example.
1. Start an API Gateway and import the BayernAndEmployeeService.zip. The import results into 2 APIs - EmployeeService and BayernRest
2. Start Microgateway with given a API Gateway URL and API name.
microgateway.bat start -p 9090
-gw http://localhost:5555/rest/apigateway -gwu Administrator -gwp manage
-apis EmployeeService
3. Check deployed assets .
GET http://localhost:9090/rest/microgateway/assets
4. Calling API.
GET http://localhost:9090/gateway/EmployeeService/employees
5. Stop the Microgateway listening on port 9090 .
microgateway.bat stop -p 9090
6. Start Microgateway with given a API Gateway URL with and multiple API names .
microgateway.bat start -p 9090
-gw http://localhost:5555/rest/apigateway -gwu Administrator
-gwp manage -apis EmployeeService,BayernRest

Copyright © 2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.