How to fetch list of endpoints under a proxy (Endpoint Flow Names, Method and Path/Condition).
Tried: .../v1/organizations/orgName/apis/appName/revisions/revisionNumber
But this giving proxyEndpoints and targetEndpoints as 'default' in json response.
Solved! Go to Solution.
If you are looking to query the flows of an API proxy, you need to include the /proxies/{proxy_endpoint_name} to the management API URI.
Keep in mind, conditions of flows are not exclusive to http method and URI paths -- conditions can be set on any arbitrary variable.
With that disclaimer, you can use this Management API to get this information:
https://api.enterprise.apigee.com/v1/organizations/{org_name}/apis/{api_name}/revisions/{revision_number}/proxies/{proxy_endpoint_name}
For instance, I can make a cURL command to this endpoint:
curl -H "Authorization: Basic {token}" https://api.enterprise.apigee.com/v1/o/myorg/apis/helloworld/revisions/1/proxies/default
This API will respond back with the following:
{
"connection" : {
"basePath" : "/helloworld",
"connectionType" : "httpConnection",
"virtualHost" : [ "default" ]
},
"connectionType" : "httpConnection",
"description" : "",
"faultRules" : [ ],
"flows" : [ {
"condition" : "(proxy.pathsuffix MatchesPath \"/pets\") and (request.verb = \"GET\")",
"description" : "Get list of pets",
"name" : "/pets (GET)",
"request" : {
"children" : [ ]
},
"response" : {
"children" : [ ]
}
}, {
"condition" : "(proxy.pathsuffix MatchesPath \"/pets\") and (request.verb = \"POST\")",
"description" : "Create a new pete",
"name" : "/pets (POST)",
"request" : {
"children" : [ ]
},
"response" : {
"children" : [ ]
}
}, {
"condition" : "(proxy.pathsuffix MatchesPath \"/pets\") and (request.verb = \"DELETE\")",
"description" : "Delete a pet from the collection",
"name" : "/pets (DELETE)",
"request" : {
"children" : [ ]
},
"response" : {
"children" : [ ]
}
} ]
...
}
Now, you can then parse the `condition` values to build a list of paths and verbs configured for this API proxy.
If you are looking to query the flows of an API proxy, you need to include the /proxies/{proxy_endpoint_name} to the management API URI.
Keep in mind, conditions of flows are not exclusive to http method and URI paths -- conditions can be set on any arbitrary variable.
With that disclaimer, you can use this Management API to get this information:
https://api.enterprise.apigee.com/v1/organizations/{org_name}/apis/{api_name}/revisions/{revision_number}/proxies/{proxy_endpoint_name}
For instance, I can make a cURL command to this endpoint:
curl -H "Authorization: Basic {token}" https://api.enterprise.apigee.com/v1/o/myorg/apis/helloworld/revisions/1/proxies/default
This API will respond back with the following:
{
"connection" : {
"basePath" : "/helloworld",
"connectionType" : "httpConnection",
"virtualHost" : [ "default" ]
},
"connectionType" : "httpConnection",
"description" : "",
"faultRules" : [ ],
"flows" : [ {
"condition" : "(proxy.pathsuffix MatchesPath \"/pets\") and (request.verb = \"GET\")",
"description" : "Get list of pets",
"name" : "/pets (GET)",
"request" : {
"children" : [ ]
},
"response" : {
"children" : [ ]
}
}, {
"condition" : "(proxy.pathsuffix MatchesPath \"/pets\") and (request.verb = \"POST\")",
"description" : "Create a new pete",
"name" : "/pets (POST)",
"request" : {
"children" : [ ]
},
"response" : {
"children" : [ ]
}
}, {
"condition" : "(proxy.pathsuffix MatchesPath \"/pets\") and (request.verb = \"DELETE\")",
"description" : "Delete a pet from the collection",
"name" : "/pets (DELETE)",
"request" : {
"children" : [ ]
},
"response" : {
"children" : [ ]
}
} ]
...
}
Now, you can then parse the `condition` values to build a list of paths and verbs configured for this API proxy.
it worked, thanks a lot.