0.2.1 • Published 6 years ago

gce-output-stream v0.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

gce-output-stream Build Status

Get a stream of output from a Google Compute Engine instance

$ npm install --save gce-output-stream
var outputStream = require('gce-output-stream')

outputStream({
  zone: 'us-central1-a',
  name: 'app-http-server'
})
.on('data', function (line) {
  // `line` is a single line of output
})

Authorization

This module uses google-auto-auth to get the required access token. If you don't meet the requirements for automatic authentication, you will need to provide the same configuration object detailed in that readme.

outputStream({
  authConfig: {
    keyFile: 'key.json'
  }
})

API

outputStream = require('gce-output-stream')

stream = outputStream(config)

  • Type: Stream

An output stream with the results of iterative calls to getSerialPortOutput. Each data event emitted is a single line.

config.name
  • Type: String
  • Required

The name of your instance.

config.zone
  • Type: String
  • Required

The name of the zone the instance is running in. (Ex: us-central1-a)

config.authClient

If you want to re-use an auth client from google-auto-auth, pass an instance here.

config.authConfig
  • Type: object
  • Optional

See authConfig.

config.port
  • Type: Number
  • Optional
  • Default: 1
config.projectId
  • Type: String
  • Optional

The projectId your instance is hosted under.

The COM or serial port to retrieve data from. Acceptable values are 1-4.