Skip to content

Commit

Permalink
datastore | logging: promote to GA (googleapis#2187)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored Apr 14, 2017
1 parent 8bc7f0d commit 6622fbd
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 101 deletions.
198 changes: 99 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@

This client supports the following Google Cloud Platform services at a [General Availability (GA)](#versioning) quality level:

* [Cloud Datastore](#cloud-datastore-ga) (GA)
* [Cloud Storage](#cloud-storage-ga) (GA)
* [Google Stackdriver Logging](#google-stackdriver-logging-ga) (GA)

This client supports the following Google Cloud Platform services at a [Beta](#versioning) quality level:

* [Cloud Datastore](#cloud-datastore-beta) (Beta)
* [Cloud Natural Language](#cloud-natural-language-beta) (Beta)
* [Cloud Translation API](#cloud-translation-api-beta) (Beta)
* [Cloud Vision](#cloud-vision-beta) (Beta)
* [Google BigQuery](#google-bigquery-beta) (Beta)
* [Google Stackdriver Logging](#google-stackdriver-logging-beta) (Beta)

This client supports the following Google Cloud Platform services at an [Alpha](#versioning) quality level:

Expand Down Expand Up @@ -153,6 +153,69 @@ var gcloud = require('google-cloud')({
You can also set auth on a per-API-instance basis. The examples below show you how.


## Cloud Datastore (GA)

- [API Documentation][gcloud-datastore-docs]
- [Official Documentation][cloud-datastore-docs]

*Follow the [activation instructions][cloud-datastore-activation] to use the Cloud Datastore API with your project.*

#### Using the Cloud Datastore API module

```
$ npm install --save @google-cloud/datastore
```

```js
var datastore = require('@google-cloud/datastore');
```

#### Preview

```js
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var datastoreClient = datastore({
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json'
});

var key = datastoreClient.key(['Product', 'Computer']);

datastoreClient.get(key, function(err, entity) {
console.log(err || entity);
});

// Save data to Datastore.
var blogPostData = {
title: 'How to make the perfect homemade pasta',
author: 'Andrew Chilton',
isDraft: true
};

var blogPostKey = datastoreClient.key('BlogPost');

datastoreClient.save({
key: blogPostKey,
data: blogPostData
}, function(err) {
// `blogPostKey` has been updated with an ID so you can do more operations
// with it, such as an update.
blogPostData.isDraft = false;

datastoreClient.save({
key: blogPostKey,
data: blogPostData
}, function(err) {
if (!err) {
// The blog post is now published!
}
});
});
```


## Cloud Storage (GA)

- [API Documentation][gcloud-storage-docs]
Expand Down Expand Up @@ -214,65 +277,63 @@ localReadStream.pipe(remoteWriteStream);
```


## Cloud Datastore (Beta)

- [API Documentation][gcloud-datastore-docs]
- [Official Documentation][cloud-datastore-docs]
## Google Stackdriver Logging (Beta)

*Follow the [activation instructions][cloud-datastore-activation] to use the Cloud Datastore API with your project.*
- [API Documentation][gcloud-logging-docs]
- [Official Documentation][cloud-logging-docs]

#### Using the Cloud Datastore API module
#### Using the Google Stackdriver Logging API module

```
$ npm install --save @google-cloud/datastore
$ npm install --save @google-cloud/logging
```

```js
var datastore = require('@google-cloud/datastore');
var logging = require('@google-cloud/logging');
```

#### Preview

```js
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).
// Authenticating on a global-basis. You can also authenticate on a per-API-
// basis (see Authentication section above).

var datastoreClient = datastore({
var loggingClient = logging({
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json'
});

var key = datastoreClient.key(['Product', 'Computer']);
// Create a sink using a Bucket as a destination.
var gcs = storage();

datastoreClient.get(key, function(err, entity) {
console.log(err || entity);
});
loggingClient.createSink('my-new-sink', {
destination: gcs.bucket('my-sink')
}, function(err, sink) {});

// Save data to Datastore.
var blogPostData = {
title: 'How to make the perfect homemade pasta',
author: 'Andrew Chilton',
isDraft: true
// Write a critical entry to a log.
var syslog = loggingClient.log('syslog');

var metadata = {
resource: {
type: 'gce_instance',
labels: {
zone: 'global',
instance_id: '3'
}
}
};

var blogPostKey = datastoreClient.key('BlogPost');
var entry = syslog.entry(metadata, {
delegate: process.env.user
});

datastoreClient.save({
key: blogPostKey,
data: blogPostData
}, function(err) {
// `blogPostKey` has been updated with an ID so you can do more operations
// with it, such as an update.
blogPostData.isDraft = false;
syslog.critical(entry, function(err) {});

datastoreClient.save({
key: blogPostKey,
data: blogPostData
}, function(err) {
if (!err) {
// The blog post is now published!
}
});
// Get all entries in your project.
loggingClient.getEntries(function(err, entries) {
if (!err) {
// `entries` contains all of the entries from the logs in your project.
}
});
```

Expand Down Expand Up @@ -629,67 +690,6 @@ job.getQueryResults().on('data', function(row) {});
```


## Google Stackdriver Logging (Beta)

- [API Documentation][gcloud-logging-docs]
- [Official Documentation][cloud-logging-docs]

#### Using the Google Stackdriver Logging API module

```
$ npm install --save @google-cloud/logging
```

```js
var logging = require('@google-cloud/logging');
```

#### Preview

```js
// Authenticating on a global-basis. You can also authenticate on a per-API-
// basis (see Authentication section above).

var loggingClient = logging({
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json'
});

// Create a sink using a Bucket as a destination.
var gcs = storage();

loggingClient.createSink('my-new-sink', {
destination: gcs.bucket('my-sink')
}, function(err, sink) {});

// Write a critical entry to a log.
var syslog = loggingClient.log('syslog');

var metadata = {
resource: {
type: 'gce_instance',
labels: {
zone: 'global',
instance_id: '3'
}
}
};

var entry = syslog.entry(metadata, {
delegate: process.env.user
});

syslog.critical(entry, function(err) {});

// Get all entries in your project.
loggingClient.getEntries(function(err, entries) {
if (!err) {
// `entries` contains all of the entries from the logs in your project.
}
});
```


## Cloud Bigtable (Alpha)

- [API Documentation][gcloud-bigtable-docs]
Expand Down
2 changes: 1 addition & 1 deletion packages/datastore/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @google-cloud/datastore ([Beta][versioning])
# @google-cloud/datastore ([GA][versioning])
> Cloud Datastore Client Library for Node.js
*Looking for more Google APIs than just Datastore? You might want to check out [`google-cloud`][google-cloud].*
Expand Down
2 changes: 1 addition & 1 deletion packages/logging/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @google-cloud/logging ([Beta][versioning])
# @google-cloud/logging ([GA][versioning])
> Google Stackdriver Logging Client Library for Node.js
This module allows you to work with the Stackdriver Logging API. If you are already using [`winston`][winston]
Expand Down

0 comments on commit 6622fbd

Please sign in to comment.