Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
API-Dienste verwenden normalerweise .proto-Dateien, um die API-Oberfläche zu definieren, und .yaml-Dateien, um den API-Dienst zu konfigurieren. Jeder API-Dienst muss über ein API-Verzeichnis in einem API-Repository verfügen. Das API-Verzeichnis sollte alle API-Definitionsdateien und Build-Skripts enthalten.
Jedes API-Verzeichnis muss das folgende Standardlayout haben:
API-Verzeichnis
Repository-Voraussetzungen
BUILD: Die Build-Datei.
METADATA: Die Build-Metadatendatei.
OWNERS: Der Inhaber des API-Verzeichnisses.
README.md: Die allgemeinen Informationen zum API-Dienst.
Konfigurationsdateien
{service}.yaml - Die Baseline-Dienstkonfigurationsdatei, wobei es sich um die YAML-Darstellung der Proto-Nachricht google.api.Service handelt.
prod.yaml - Die Prod-Konfigurationsdatei für den Deltadienst.
staging.yaml - Die Staging-Konfigurationsdatei für den Deltadienst.
test.yaml - Die Test-Konfigurationsdatei für den Deltadienst.
local.yaml - Die Konfigurationsdatei des lokalen Deltadienstes.
Dokumentationsdateien
doc/* - Die Dateien mit der technischen Dokumentation. Sie sollten im Markdown-Format geschrieben sein.
Schnittstellendefinitionen
v[0-9]*/* - Jedes dieser Verzeichnisse enthält eine Hauptversion der API, im wesentlichen die Protodateien und Build-Skripte.
{subapi}/v[0-9]*/* - Jedes {subapi} - Verzeichnis enthält die Schnittstellendefinition einer Unter-API. Jede Unter-API kann über eine eigene unabhängige Hauptversion verfügen.
type/* - Protokolldateien mit Typen, die von verschiedenen APIs, verschiedenen Versionen derselben API oder zwischen der API und der Dienstimplementierung gemeinsam genutzt werden. Die Typdefinitionen unter type/*sollten nach der Veröffentlichung keine wichtigen Änderungen aufweisen.
Öffentliche Google API-Definitionen sind auf GitHub unter Google APIs-Repository veröffentlicht.
[[["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-04 (UTC)."],[[["\u003cp\u003eAPI services utilize \u003ccode\u003e.proto\u003c/code\u003e files for API definition and \u003ccode\u003e.yaml\u003c/code\u003e files for service configuration.\u003c/p\u003e\n"],["\u003cp\u003eEach API service must reside in an API directory within an API repository, containing all definition files and build scripts.\u003c/p\u003e\n"],["\u003cp\u003eAn API directory should follow a standard layout including repository prerequisites, configuration files, documentation files, and interface definitions, like versioned sub-API directories, and type files for shared proto files.\u003c/p\u003e\n"],["\u003cp\u003ePublic Google API definitions are available on the \u003ca href=\"https://github.com/googleapis/googleapis\"\u003eGoogle APIs\u003c/a\u003e GitHub repository, as seen with the \u003ca href=\"https://github.com/googleapis/googleapis/tree/master/google/example/endpointsapis\"\u003eService Infrastructure Example API\u003c/a\u003e.\u003c/p\u003e\n"]]],[],null,["# Directory structure\n\nAPI services typically use `.proto` files to define the API surface and\n`.yaml` files to configure the API service. Each API service **must** have\nan API directory inside an API repository. The API directory **should**\ncontain all API definition files and build scripts.\n\nEach API directory **should** have the following standard layout:\n\n- API directory\n\n - Repository prerequisites\n\n - `BUILD` - The build file.\n - `METADATA` - The build metadata file.\n - `OWNERS` - The API directory owners.\n - `README.md` - The general information about the API service.\n - Configuration files\n\n - `{service}.yaml` - The baseline service config file, which is the YAML representation of the `google.api.Service` proto message.\n - `prod.yaml` - The prod delta service config file.\n - `staging.yaml` - The staging delta service config file.\n - `test.yaml` - The test delta service config file.\n - `local.yaml` - The local delta service config file.\n - Documentation files\n\n - `doc/*` - The technical documentation files. They should be in Markdown format.\n - Interface definitions\n\n - `v[0-9]*/*` - Each such directory contains a major version of the API, mainly the proto files and build scripts.\n - `{subapi}/v[0-9]*/*` - Each `{subapi}` directory contains interface definition of a sub-API. Each sub-API may have its own independent major version.\n - `type/*` - proto files containing types that are shared between different APIs, different versions of the same API, or between the API and service implementation. Type definitions under `type/*` **should** not have breaking changes once they are released.\n\nPublic Google API definitions are published on GitHub, see\n[Google APIs](https://github.com/googleapis/googleapis) repository.\n| **Note:** If you are a [Cloud Endpoints](/endpoints) developer, you can follow [Configuring a gRPC service](/endpoints/docs/grpc/grpc-service-config) to configure your API service."]]