Discontinuing support for JSON-RPC and global HTTP batch endpoints

July 13, 2020


Link copied to clipboard

UPDATE:

August 19, 2020: Revised guidance for Google Cloud client libraries and Apache Beam/Cloud Dataflow

August 12, 2020: Added guidance for Dataproc hadoop connector

July 13, 2020: Enumerate endpoints for JSON-RPC and Global HTTP Batch. Include examples of Non-Global HTTP Batch endpoints for contrast.

July 8, 2020: Limit usage of JSON-RPC and Global HTTP batch endpoints to existing projects only. Starting July 15 (JSON-RPC) and July 16 (Global HTTP Batch) we will no longer allow new projects to call these two endpoints. Projects with calls in the last 4 weeks will continue to work until the deadline of Aug 12, 2020.

Apr 23, 2020: gcloud min version has been updated

Apr 22, 2020: error injection planned for Apr 28 is CANCELLED, JSON-RPC and Global HTTP batch endpoint will perform normally. Next error injection window will be on May 26 as scheduled.

We have invested heavily in our API and service infrastructure to improve performance and security and to add features developers need to build world-class APIs. As we make changes we must address features that are no longer compatible with the latest architecture and business requirements.

The JSON-RPC protocol (http://www.jsonrpc.org/specification) and Global HTTP Batch (example) are two such features. Our support for these features was based on an architecture using a single shared proxy to receive requests for all APIs. As we move towards a more distributed, high performance architecture where requests go directly to the appropriate API server we can no longer support these global endpoints.

We had originally planned to decommission these features by Mar 25, 2019. However, it came to our attention that few highly impacted customers might not have received the earlier notification.

As a result, we are extending the deprecation timeline to Aug 12, 2020, when we will discontinue support for both these features. Please note the timeline extension to Aug 12, 2020 does not apply to Places API. Please visit Places SDK for iOS migration for information on Places API migration.

Starting February 2020 and running through August 2020, we will periodically inject errors for short windows of time. Please see below for exact details and schedule of planned downtime windows.

We know that these changes have customer impact and have worked to make the transition steps as clear as possible. Please see the guidance below which will help ease the transition.

Planned downtime

To enable customers to identify systems that depend on these deprecated features, before the final turndown date is reached, there will be scheduled downtime for Global Batch and JSON-RPC starting from February 2020 and running through August 2020.

Below are details and schedule of periodic error injection windows, details of the downtime in June and July will be confirmed nearer the time, so please check back this blog post for the latest schedule.

How do I know if I should migrate ?

JSON-RPC

To identify whether you use JSON-RPC, you can check whether you send requests to "https://www.googleapis.com/rpc" or "https://content.googleapis.com/rpc". If you do, you should migrate.

HTTP batch

A batch request is homogenous if the inner requests are addressed to the same API, even if addressed to different methods of the same API. Homogenous batching will still be supported but through API specific batch endpoints. If you are currently forming homogeneous batch requests, using Google API Client Libraries or using non-Google API client libraries or no client library (i.e making raw HTTP requests), you should migrate.

A batch request is heterogeneous if the inner requests go to different APIs. Heterogeneous batching will not be supported after the turn down of the Global HTTP batch endpoint. If you are currently forming heterogeneous batch requests, change your client code to send only homogenous batch requests, i.e you should migrate.

What do you need to do to migrate ?

Clients will need to make the changes outlined below to migrate.

JSON-RPC

Endpoints

The following JSON-RPC endpoints will no longer be supported.

Using Client Libraries

If you are using JSON-RPC client libraries (either the Google published libraries or other libraries), switch to REST client libraries and modify your application to work with REST client libraries.

Example code for Javascript
Before

// json-rpc request for the list method
gapi.client.rpcRequest('zoo.animals.list', 'v2',
  {name:'giraffe'}).execute(x=>console.log(x))
After
// json-rest request for the list method
gapi.client.zoo.animals.list({name:'giraffe'}).then(x=>console.log(x))

Not Using Client Libraries i.e making raw HTTP requests

If you are not using client libraries (i.e. making raw HTTP requests):

  1. Use the REST URLs, and
  2. Change how you form the request and parse the response.

    Example code

    Before
    // Request URL (JSON-RPC)
    POST https://content.googleapis.com/rpc?alt=json&key=xxx
    // Request Body (JSON-RPC)
    [{
      "jsonrpc":"2.0",
      "id":"gapiRpc",
      "method":"zoo.animals.list",
      "apiVersion":"v2",
      "params":{"name":"giraffe"}
    }]
    
    After
    // Request URL (JSON-REST)
    GET 
    https://content.googleapis.com/zoo/v2/animals?name=giraffe&key=xxx 

HTTP batch

Endpoints

The following Global HTTP Batch endpoints will no longer be supported.

  • https://www.googleapis.com/batch
  • https://content.googleapis.com/batch
  • https://clients6.google.com/batch

Non-Global HTTP Batch endpoints that include the API name in the URI will continue to be supported. Examples includes:

  • https://www.googleapis.com/batch/compute/v1
  • https://content.googleapis.com/batch/compute/v1
  • https://clients6.google.com/batch/compute/v1
  • https://compute.googleapis.com/batch
  • https://content-compute.googleapis.com/batch
  • https://compute.clients6.google.com/batch

Heterogeneous batch requests

If you are currently forming heterogeneous batch requests, change your client code to send only homogenous batch requests.

Example code
The example demonstrates how we can split a heterogeneous batch request for 2 apis (urlshortener and zoo) into 2 homogeneous batch requests.


Before
// heterogeneous batch request example.

// Notice that the outer batch request contains inner API requests
// for two different APIs.

// Request to urlshortener API
request1 = gapi.client.urlshortener.url.get({"shortUrl": 
"http://goo.gl/fbsS"});

// Request to zoo API
request2 = gapi.client.zoo.animals.list();

// Request to urlshortener API
request3 = gapi.client.urlshortener.url.get({"shortUrl":
"https://goo.gl/XYFuPH"});

// Request to zoo API
request4 = gapi.client.zoo.animal().get({"name": "giraffe"});

// Creating single heterogeneous batch request object
heterogeneousBatchRequest = gapi.client.newBatch();
// adding the 4 batch requests
heterogeneousBatchRequest.add(request1);
heterogeneousBatchRequest.add(request2);  
heterogeneousBatchRequest.add(request3);
heterogeneousBatchRequest.add(request4);
// print the heterogeneous batch request
heterogeneousBatchRequest.then(x=>console.log(x));


After
// Split heterogeneous batch request into two homogenous batch requests

// Request to urlshortener API
request1 = gapi.client.urlshortener.url.get({"shortUrl": "http://goo.gl/fbsS"});

// Request to zoo API
request2 = gapi.client.zoo.animals.list();

// Request to urlshortener API
request3 = gapi.client.urlshortener.url.get({"shortUrl": "http://goo.gl/fbsS"})

// Request to zoo API
request4 = gapi.client.zoo.animals.list();

// Creating homogenous batch request object for urlshorterner
homogenousBatchUrlshortener = gapi.client.newBatch();
// adding the 2 batch requests for urlshorterner
homogenousBatchUrlshortener.add(request1); 
homogenousBatchUrlshortener.add(request3); 

// Creating homogenous batch request object for zoo
homogenousBatchZoo = gapi.client.newBatch();

// adding the 2 batch requests for zoo
homogenousBatchZoo.add(request2); 
homogenousBatchZoo.add(request4);
// print the 2 homogenous batch request
Promise.all([homogenousBatchUrlshortener,homogenousBatchZoo])
    .then(x=>console.log(x));

Homogeneous batch requests

Google API client libraries

If you are using Google API Client Libraries, these libraries have been regenerated to no longer make requests to the global HTTP batch endpoint. Recommendation for clients using these libraries is to upgrade to the latest version if possible. Please see the language specific guidance below for minimum Google API Client Library to upgrade to.

1. Java
    • Minimum Google Client Library Version supported is 1.23.1.
    • Consumer Steps
      1. Update all Google API Service packages (`com.google.apis`) to a version where the supporting library version is 1.23.1 or higher. For example, upgrade `com.google.apis:google-api-services-drive` from version `v3-rev159-1.22.0` to `v3-rev20190620-1.30.1`.

        1. If you explicitly import `com.google.api-client:google-api-client`, upgrade `com.google.api-client:google-api-client` to version 1.23.1 or higher.
      2. Please ensure you are creating your BatchRequest (i.e) com.google.api.client.googleapis.batch.BatchRequest instance via your service client. The BatchRequest constructor is now deprecated and will not work in the future. Instead, use your service client’s batch() method to create a new BatchRequest using below example
      3. Example code

        Drive client = Drive.builder(transport, jsonFactory, 
        credential).setApplicationName("BatchExample/1.0").build
        ();
        

        BatchRequest batch = client.batch();

      4. For global batch, confirm that your code does not explicitly specify the Global Batch endpoint.
      5. Rebuild

2. Python
  • Minimum Google Client Library Version supported is 1.6.6.
  • Consumer Steps
    • Update to version 1.6.6 or higher
    • Confirm that your code does not explicitly make a call to a Global HTTP Batch endpoint (e.g. www.googleapis.com/batch). These should be made to Non-Global HTTP Batch endpoints (e.g. www.googleapis.com/batch/compute/v1).
    • Rebuild
  • Please note, a warning is included if users try to construct a request with the legacy batch endpoint. See Release notes for reference.
3. PHP
  • Minimum Google Client Library Version supported is 0.86.
  • Consumer Steps
    • Update to version 0.86 or higher
    • Confirm that your code does not explicitly make a call to a Global HTTP Batch endpoint (e.g. www.googleapis.com/batch). These should be made to Non-Global HTTP Batch endpoints (e.g. www.googleapis.com/batch/compute/v1).
    • Rebuild
4. .NET
  • Minimum Google Client Library Version supported is 1.32.2.
  • Consumer Steps
    • Update to version 1.32.2 or higher
    • Confirm that your code does not explicitly make a call to a Global HTTP Batch endpoint (e.g. www.googleapis.com/batch). These should be made to Non-Global HTTP Batch endpoints (e.g. www.googleapis.com/batch/compute/v1).
    • Rebuild
5. Javascript
  • If you are using Javascript client lib, please reach out to us with your questions and we will do our best to support
6. Objective-C
  • Minimum Google Client Library Version supported is 1.3.0.
  • Consumer Steps
    • Update to version 1.3.0 or higher
    • Confirm that your code does not explicitly make a call to a Global HTTP Batch endpoint (e.g. www.googleapis.com/batch). These should be made to Non-Global HTTP Batch endpoints (e.g. www.googleapis.com/batch/compute/v1).
    • Rebuild
7. Dart
  • The Google API Dart Client Library does not support these features.
8. Ruby
  • Minimum Google Client Library Version supported is 0.11.0.
  • Consumer Steps
    • Update to version 0.11.0 or higher
    • Confirm that your code does not explicitly make a call to a Global HTTP Batch endpoint (e.g. www.googleapis.com/batch). These should be made to Non-Global HTTP Batch endpoints (e.g. www.googleapis.com/batch/compute/v1).
    • Rebuild
9. Node.js
  • Minimum Google Client Library Version supported is 1.0.
  • Consumer Steps
    • Update to version 1.0 or higher
    • Confirm that your code does not explicitly make a call to a Global HTTP Batch endpoint (e.g. www.googleapis.com/batch). These should be made to Non-Global HTTP Batch endpoints (e.g. www.googleapis.com/batch/compute/v1).
    • Rebuild
10. Go
  • The Google API Go Client Library does not support these features.
11. C++
  • The Google C++ API Client Library has been deprecated due to unrelated reasons. However, should you need to use the C++ client with batching in the short term, see consumer steps below.
  • Consumer Steps
    • Change app code to explicitly pass the non-global batch URL to the C++ client library i.e pass the API-version specific endpoint (e.g. "www.googleapis.com/batch/compute/v1") to the overload method that takes the batch endpoint as an explicit parameter; merely updating the C++ client library to the latest version will not help.

      Example code
      Before

      HttpRequestBatch batch(service->transport());

      After
      HttpRequestBatch batch(service->transport(), 
      service->batch_url());
      
    • Link, rebuild and redeploy

Google Cloud Client Libraries

  1. Java

    Upgrade to v1.39.0 or later of the Google Cloud Java Client for Storage (released in v0.57.0 of the Google Cloud Client Library).

  2. Python

    Upgrade to v1.9.0 or later of the GCS client.

GCloud

Older versions of gcloud used global batch calls in some cases. You should update your version of gcloudl. GCloud from v148.0.0 onwards is compatible with this deprecation.

In general this can be done by running "gcloud components update".

Apache Beam/ Cloud Dataflow

Users with Dataflow pipelines written using the Beam (or Dataflow) Python or Java SDKs 2.4 and below should update their pipelines to a later SDK (than 2.4), ideally to the latest one available here.

Dataproc hadoop connector

Users who run Apache Hadoop or Apache Spark jobs directly on data in Cloud Storage using gcs-connector should update their connector to 1.6.3 or later.

Non-Google API client libraries or no client library

If you are currently forming homogeneous batch requests and using non-Google API client libraries or no client library (i.e making raw HTTP requests), then:

  • Change the endpoint from www.googleapis.com/batch to www.googleapis.com/batch/<api>/<version>.
  • Or, simply read the value of 'batchPath' from the API's discovery doc and use that value.

We’re here to help

For help on migration, consult the API documentation or tag Stack Overflow questions with the 'google-api' tag.