Erstellen Sie einen Proxy in der Apigee-Benutzeroberfläche oder mithilfe der API, wie in den folgenden Abschnitten beschrieben.
Primärfelder für API-Proxys
Beachten Sie beim Erstellen eines API-Proxys die folgenden Richtlinien:
Feld
Beschreibung
Name des API-Proxys
Für Ihre API angezeigter Name. Geben Sie alphanumerische Zeichen, einen Bindestrich (-) oder Unterstrich (_) ein.
Basispfad des API-Proxys
URI-Fragment, das nach der Adresse http://[host] oder https://[host] des API-Proxys angezeigt wird. Apigee verwendet den Basispfad-URI, um eingehende Anfragenachrichten mit dem passenden API-Proxy abzugleichen und zu diesem weiterzuleiten.
Platzhalter in Basispfaden verwenden
Verwenden Sie einen oder mehrere Platzhalter in API-Proxy-Basispfaden, um Ihre API-Proxys zukunftssicher zu machen.
Wir erlauben die Angabe eines einzelnen Platzhalterzeichens * zwischen zwei Schrägstrichen /: /*/.
Mit dem Basispfad /team/*/members können Clients beispielsweise https://[host]/team/blue/members und https://[host]/team/green/members aufrufen, ohne neue API-Proxys für die Unterstützung neuer Teams erstellen zu müssen.
Sie können eine beliebige Anzahl von Tokens im Basispfad nach diesem Muster ersetzen.
Andere Muster, einschließlich /**, /something* oder /*something, werden nicht unterstützt.
Beschreibung
Optional: Eine Beschreibung des API-Proxys.
Ziel-URL/Backend-Ziel-URL
URL (einschließlich HTTP oder HTTPS) des Back-End-Dienstes, der von diesem API-Proxy aufgerufen wird.
Weltraum
(Optional) Wenn in Ihrer Organisation Apigee Spaces aktiviert ist, können Sie den API-Proxy einem Space zuordnen.
Weitere Informationen finden Sie unter Apigee Spaces-Übersicht.
Schritte zum Erstellen eines API-Proxys
So erstellen Sie einen API-Proxy über die Benutzeroberfläche oder APIs:
Apigee in der Cloud Console
So erstellen Sie einen Proxy in Apigee in der Cloud Console:
Rufen Sie in der Google Cloud -Konsole die Seite Proxy-Entwicklung > API-Proxys auf.
Klicken Sie im Bereich API-Proxys auf + Erstellen.
Wählen Sie im Bereich Proxy erstellen unter Proxy-Vorlage die Option Reverse-Proxy (häufigste Quelle) aus.
Geben Sie unter Proxydetails Folgendes ein:
Proxyname: Geben Sie einen Namen für den Proxy ein, z. B. myproxy.
Basispfad: Wird automatisch auf den Wert festgelegt, den Sie für Proxy name eingeben. Der Basispfad ist Teil der URL, die zum Senden von Anfragen an Ihre API verwendet wird. Apigee verwendet die URL, um eingehende Anfragen zuzuordnen und an den richtigen API-Proxy weiterzuleiten.
Beschreibung (Optional): Geben Sie eine Beschreibung für den neuen API-Proxy ein, z. B. „Apigee mit einem einfachen Proxy testen“.
Ziel (vorhandene API): Geben Sie https://mocktarget.apigee.net ein.
Dies definiert die Ziel-URL, die Apigee für eine Anfrage an den API-Proxy aufruft. Der simulierte Zieldienst wird bei Apigee gehostet und gibt einfache Daten zurück. Ein API-Schlüssel oder ein Zugriffstoken sind nicht erforderlich.
Space (optional): Wenn Apigee Spaces für Ihre Organisation aktiviert ist, können Sie den API-Proxy einem Space zuordnen, der aus der Liste der verfügbaren Optionen ausgewählt wird.
Weitere Informationen finden Sie unter Apigee Spaces-Übersicht.
Klicken Sie auf Weiter.
Bereitstellen (optional):
Bereitstellungsumgebungen: Optional. Wählen Sie durch die Kästchen eine oder mehrere Umgebungen aus, in denen Sie Ihren Proxy bereitstellen möchten. Wenn Sie den Proxy zu diesem Zeitpunkt nicht bereitstellen möchten, lassen Sie das Feld Bereitstellungsumgebungen leer. Sie können den Proxy später jederzeit bereitstellen.
Dienstkonto: (optional) Hängen Sie ein Dienstkonto an Ihre Bereitstellung an, damit der Proxy auf Google Cloud -Dienste zugreifen kann, wie in der Rolle und den Berechtigungen des Dienstkontos angegeben.
Klicken Sie auf Erstellen.
Apigee erstellt den neuen Proxy und zeigt eine Zusammenfassung der Proxydetails in der Ansicht Proxy-Zusammenfassung an.
Wenn Sie den Proxy bereitstellen, wird im Abschnitt Bereitstellungen die Nummer der Überarbeitung angezeigt, die 1 ist, wenn Sie das erste Mal bereitstellen. In der Spalte Status werden mit einer grünen Statusanzeige die Umgebungen angezeigt, in denen der Proxy bereitgestellt wird.
Klassisches Apigee
So erstellen Sie einen einfachen API-Proxy in der klassischen Apigee-Benutzeroberfläche:
Wählen Sie in der Drop-down-Liste Umgebung die Umgebung aus, in der Sie einen neuen API-Proxy erstellen möchten.
Die Hybrid-Benutzeroberfläche zeigt eine Liste der API-Proxys für diese Umgebung an. Wenn Sie noch keine Proxys erstellt haben, ist die Liste leer.
Klicken Sie auf Neu erstellen.
Der Assistent zum Erstellen von Proxys wird gestartet.
Klicken Sie auf Proxy umkehren (am häufigsten).
Die Seite Proxy-Details wird angezeigt.
Konfigurieren Sie den Proxy mit den folgenden Einstellungen:
Name: Geben Sie getstarted ein. Wenn bereits ein Proxy mit diesem Namen vorhanden ist, wählen Sie einen anderen Namen.
Basispfad: Behalten Sie die Einstellung /getstarted bei. Der Basispfad ist Teil der URL, die zum Senden von Anfragen an Ihre API verwendet wird. Apigee verwendet die URL, um eingehende Anfragen zuzuordnen und an den richtigen API-Proxy weiterzuleiten.
Beschreibung (optional): Geben Sie eine Beschreibung für Ihren neuen API-Proxy ein, z. B. Get started API proxy.
Ziel (vorhandene API): Geben Sie https://mocktarget.apigee.net ein. Dies definiert die Ziel-URL, die Apigee für eine Anfrage an den API-Proxy aufruft. Der simulierte Zieldienst wird bei Apigee gehostet und gibt einfache Daten zurück. Ein API-Schlüssel oder ein Zugriffstoken sind nicht erforderlich.
Die Details Ihres API-Proxys sollten so aussehen:
Klicken Sie auf Weiter.
Wählen Sie in der Ansicht Allgemeine Richtlinien unter Sicherheit: Autorisierung die Option Passthrough (keine Autorisierung) aus.
Klicken Sie auf Weiter.
Wählen Sie auf der Seite Zusammenfassung die gewünschte Umgebung aus und klicken Sie auf Erstellen und bereitstellen.
Der neue API-Proxy wird erstellt und in der ausgewählten Umgebung bereitgestellt.
Klicken Sie auf Proxy bearbeiten, um den Tab "Übersicht" im Proxy-Editor aufzurufen.
In der Liste der API-Proxys ist der Bereitstellungsstatus des API-Proxys getstarted für die Umgebung testgrün.
Apigee API
Erstellen Sie einen API-Proxy in Ihrer Apigee-Organisation, indem Sie eine POST-Anfrage an die folgende Ressource senden:
Sie müssen den Namen des API-Proxys mit dem Abfrageparameter name definieren. Die im Namen verwendeten Zeichen sollten auf folgende begrenzt sein: A-Za-z0-9._\-$ %
Optional können Sie ein API-Proxy-Konfigurationsset mit den folgenden Schritten importieren:
Setzen Sie den Abfrageparameter action auf import.
Setzen Sie den Content-type-Header auf multipart/form-data.
Übergeben Sie den Namen des API-Proxy-Konfigurationssets auf Ihrem lokalen Dateisystem.
Das folgende Beispiel zeigt, wie Sie einen API-Proxy erstellen, indem Sie mithilfe der API ein API-Proxy-Konfigurations-Bundle (helloworld-config.zip) in Ihr lokales Dateisystem importieren.
Weitere Informationen zum Erstellen eines API-Proxys finden Sie in der Apigee API unter der Methode apis.create. Alle für API-Proxys verfügbaren Methoden finden Sie unter API Proxies API.
Nächste Schritte
Nachdem Sie einen einfachen API-Proxy erstellt haben, führen Sie in der Regel einen der folgenden Schritte aus:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-05 (UTC)."],[[["\u003cp\u003eThis page outlines the process of creating API proxies in Apigee and Apigee hybrid, which includes instructions for using the Apigee UI, API, and Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating an API proxy, key fields include the proxy name, which must be unique within the organization and consist of alphanumeric characters, dashes, or underscores, and the base path, which defines the URI for routing incoming requests, and must also be unique.\u003c/p\u003e\n"],["\u003cp\u003eWildcards (\u003ccode\u003e/*/\u003c/code\u003e) can be used in API proxy base paths to allow flexibility for future expansions without creating new API proxies, such as \u003ccode\u003ehttps://[host]/team/blue/members\u003c/code\u003e and \u003ccode\u003ehttps://[host]/team/green/members\u003c/code\u003e from basepath \u003ccode\u003e/team/*/members\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAPI proxies can be created through the Apigee UI in the Cloud console or the classic Apigee UI, and by sending a POST request to the Apigee API, offering flexibility in proxy creation methods.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating a simple API proxy, you can add policies, security, and other features of the Apigee platform, as well as deploy it to your cluster.\u003c/p\u003e\n"]]],[],null,["# Creating an API proxy\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n| **Note:** In environments enabled for [archive deployments](/apigee/docs/api-platform/fundamentals/environments-overview#deployment-types), you cannot develop API proxies using the Apigee UI, API, or gcloud. To develop API proxies for archive deployments using Apigee in VS Code,see [Developing API proxies](/apigee/docs/api-platform/local-development/vscode/develop-apiproxies) using Apigee in VS Code.\n\nCreate a proxy in the Apigee UI, or using the API, as described in the following sections.\n\nAPI proxy primary fields\n------------------------\n\nFollow these guidelines when creating an API proxy:\n\nSteps to create an API proxy\n----------------------------\n\nTo create an API proxy using the UI or APIs: \n\n### Apigee in Cloud console\n\nTo create a proxy in Apigee in Cloud console:\n\n1. In the Google Cloud console, go to the **Proxy development \\\u003e API proxies** page.\n\n [Go to API proxies](https://console.cloud.google.com/apigee/proxies)\n| **Note:** If you see the **Welcome to Apigee API Management** page, you need to [provision\n| your Apigee organization](/apigee/docs/api-platform/get-started/provisioning-intro) before proceeding further.\n|\n| \u003cbr /\u003e\n|\n| After you have provisioned Apigee, close the UI and reopen the\n| [Apigee UI in Cloud console](https://console.cloud.google.com/apigee).\n2. In the **API Proxies** pane, click **+ Create**.\n3. In the **Create a proxy** pane, under **Proxy template** , select **Reverse proxy (Most common)**.\n4. Under **Proxy details** , enter the following:\n - **Proxy name:** Enter a name for the proxy, such as `myproxy`.\n - **Base Path** : Automatically set to the value you enter for `Proxy name`. The **Base\n Path** is part of the URL used to make requests to your API. Apigee uses the URL to match and route incoming requests to the appropriate API proxy.\n - **Description (Optional)**: Enter a description for your new API proxy, such as \"Testing Apigee with a simple proxy.\"\n - **Target (Existing API):** Enter `https://mocktarget.apigee.net`. This defines the target URL that Apigee invokes on a request to the API proxy. The mocktarget service is hosted at Apigee and returns simple data. It requires no API key or access token.\n - **Space (Optional)** : If your organization has Apigee Spaces enabled, you can associate the API proxy with a Space selected from the list of available options. For more information, see [Apigee Spaces overview](/apigee/docs/api-platform/system-administration/spaces/apigee-spaces-overview).\n - Click **Next**.\n5. **Deploy (optional)** :\n - **Deployment environments** : Optional. Use the checkboxes to select one or more environments in which to deploy your proxy. If you prefer not to deploy the proxy at this point, leave the **Deployment environments** field empty. You can always deploy the proxy later.\n - **Service Account**: Optional. Attach a service account to your deployment to enable your proxy to access Google Cloud services, as specified in the service account's role and permissions.\n6. Click **Create**.\n\nApigee creates the new proxy and displays a summary of the proxy details in the\n**Proxy summary** view.\n\nIf you choose to deploy the proxy, the **Deployments** section displays the **Revision**\nnumber, which is 1 when you first deploy. The **Status** column displays the\nenvironments in which the proxy is deployed with a green status indicator.\n\n### Classic Apigee\n\nTo create a simple API proxy in the classic Apigee UI:\n\n1. Sign in to the [Apigee UI](https://apigee.google.com).\n2. Click **API Proxies** in the main view.\n3. From the **Environment** drop-down list, select the environment in which you want to create a new API proxy.\n\n The hybrid UI displays a list of API proxies for that environment. If you haven't created any\n proxies yet, the list is empty.\n4. Click **Create New** .\n\n The Create Proxy wizard starts.\n5. Click **Reverse proxy (most common)** .\n\n The **Proxy details** page is displayed.\n6. Configure your proxy with the following settings:\n - **Name:** Enter `getstarted`. If a proxy already exists with this name, choose a different name.\n - **Base Path:** Leave this set to `/getstarted`. The **Base\n Path** is part of the URL used to make requests to your API. Apigee uses the URL to match and route incoming requests to the appropriate API proxy.\n - **Description** (Optional): Enter a description for your new API proxy, such as `Get started API proxy`.\n - **Target (Existing API):** Enter `https://mocktarget.apigee.net`. This defines the target URL that Apigee invokes on a request to the API proxy. The mocktarget service is hosted at Apigee and returns simple data. It requires no API key or access token.\n\n Your API proxy's details should look like the following:\n\n7. Click **Next**.\n8. In the **Common policies** view, under **Security:\n Authorization** select **Pass through (no authorization)** .\n\n9. Click **Next**.\n10. On the **Summary** page, select the deployment environments, if desired, and click **Create and deploy** .\n\n | **Note:** If you don't select an environment below **Optional Deployment** , the button at the lower right is just labeled **Create**.\n | **Note:** After you deploy an API proxy revision, you cannot edit it. To edit the API proxy, you must create and deploy a new revision.\n |\n | For this reason, you may choose to create the API proxy without deploying it to any\n | environment. You can edit the API proxy and deploy the API proxy later, as described in\n | [Next steps](#next-steps).\n\n Your new API proxy is created\n and deployed in the selected environment.\n\n11. Click **Edit proxy** to display the Overview tab in the Proxy Editor.\n12. \n\n\nIn the API proxies list, the `getstarted` API proxy deployment status is **green** for the `test` environment.\n\n### Apigee API\n\nCreate an API proxy in your Apigee organization by issuing a `POST`\nrequest to the following resource: \n\n```\nhttps://apigee.googleapis.com/v1/organizations/$ORG/apis\n```\n\nYou must define the name of the API proxy using the `name` query parameter. Restrict\nthe characters used in the name to the following: `A-Za-z0-9._\\-$ %`\n\nOptionally, you can import an API proxy configuration bundle by performing the following steps:\n\n- Set the `action` query parameter to `import`\n- Set the `Content-type` header to `multipart/form-data`\n- Pass the name of the API proxy configuration bundle on your local file system\n\nThe following example demonstrates how to create an API proxy by importing an API proxy\nconfiguration bundle (`helloworld-config.zip`) on your local file system using the\nAPI. \n\n```\ncurl \"https://apigee.googleapis.com/v1/organizations/$ORG/apis?name=helloworld&action=import\" \\\n -X POST \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H \"Content-type: multipart/form-data\" \\\n -F \"file=@helloworld-config.zip\"\n```\n\nWhere `$TOKEN` is set to your OAuth 2.0 access token, as described in\n[Obtaining an OAuth 2.0 access token](/apigee/docs/api-platform/get-started/api-get-started#oauth20). For information about the `curl` options used in this example, see\n[Using curl](/apigee/docs/api-platform/get-started/api-get-started#curl). For a description of environment variables you can use, see\n[Setting\nenvironment variables for Apigee API requests](/apigee/docs/api-platform/get-started/api-get-started#api-environment-variables).\n\nThe following provides an example of the response output: \n\n```carbon\n{\n \"basepaths\": [\n \"/helloworld\"\n ],\n \"configurationVersion\": {\n \"majorVersion\": 4\n },\n \"createdAt\": \"1559145292799\",\n \"displayName\": \"helloworld\",\n \"entityMetaDataAsProperties\": {\n \"bundle_type\": \"zip\",\n \"subType\": \"Proxy\",\n \"lastModifiedAt\": \"1559145292799\",\n \"createdAt\": \"1559145292799\"\n },\n \"lastModifiedAt\": \"1559145292799\",\n \"name\": \"helloworld\",\n \"policies\": [\n \"verify-api-key\",\n \"remove-query-param-apikey\",\n \"OAuth-v20-1\"\n ],\n \"proxies\": [\n \"default\"\n ],\n \"proxyEndpoints\": [\n \"default\"\n ],\n \"resourceFiles\": {},\n \"targetEndpoints\": [\n \"default\"\n ],\n \"targets\": [\n \"default\"\n ],\n \"type\": \"Application\",\n \"revision\": \"1\",\n \"description\": \"Hello world\"\n}\n```\n\nFor more information on creating an API proxy, see the [`apis.create` method](/apigee/docs/reference/apis/apigee/rest/v1/organizations.apis/create)\nin the Apigee API. To see all the methods available for API proxies, see the [API proxies API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.apis).\n\nNext steps\n----------\n\nAfter you create a simple API proxy, you typically do one of the following:\n\n- Add policies, security, and other features of the Apigee platform, as described in [Understanding APIs and\n API proxies](/apigee/docs/api-platform/fundamentals/understanding-apis-and-api-proxies).\n- Deploy it to your cluster, as described in [Deploy an API proxy](/apigee/docs/api-platform/deploy/ui-deploy-new)."]]