List Endpoint Flow or Path/Condition for a Given Proxy

Hello,

I'm wondering if anyone is aware of some management api that will capture the call flows for a given proxy. Say I have a proxy called MUSIC, and flownames like "getBandDetails" or "getAlbumTracks" where Condition/Path would be like "/bandname" or "/albumname" respectively.

Something where you could call v1/organizations/ORGNAME/apis/PROXYNAME and output would be like

"path/condition"

: [ "/bandname", "/albumname",]

It's all there in the Proxy overview in the UI, but would love to be able to call for those details via api.

Thanks!

Solved Solved
1 3 813
1 ACCEPTED SOLUTION

There's an API for that.

A few things to know...

  1. The thing you want is the "flows" property on the API Proxy endpoint.
  2. the "apis" in the mgmt API resource hierarchy refers to "API proxy bundles". Within a revision of each api proxy bundle, there will be one or more proxy endpoints. Most people have a single api proxy endpoint in a proxy bundle, but that's not required.
  3. in the mgmt API hierarchy, to address a "proxy endpoint" you use the path segment "proxies"
  4. of course you need to examine a specific revision, because the flows can change from one rev to another.

So,

curl  -n $mgmtserver/v1/o/$ORG/apis/$API/revisions/1/proxies/$PROXYENDPOINTNAME

The name of the proxyendpoint is often "default" but again, this is not required. To list the proxyendpoints in a proxy bundle, use

curl  -n $mgmtserver/v1/o/$ORG/apis/$API/revisions/1/proxies

From the former query, you will get output like:

{
  "name": "getBandDetails",
  "condition": "(proxy.pathsuffix MatchesPath \"/band\") and (request.verb = \"GET\")",
  "description": "get details for a band",
  "request": {
    "children": [ ... policies on the request flow here... ]
  },
  "response": {
    "children": [ ...policies on the response flow here... ]
  }
}

You can ask for the result in XML format, too. Just pass the Accept header.

View solution in original post

3 REPLIES 3

There's an API for that.

A few things to know...

  1. The thing you want is the "flows" property on the API Proxy endpoint.
  2. the "apis" in the mgmt API resource hierarchy refers to "API proxy bundles". Within a revision of each api proxy bundle, there will be one or more proxy endpoints. Most people have a single api proxy endpoint in a proxy bundle, but that's not required.
  3. in the mgmt API hierarchy, to address a "proxy endpoint" you use the path segment "proxies"
  4. of course you need to examine a specific revision, because the flows can change from one rev to another.

So,

curl  -n $mgmtserver/v1/o/$ORG/apis/$API/revisions/1/proxies/$PROXYENDPOINTNAME

The name of the proxyendpoint is often "default" but again, this is not required. To list the proxyendpoints in a proxy bundle, use

curl  -n $mgmtserver/v1/o/$ORG/apis/$API/revisions/1/proxies

From the former query, you will get output like:

{
  "name": "getBandDetails",
  "condition": "(proxy.pathsuffix MatchesPath \"/band\") and (request.verb = \"GET\")",
  "description": "get details for a band",
  "request": {
    "children": [ ... policies on the request flow here... ]
  },
  "response": {
    "children": [ ...policies on the response flow here... ]
  }
}

You can ask for the result in XML format, too. Just pass the Accept header.

Thank you!

Hi,

Are these API calls documented any where, as I couldn't find them under https://apidocs.apigee.com/api-reference/content/api-proxies