lib/spotspec.js
function SpotSpec (options) {
  if (this.constructor.name === 'Object') {
    throw new Error('Object must be instantiated using new')
  }
  let self = this
  let specOptions = Object.assign({}, options)

  // Have the superclass constuct as an EC2 service
  Service.call(this, SvcAws.EC2, specOptions)

  this.logger.info('Loading EC2 for: ' + specOptions.keys.region)

  this.once(Const.EVENT_INITIALIZED, function onComplete (err, data) {
    /**
    * Emitted as the response to constuct SpotSpec
    * @event SpotSpec#initialized
    * @param {?error} err - Only on error
    * @param {object} [initData] - Null on error
    */
    Intern.emitAsync.call(self, Const.EVENT_INITIALIZED, err, data)
  })
}
function SpotSpec (options) {
  if (this.constructor.name === 'Object') {
    throw new Error('Object must be instantiated using new')
  }
  let self = this
  let specOptions = Object.assign({}, options)

  // Have the superclass constuct as an EC2 service
  Service.call(this, SvcAws.EC2, specOptions)

  this.logger.info('Loading EC2 for: ' + specOptions.keys.region)

  this.once(Const.EVENT_INITIALIZED, function onComplete (err, data) {
    /**
    * Emitted as the response to constuct SpotSpec
    * @event SpotSpec#initialized
    * @param {?error} err - Only on error
    * @param {object} [initData] - Null on error
    */
    Intern.emitAsync.call(self, Const.EVENT_INITIALIZED, err, data)
  })
}
function SpotSpec ( options ) { if ( this . constructor . name === 'Object' ) { throw new Error ( 'Object must be instantiated using new' ) } let self = this let specOptions = Object . assign ( { } , options ) // Have the superclass constuct as an EC2 service Service . call ( this , SvcAws . EC2 , specOptions ) this . logger . info ( 'Loading EC2 for: ' + specOptions . keys . region ) this . once ( Const . EVENT_INITIALIZED , function onComplete ( err , data ) { /**
    * Emitted as the response to constuct SpotSpec
    * @event SpotSpec#initialized
    * @param {?error} err - Only on error
    * @param {object} [initData] - Null on error
    */ Intern . emitAsync . call ( self , Const . EVENT_INITIALIZED , err , data ) } ) }
Constructs a new SpotSpec Library
@constructor
@arg {object} options - The AWS service IAM credentials - See [aws docs]{@link http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html}
@arg {object} options.keys - AWS credentials
@arg {string} options.keys.accessKeyId - AWS access key ID
@arg {string} options.keys.secretAccessKey - AWS secret access key.
@arg {string} options.keys.region - The EC2 region to send service requests
@arg {object} options.upgrade - Temporary Session Token credentials - See [aws docs]{@link http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#getSessionToken-property}
@arg {string} options.upgrade.serialNumber - Identifies the user's hardware or virtual MFA device.
@arg {string} options.upgrade.tokenCode - Time-based one-time password (TOTP) that the MFA devices produces
@arg {number} [options.upgrade.durationSeconds=900] - How long the temporary key will last
@arg {boolean} [options.isLogging=false] - Use internal logging
@throws {error}
@emits {SpotSpec#initialized}
Constructs a new SpotSpec Library