Bootstrap FreeKB - Broadcom API Gateway - List active or inactive policies and services using the Gateway Migration Utility
Broadcom API Gateway - List active or inactive policies and services using the Gateway Migration Utility

Updated:   |  Broadcom API Gateway articles

This assumes you are familiar with the basic usage of the Gateway Migration Utility that you are using an arguments file with an encoded password to connect to your API Gateway, and that you understand the basic usage of restman to view the XML of a policy or service.

 


List only enabled or disabled policies or services

You are probably already aware that you can view and change the status of a service using the Policy Manager.

 

Likewise, you are also probably familiar with how to spot a disabled policy in the Policy Manager.

 


Enabled services

The -query 'enabled=true' option will return only services that are enabled. 

/path/to/GatewayMigrationUtility.sh restman
-host apig.example.com
-port 8443
-username john.doe
-password f5VPX0yUJPg.m4BrjdgMv84UgktddJD3xA
-method GET
-path '1.0/services'
-query 'enabled=true'

 

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'
-query 'enabled=true'

 

In the XML, enabled services should have the following.

<l7:Enabled>true</l7:Enabled>

 

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'
-query 'enabled=true'
-response /path/to/example.xml

 


Disabled services

The -query 'enabled=false' option will return only services that are disabled.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/services'
-query 'enabled=true'

 

In the XML, disabled services should have the following.

<l7:Enabled>false</l7:Enabled>

 

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'
-query 'enabled=true'
-response /path/to/example.xml

 


Policies

I am not aware of an argument that can be used to determine if a policy is enabled or disabled. So, what I do instead is to just display the XML of the policy.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/policies/{policy id}'

 

In the XML, if the policy is enabled, LongValue will be an integer greater than 0.

<l7:LongValue>1</l7:LongValue>

 

In the XML, if the policy is disabled, LongValue will be 0.

<l7:LongValue>0</l7:LongValue>

 

Also, the Comment will be "Policy disabled" and there will be a FalseAssertion value.

<l7:Resource type="policy">
  <wsp:Policy>
    <wsp:All wsp:Usage="Required">
      <L7p:CommentAssertion>
        <L7p:Comment stringValue="Policy disabled"/>
      </L7p:CommentAssertion>
      <L7p:FalseAssertion/>
    </wsp:All>
  </wsp:Policy>
</l7:Resource>

 

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/policies/{policy id}'
-response /path/to/example.xml



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter c1604e in the box below so that we can be sure you are a human.