Skip to content

Convert gRPC APIs to use GAPIC #1859

@stephenplusplus

Description

@stephenplusplus
  • Bigtable
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works
  • Datastore
  • Language
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works
  • Logging
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works
  • Pub/Sub
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works
  • Spanner
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works
  • Speech
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works (Not applicable)
  • Vision
    • Generated files are in repo
    • Handwritten API is using generated API
    • Passing through gaxOptions is available on all requests
    • Automatic projectId insertion works (Not applicable)

Cursoring Options

options.autoPaginate

Since the generated API accepts this option, I don't believe we'll need common/paginator. We will simply decorate whatever our callback to gax executes with.

options.maxApiCalls

All API calls come with a cost, and autoPaginate: true leaves that out of the user's control. We added this option to give that control back. Is this supported in the generated layer?

options.maxResults

We support this currently, though I don't know if this is supported in the generated layer. It will simply cut off making further requests after this amount has been reached. So a user can effectively say "autopaginate up until 58 results".

Common Methods

Since each resource will still have some or all of a shared set of methods:

  • delete
  • getMetadata
  • setMetadata

and we can still wrap them with helpers like:

  • create
  • exists
  • get

I believe it will require only a small bit of re-factoring to support, but GrpcService & GrpcServiceObject will likely continue to have a use. Alternatively, it might be possible to use the generic Service and ServiceObject if we can find an acceptable amount of convention/configuration.

common/paginator & common/streamify

Will we need these?

common/util.promisify

Will we need this?

Others

Is there anything else I could be missing?

I came up with this list by trying to migrate the Logging handwritten API to use the generated one. I quickly ran into these bumps, and figured we should resolve these and others up front. Ideally, our repo will remain clean of any artifacts of past implementations, so this will involve a thorough review of the utilities we have in common. @callmehiphop feel free to try a similar migration (pick an API) and see if you uncover any other issues.

// cc @callmehiphop @jmuk @bjwatson

Metadata

Metadata

Labels

api: datastoreIssues related to the Datastore API.core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions