Skip to main content

Import an Apigee proxy bundle

An Apigee proxy bundle is a zip of apiproxy/ XML files: the proxy's endpoints, its target endpoints, the flows and conditions that route requests, and one file per policy. Apiome reads the bundle and records what the proxy serves and enforces.

What you can import​

You haveImport it as
A proxy bundle (.zip with apiproxy/<name>.xml, proxies/, targets/, policies/)One file
A single ProxyEndpoint or TargetEndpoint XML fileOne file
A proxy endpoint and the shared flow it callsOne archive with both files

Get the bundle​

Download a revision from Apigee, for example with the management API:

curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-o orders-v2.zip \
"https://apigee.googleapis.com/v1/organizations/my-org/apis/orders-v2/revisions/7?format=bundle"

In the Apigee console, open the proxy, choose Project → Download revision.

Import it​

Import the file like any other specification: in the import wizard, with apiome import, or through the REST API (see Import a specification). Apiome recognises the bundle and picks the Apigee proxy bundle importer (apigee). The API lands in the Catalog. To make it a Project, convert it to OpenAPI.

What Apiome reads​

In the bundleBecomes
A ProxyEndpoint and its HTTPProxyConnection base pathA service; the base path prefixes every route
A Flow whose condition names a path and a verbAn operation. MatchesPath "/orders/*" becomes /orders/{segment1}, ** becomes {path}, and a flow without a verb becomes ANY.
A TargetEndpointA server: its URL, or for a load balancer a URL template whose server variable lists the balanced servers
VerifyAPIKey, OAuthV2 (verify access token)The operation's security
SpikeArrest, QuotaRate limits
An AssignMessage that sets Access-Control-* headersCORS

Policies in the PreFlow and PostFlow apply to every operation; a flow's own policies apply to its operation. A policy that runs only under a condition keeps the condition. A FlowCallout into a shared flow brings in the shared flow's steps when the archive carries it.

Conditions that are not a path and a verb​

A condition is a boolean expression, so not every one can become a route. Apiome keeps each of these as a declared condition instead of dropping it:

  • a flow condition that tests a header, a variable or uses or / not. When part of it is a path and a verb, the operation is still created and the rest is attached to it;
  • a flow with no condition (it runs for every request);
  • a route rule whose condition is not a path and verb;
  • a route rule with no target endpoint: requests that match it never reach a backend.

Declared conditions, the ordered route rules, fault rules, policies Apiome does not interpret (kept verbatim) and steps whose policy file is missing are all listed in the import's coverage ledger.

When an import is refused​

Error codeWhy
INPUT_SEMANTIC_INVALIDThe bundle has no ProxyEndpoint, so it serves no route.
INPUT_REFERENCE_UNRESOLVEDA route rule names a target endpoint the bundle does not contain. A single proxy endpoint file is not checked, since its targets live elsewhere.
INPUT_ARCHIVE_INVALIDThe zip is cut off or unsafe.
FORMAT_MISMATCHThe file is not an Apigee bundle or endpoint file.
INPUT_MALFORMED, INPUT_TRUNCATED, INPUT_ENCODING_INVALIDThe XML is not well formed, is cut off, or is not UTF-8.