How to create proxy without spec without using UI

Question: How to create a proxy without using a spec and without using the UI (i.e using managment api's or maven plugins)? I would like to create a reverse proxy without having a swagger, basically to act as a passthrough but want it to be an automated process, is this possible?

0 3 234
3 REPLIES 3

yes.

You can import and deploy an API Proxy via the documented APIs.

here's a quick screencast showing the curl commands to import and then deploy an API proxy. Import implies that you need a zip-encoded API Proxy bundle. The shape of it is like this:

apiproxy/
apiproxy/API-PROXY-NAME.xml
apiproxy/policies/
apiproxy/policies/POLICY-NAME-1.xml
apiproxy/policies/...
apiproxy/proxies/
apiproxy/proxies/PROXY-ENDPOINT-1.xml
apiproxy/targets/
apiproxy/proxies/TARGET-ENDPOINT-1.xml
apiproxy/resources/
apiproxy/resources/jsc/
apiproxy/resources/jsc/JAVASCRIPT-CODE-1.js
apiproxy/resources/...
 

The reference documentation for these API calls is here:
import
deploy

Hi Dino thanks for your reply! I now realize my question was not very clear. What I actually meant to ask if how to create the bundle in the first place without a spec? There exists a tool called openapi2apigee for taking a spec(swagger) and converting into an apigee bundle to be uploaded. I was wondering how to create this bundle without having a spec(swagger) to generate it from

Well I suppose you need a basic proxy bundle "template". Which you can generate by creating a passthrough proxy in the UI and downloading it as a zip. Then explode the zip, and ... use that set of files as the proxy bundle template.

Replace whatever you like (basepath probably. And also proxy name) and then you have a way to generate a proxy bundle.