Is there a way to extract all spike arrest values from the proxies via one of the mgt curls?

Not applicable

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 Solved
0 3 205
1 ACCEPTED SOLUTION

Not applicable

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 .

View solution in original post

3 REPLIES 3

Not applicable

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 .

Not applicable

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.