将 gRPC 与 Certificate Authority Service 搭配使用
如果您使用手动创建的 gRPC 库对 Certificate Authority Service 进行 API 调用,则必须添加 x-goog-request-params: '<request-field>:<resource-name>'
作为标头。正确使用 x-goog-request-params
可确保将请求路由到您的 CA 服务资源的相应区域。
下面列出了一些方法示例及其各自的请求字段和示例标头。
方法:CreateCertificateAuthority 请求字段:CreateCertificateAuthority.parent x-goog-request-params: 'parent: projects/PROJECT_ID/locations/LOCATION_ID' |
方法:GetCertificateAuthority 请求字段:GetCertificateAuthority.name x-goog-request-params: 'name: projects/PROJECT_ID/locations/LOCATION_ID/certificateAuthorities/CA_NAME' |
方法:UpdateCertificateAuthority 请求字段:UpdateCertificateAuthority.certificate_authority.name x-goog-request-params: 'CertificateAuthority.name: projects/PROJECT_ID/locations/LOCATION_ID/certificateAuthorities/CA_NAME' |
如需查看 RPC 方法及其各自请求字段的完整列表,请参阅 google.cloud.security.privateca.v1beta1 软件包。