Service Infrastructure 是一个基础平台,可用于跨组织创建、管理、保护和使用 API 和服务。Google API、Cloud API、Cloud Endpoints 和 API Gateway 均可使用。Service Infrastructure 为服务使用者和服务生产者提供了广泛的功能,包括身份验证、授权、审计、速率限制、分析、计费、日志记录和监控。
架构
Service Infrastructure 旨在支持数以百万计的服务提供方和服务使用方。为了处理这种可伸缩性,Service Infrastructure 使用分布式微服务体系结构。该系统根据其功能分为三个平面:
Management Plane 使开发者可以管理其服务的配置及其服务的使用情况。
Data Plane 用于处理客户端和服务之间的数据流量。 数据平面可以在不同的环境中运行,并支持内部和外部客户端。
Control Plane 基于来自管理平面的配置(例如速率限制)来控制数据平面。
Service Infrastructure 为这些平面提供了多个公共 API。开发者可以使用这些 API 将其服务直接与 Service Infrastructure 集成,也可以使用基于这些 API 构建的框架,例如 Cloud Endpoints 和 API Gateway。
创建 API 和服务
如要使用 Service Infrastructure 创建托管服务,您需要创建服务配置来定义服务设置和行为,例如服务名称和 API 途径。然后,您将服务配置部署到 Service Management API,以创建服务并在 Google Cloud中注册。
如果您是服务使用者,则可以使用 Service Usage 来列出、启用和停用 Google Cloud 项目中的 API 和服务,并将配额限制应用于 Google Cloud 项目或组织内部使用的服务。您既可以管理 Google 提供的服务,也可以管理使用 Cloud Endpoints 创建的服务。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Service Infrastructure\n\n\u003cbr /\u003e\n\nService Infrastructure is a foundational platform for creating, managing,\nsecuring, and consuming APIs and services across organizations. It is used\nby [Google APIs](https://github.com/googleapis/googleapis),\n[Cloud APIs](/apis), [Cloud Endpoints](/endpoints), and\n[API Gateway](/api-gateway). Service Infrastructure\nprovides a wide range of features to service consumers and service producers,\nincluding authentication, authorization, auditing, rate limiting, analytics,\nbilling, logging, and monitoring.\n\nArchitecture\n------------\n\nService Infrastructure is designed to support millions of service producers and\nservice consumers. In order to handle such scalability,\nService Infrastructure uses a distributed microservice architecture.\nThe system is divided into three *planes* based on their functionality:\n\n- The Management Plane, which lets developers manage configurations of their services and their usage of services.\n- The Data Plane, which handles the data traffic between the clients and the services. The data plane can run in different environments and support both internal and external clients.\n- The Control Plane, which controls the data plane based on the configurations coming from the management plane, such as rate limiting.\n\nService Infrastructure provides multiple public APIs for these planes. A developer\ncan use these APIs to integrate their service directly with Service Infrastructure,\nor use a framework built on top of these APIs, such as\n[Cloud Endpoints](/endpoints) and [API Gateway](/api-gateway).\n\nCreating APIs and services\n--------------------------\n\nTo create a managed service using Service Infrastructure, you need to\ncreate a [service configuration](/service-infrastructure/docs/glossary#config) to define your service\nsettings and behaviors, such as service name and API surface. You then deploy\nyour service configuration to the Service Management API to create your\nservice and register it with Google Cloud.\n\nFor more information, see Managing Services in the\n[How-to Guides](/service-infrastructure/docs/how-to).\n\nRunning APIs and services\n-------------------------\n\nTo run a managed service using Service Infrastructure, your service needs to\ncall the Service Control API for admission control on each request, and\ntelemetry reporting on each response, such as validating API keys and reporting\nAPI metrics. It allows your service to leverage the rich set of features\nprovided by Google Cloud.\n\nIf your service has some internal components, such as billing pipelines, they\ncan also use the Service Control API for admission control and telemetry\nreporting. For example, reporting billing metrics to\n[Cloud Billing](https://cloud.google.com/billing/docs).\n\nFor more information, see Integrating with Service Infrastructure in the\n[How-to Guides](/service-infrastructure/docs/how-to).\n\nManaging APIs and services\n--------------------------\n\nIf you are a service producer, you can use the Service Consumer Management API and\nthe Service Networking API to manage consumers of your service,\nincluding creating tenant projects for your consumers, setting up network\npeering between tenant projects and consumer projects, and managing the quota\nlimits of your consumers.\n\nFor more information, see Managing Service Consumers in the\n[How-to Guides](/service-infrastructure/docs/how-to).\n\nConsuming APIs and services\n---------------------------\n\nIf you are a service consumer, you can use the Service Usage to list, enable,\nand disable APIs and services in your Google Cloud projects, and apply quota\nrestrictions to services used by your Google Cloud projects or within your\norganization. You can manage both Google-provided services and services created using\n[Cloud Endpoints](https://cloud.google.com/endpoints).\n\nFor more information, see the [Service Usage](/service-usage/docs)\ndocumentation.\n\nGetting started\n---------------\n\nThe recommended way for most use cases to use Service Infrastructure is to use\n[Cloud Endpoints](/endpoints) to create and manage your services. To get\nstarted, see\n[Cloud Endpoints Quickstart](/endpoints/docs/deploy-api)."]]