Looking for a way to script the extract all of our spike arrest values set in numerous apis without having to go into each proxy manually via the Mgt UI.
Solved! Go to Solution.
Hi @Ted Zahner , You can use the management API to get the whole policy
for example :
curl -v http://managementip:8080/v1/o/$orgname/apis/$apiproxy/revisions/1/policies/SpikeArrestPolicy
and do a XPath and get the allow values .
Hi @Ted Zahner , You can use the management API to get the whole policy
for example :
curl -v http://managementip:8080/v1/o/$orgname/apis/$apiproxy/revisions/1/policies/SpikeArrestPolicy
and do a XPath and get the allow values .
Thanks Maruti for your guidance as always.
The short script that was developed did the following:
Extract all proxies
curl --silent http://localhost:8080/v1/o/<org>/apis
For each proxy, find latest revision
curl --silent http://localhost:8080/v1/o/<org>/apis/$proxy
Get the last revision from the response
For each proxy/revision, find all policies
curl --silent http://localhost:8080/v1/o/<org>/apis/$proxy/revisions/$revision/policies
For a each proxy, revision, policy, list policy contents:
curl --silent http://localhost:8080/v1/o/<org>/apis/$proxy/revisions/$rev/policies/$policy
Look for "policyType" : "SpikeArrest". If this is found, then get the "value" element ("value" : "10ps")
@Ted Zahner glad you were able to resolve your problem so quickly. Do you mind sharing the script with the community? I'm sure this community would appreciate and can reuse it in the future.
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |