This assumes you are familiar with the basic usage of the Gateway Migration Utility. Following is an example of how to list every service in an API Gateway.
/path/to/GatewayMigrationUtility.sh restman
-host apig.example.com
-port 8443
-username john.doe
-password f5VPX0yUJPg.m4BrjdgMv84UgktddJD3xA
-method GET
-path '1.0/services'
Or the -argFile option can be used, to reduce the number of options that are used on the command line.
/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services'
Or, a single service can be returned by including the service ID.
/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services/ed470defe8384b2fdfcb701c3623de7a'
Or, you can use the -query option to return a single service by including the name of the service.
/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services'
-query 'name=example'
versions can be included to return each version of the service.
/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services/ed470defe8384b2fdfcb701c3623de7a/versions'
Each version will have a unique ordinal number, such as 1 for version 1, 2 for version 2, et cetera.
<l7:ordinal>1</l7:ordinal>
The ordinal number can be used to return a specific version of the service.
/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services/ed470defe8384b2fdfcb701c3623de7a/versions/2'
The -response option can be used to output the XML to a file.
/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services/ed470defe8384b2fdfcb701c3623de7a'
-response /path/to/myService.xml
Something like this should be returned.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:List xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>SERVICE List</l7:Name>
<l7:Type>List</l7:Type>
<l7:TimeStamp>2020-08-29T21:13:52.094-05:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://api.example.com:8443/restman/1.0/services?name=myService"/>
<l7:Link rel="template" uri="https://api.example.com:8443/restman/1.0/services/template"/>
<l7:Item>
<l7:Name>myService</l7:Name>
<l7:Id>ed470defe8384b2fdfcb701c3623de7a</l7:Id>
<l7:Type>SERVICE</l7:Type>
<l7:TimeStamp>2020-08-29T21:13:52.094-05:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://api.example.com:8443/restman/1.0/services/ed470defe8384b2fdfcb701c3623de7a"/>
<l7:Resource>
<l7:Service id="ed470defe8384b2fdfcb701c3623de7a" version="2">
<l7:ServiceDetail folderId="0000000000000000ffffffffffffec76" id="ed470defe8384b2fdfcb701c3623de7a" version="2">
<l7:Name>myService</l7:Name>
<l7:Enabled>true</l7:Enabled>
<l7:ServiceMappings>
<l7:HttpMapping>
<l7:UrlPattern>/example</l7:UrlPattern>
<l7:Verbs>
<l7:Verb>GET</l7:Verb>
<l7:Verb>POST</l7:Verb>
<l7:Verb>PUT</l7:Verb>
<l7:Verb>DELETE</l7:Verb>
</l7:Verbs>
</l7:HttpMapping>
</l7:ServiceMappings>
<l7:Properties>
<l7:Property key="internal">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="policyRevision">
<l7:LongValue>14</l7:LongValue>
</l7:Property>
<l7:Property key="soap">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="tracingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
<l7:Property key="wssProcessingEnabled">
<l7:BooleanValue>false</l7:BooleanValue>
</l7:Property>
</l7:Properties>
</l7:ServiceDetail>
<l7:Resources>
</l7:Resources>
</l7:Service>
</l7:Resource>
</l7:Item>
</l7:List>
Did you find this article helpful?
If so, consider buying me a coffee over at