From 32e4a18f65f76181d8b85dd51b384e2d1f2856d2 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 May 2018 13:14:04 -0700 Subject: [PATCH] prediction API is disabled (#2819) --- README.md | 67 ----------------------------- docs/manifest.json | 18 +------- manifest.json | 16 ------- packages/google-cloud/package.json | 3 -- packages/google-cloud/src/index.js | 27 ------------ packages/google-cloud/test/index.js | 17 +------- scripts/docs/config.js | 3 -- 7 files changed, 2 insertions(+), 149 deletions(-) diff --git a/README.md b/README.md index 91708f85595..45279dc504c 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,6 @@ This client supports the following Google Cloud Platform services at an [Alpha]( * [Google Stackdriver Error Reporting](https://github.com/googleapis/nodejs-error-reporting) (Alpha) * [Google Stackdriver Trace](#google-stackdriver-trace-alpha) (Alpha) -The following client libraries are **deprecated** due to the underlying API also being deprecated: - -* [Google Prediction API](https://github.com/googleapis/nodejs-prediction) (Deprecated) - If you need support for other Google APIs, check out the [Google Node.js API Client library][googleapis]. @@ -138,7 +134,6 @@ If you are not running this client on Google Cloud Platform, you need a Google D * Google Cloud Translation API * Google Cloud Vision API * Google Compute Engine API - * Prediction API * Stackdriver Logging API 4. Navigate to **APIs & auth** > **Credentials** and then: * If you want to use a new service account key, click on **Create credentials** and select **Service account key**. After the account key is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. @@ -1069,65 +1064,6 @@ zone.createVM(name, { os: 'ubuntu' }, function(err, vm, operation) { }); ``` - -## Google Prediction API (Alpha) - -- [API Documentation][gcloud-prediction-docs] -- [Official Documentation][cloud-prediction-docs] - -#### Using the Prediction API module - -``` -$ npm install --save @google-cloud/prediction -``` - -```js -var prediction = require('@google-cloud/prediction'); -``` - -#### Authentication - -See [Authentication](#authentication). - -#### Preview - -```js -var predictionClient = prediction({ - projectId: 'grape-spaceship-123', - keyFilename: '/path/to/keyfile.json' -}); - -// Get all of the trained models in your project. -predictionClient.getModels(function(err, models) { - if (!err) { - // `models` is an array of Model objects. - } -}); - -// Reference an existing trained model. -var model = predictionClient.model('my-existing-model'); - -// Train a model. -model.train('english', 'Hello from your friends at Google!', function(err) {}); - -// Query a model. -model.query('Hello', function(err, results) { - if (!err) { - // results.winner == 'english' - // results.scores == [ - // { - // label: 'english', - // score: 1 - // }, - // { - // label: 'spanish', - // score: 0 - // } - // ] - } -}); -``` - ## Google Stackdriver Debugger (Alpha) - [GitHub Repo][stackdriver-debug-nodejs-repo] @@ -1238,7 +1174,6 @@ Apache 2.0 - See [LICENSE][license] for more information. [gcloud-dns-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/dns [gcloud-language-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/language [gcloud-logging-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/logging -[gcloud-prediction-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/prediction [gcloud-monitoring-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/monitoring [gcloud-pubsub-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub [gcloud-resource-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/resource @@ -1285,8 +1220,6 @@ Apache 2.0 - See [LICENSE][license] for more information. [cloud-logging-docs]: https://cloud.google.com/logging/docs -[cloud-prediction-docs]: https://cloud.google.com/prediction/docs - [cloud-pubsub-docs]: https://cloud.google.com/pubsub/docs [cloud-resource-docs]: https://cloud.google.com/resource-manager diff --git a/docs/manifest.json b/docs/manifest.json index 964af93d9cb..3e1ba5722be 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -268,22 +268,6 @@ "master" ] }, - { - "id": "prediction", - "name": "@google-cloud/prediction", - "defaultService": "prediction", - "versions": [ - "0.6.1", - "0.6.0", - "0.4.0", - "0.3.1", - "0.3.0", - "0.2.0", - "0.1.2", - "0.1.1", - "master" - ] - }, { "id": "pubsub", "name": "@google-cloud/pubsub", @@ -427,4 +411,4 @@ "title": "npm", "href": "https://www.npmjs.com/package/gcloud" } -} \ No newline at end of file +} diff --git a/manifest.json b/manifest.json index bda8c2c9684..0ef02c26644 100644 --- a/manifest.json +++ b/manifest.json @@ -268,22 +268,6 @@ "master" ] }, - { - "id": "prediction", - "name": "@google-cloud/prediction", - "defaultService": "prediction", - "versions": [ - "0.6.1", - "0.6.0", - "0.4.0", - "0.3.1", - "0.3.0", - "0.2.0", - "0.1.2", - "0.1.1", - "master" - ] - }, { "id": "pubsub", "name": "@google-cloud/pubsub", diff --git a/packages/google-cloud/package.json b/packages/google-cloud/package.json index 531a502da7a..3fd05586125 100644 --- a/packages/google-cloud/package.json +++ b/packages/google-cloud/package.json @@ -85,8 +85,6 @@ "google appengine", "appengine", "gae", - "google prediction", - "prediction", "google translate", "translate", "google cloud logging", @@ -119,7 +117,6 @@ "@google-cloud/language": "^0.12.1", "@google-cloud/logging": "^1.0.0", "@google-cloud/monitoring": "^0.3.0", - "@google-cloud/prediction": "^0.6.0", "@google-cloud/pubsub": "^0.14.3", "@google-cloud/resource": "^0.7.0", "@google-cloud/spanner": "^0.7.1", diff --git a/packages/google-cloud/src/index.js b/packages/google-cloud/src/index.js index 97b1e9f8cc5..8c93be6ec71 100644 --- a/packages/google-cloud/src/index.js +++ b/packages/google-cloud/src/index.js @@ -235,33 +235,6 @@ var apis = { */ monitoring: require('@google-cloud/monitoring'), - /** - * The [Google Prediction API](https://cloud.google.com/prediction/docs/getting-started) - * provides pattern-matching and machine learning capabilities. Given a set of - * data examples to train against, you can create applications that can - * perform the following tasks: - * - * - Given a user's past viewing habits, predict what other movies or - * products a user might like. - * - Categorize emails as spam or non-spam. - * - Analyze posted comments about your product to determine whether they - * have a positive or negative tone. - * - Guess how much a user might spend on a given day, given his spending - * history. - * - * @type {module:prediction} - * - * @return {module:prediction} - * - * @example - * var gcloud = require('google-cloud'); - * var prediction = gcloud.prediction({ - * projectId: 'grape-spaceship-123', - * keyFilename: '/path/to/keyfile.json' - * }); - */ - prediction: require('@google-cloud/prediction'), - /** * [Cloud Pub/Sub](https://developers.google.com/pubsub/overview) is a * reliable, many-to-many, asynchronous messaging service from Cloud diff --git a/packages/google-cloud/test/index.js b/packages/google-cloud/test/index.js index 4309333f13c..7455eba708a 100644 --- a/packages/google-cloud/test/index.js +++ b/packages/google-cloud/test/index.js @@ -42,7 +42,6 @@ var FakeFirestore = createFakeApi(); var FakeLanguage = createFakeApi(); var FakeLogging = createFakeApi(); var FakeMonitoring = createFakeApi(); -var FakePrediction = createFakeApi(); var FakePubSub = createFakeApi(); var FakeResource = createFakeApi(); var FakeSpanner = createFakeApi(); @@ -67,7 +66,6 @@ describe('gcloud', function() { '@google-cloud/language': FakeLanguage, '@google-cloud/logging': FakeLogging, '@google-cloud/monitoring': FakeMonitoring, - '@google-cloud/prediction': FakePrediction, '@google-cloud/pubsub': FakePubSub, '@google-cloud/resource': FakeResource, '@google-cloud/spanner': FakeSpanner, @@ -123,10 +121,6 @@ describe('gcloud', function() { assert.strictEqual(gcloud.monitoring, FakeMonitoring); }); - it('should export static prediction', function() { - assert.strictEqual(gcloud.prediction, FakePrediction); - }); - it('should export static pubsub', function() { assert.strictEqual(gcloud.pubsub, FakePubSub); }); @@ -280,15 +274,6 @@ describe('gcloud', function() { }); }); - describe('prediction', function() { - it('should create a new Prediction', function() { - var prediction = localGcloud.prediction(options); - - assert(prediction instanceof FakePrediction); - assert.strictEqual(prediction.calledWith_[0], options); - }); - }); - describe('pubsub', function() { it('should create a new PubSub', function() { var pubsub = localGcloud.pubsub(options); @@ -299,7 +284,7 @@ describe('gcloud', function() { }); describe('resource', function() { - it('should create a new Prediction', function() { + it('should create a new Resource', function() { var resource = localGcloud.resource(options); assert(resource instanceof FakeResource); diff --git a/scripts/docs/config.js b/scripts/docs/config.js index 37562d6b67a..6283ed687e7 100644 --- a/scripts/docs/config.js +++ b/scripts/docs/config.js @@ -88,9 +88,6 @@ module.exports = { monitoring: { title: 'Cloud Monitoring' }, - prediction: { - title: 'Prediction API' - }, pubsub: { title: 'Cloud Pub/Sub' },