menu
arrow_back
返回

Transcoding HTTP/JSON API calls to gRPC through API Gateway

—/100

Checkpoints

arrow_forward

Deploy the gRPC service on Cloud Run

Creating an API Config with HTTP to gRPC Transcoding

Call the API using Transcoding

Transcoding HTTP/JSON API calls to gRPC through API Gateway

1 个小时 30 分钟 7 个积分

GSP881

Google Cloud Self-Paced Labs

Introduction

gRPC Transcoding is a feature for mapping between a gRPC method and one or more HTTP REST endpoints. It allows developers to build a single API service that supports both gRPC APIs and REST APIs. API Gateway enables you to provide secure access to gRPC services through a well-defined API configuration. If securing gRPC APIs through API Gateway, you may also want to support protocol transcoding so that clients can access your gRPC API by using HTTP/JSON

Transcoding involves mapping HTTP/JSON requests and their parameters to gRPC methods, their parameters and return types. Because of this, while it's possible to map an HTTP/JSON request to any arbitrary API method, it helps to do so if the gRPC API is structured in a resource-oriented way, similar to a traditional HTTP REST API.

In other words, you design the API service so that it uses a small number of standard methods, corresponding to HTTP verbs such as GET and PUT, that operate on the service's resources. These standard methods are List, Get, Create, Update, and Delete. You can find out much more about resource-oriented design and standard transcoding mappings in Google Cloud's API design guide.

In this lab you will learn how to:

  • Secure a gRPC API via API Gateway and provide the ability to call the API using HTTP/JSON.
  • Use annotations in your gRPC .proto file to specify data conversion from HTTP/JSON to gRPC.
  • How to deploy your service on Cloud Run and leverage transcoding to mediate between HTTP/JSON and gRPC.
  • Where to find more reference information about designing and implementing transcoding for gRPC services.

This lab assumes that you have already completed the Managing Cloud Run gRPC Services with API Gateway lab.

加入 Qwiklabs 即可阅读本实验的剩余内容…以及更多精彩内容!

  • 获取对“Cloud Console”的临时访问权限。
  • 200 多项实验,从入门级实验到高级实验,应有尽有。
  • 内容短小精悍,便于您按照自己的节奏进行学习。
加入以开始此实验