Skip to content

Latest commit

 

History

History
211 lines (163 loc) · 9.79 KB

index.md

File metadata and controls

211 lines (163 loc) · 9.79 KB

SpotSpec

new SpotSpec(options)

Constructs a new SpotSpec Library

Throws:

  • error
Param Type Default Description
options object The AWS service IAM credentials - See aws docs
options.keys object AWS credentials
options.keys.accessKeyId string AWS access key ID
options.keys.secretAccessKey string AWS secret access key.
options.keys.region string The EC2 region to send service requests
options.upgrade object Temporary Session Token credentials - See aws docs
options.upgrade.serialNumber string Identifies the user's hardware or virtual MFA device.
options.upgrade.tokenCode string Time-based one-time password (TOTP) that the MFA devices produces
[options.upgrade.durationSeconds] number 900 How long the temporary key will last
[options.isLogging] boolean false Use internal logging

spotSpec.prices(options)

prices - Request the latest spot prices

Kind: instance method of SpotSpec
Emits: priced

Param Type Default Description
options object JSON options to request current price
poptions.type string The instance type to be priced e.g. m3.medium
[options.InstanceTypes] Array.<string> Array of instance types to be priced
[options.product] string The ProductDescriptions, e.g. 'Windows'
[options.ProductDescriptions] Array.<string> Array of ProductDescriptions, e.g. 'Windows'
[options.dryRun] boolean false Only verify parameters.
[options.isLogging] boolean false

spotSpec.launch(options)

Launch a spot instance

Kind: instance method of SpotSpec
Throws:

  • error

Emits: launched

Param Type Default Description
options object JSON options to request a spot instance
options.ami string The amazon machine image name
options.type string The amazon Instance Type e.g. m3.medium
options.price string The maximum price limit
options.keyName string The name of the key pair needed to access the launched instance. See user guide
[options.dryRun] boolean false Only verify launch parameters. if TRUE, do not launch an instance
[options.count] number 1 The InstanceCount number to launch
[options.securityGroupIds] Array.<string> Array of one or more security group ids. See user guide
[options.securityGroups] Array.<string> Array of one or more security group names. See user guide
[options.userData] string cloud-init base64-encoded text. See user guide
options.launchSpecification object JSON of any additional launch specification. See api guide

spotSpec.describeRequests(options)

describeRequests - Describe the status of all current spot requests See aws docs

Kind: instance method of SpotSpec
Emits: priced

Param Type Default Description
options object JSON options to request current price
[options.dryRun] boolean false Only verify parameters.

spotSpec.describeInstances(options, instanceIds)

Describe the status of all running instance.

Kind: instance method of SpotSpec
Emits: {SpotSpec#event:Reservations[]} Array of EC2 instances

Param Type Default Description
options object JSON options to request current price
[options.dryRun] boolean false Only verify parameters
instanceIds Array.<string> Array of instance ids to search

spotSpec.terminateInstances(options, [instanceIds])

Terminate an instance

Kind: instance method of SpotSpec
Emits: terminated

Param Type Default Description
options object JSON options to request current price
[instanceIds] Array.<string> Array of instance ids to terminate
[options.dryRun] boolean false Only verify parameters.

spotSpec.cancelSpotRequest(options, [spotInstanceRequestIds])

Cancel a spot request

Kind: instance method of SpotSpec
Emits: canceled

Param Type Default Description
options object JSON options to request current price
[spotInstanceRequestIds] Array.<string> Array of instance ids to terminate
[options.dryRun] boolean false Only verify parameters.

"initialized" (err, [initData])

Emitted as the response to constuct SpotSpec

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
[initData] object Null on error

"priced" (err, [priceData])

Emitted as the response to a prices request

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
[priceData] Array.<SpotSpec#SpotPriceHistory> Null on error

"launched" (err, [launchData])

Emitted as the response to a launch request

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
[launchData] object Null on error

"requests" (err, [spotInstanceRequests])

Emitted as the response to a describe requests 'request'

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
[spotInstanceRequests] Array.<SpotSpec#SpotInstanceRequests> Null on error

"instances" (err, [instances])

Emitted as the response to a describe instances request

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
[instances] Array.<SpotSpec#reservations> Null on error

"terminated" (err)

Emitted as the response to a terminate request

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
Array.<SpotSpec#TerminatingInstances> Null on error

"canceled" (err)

Emitted as the response to a cancel request

Kind: event emitted by SpotSpec

Param Type Description
err error Only on error
Array.<SpotSpec#CancelledSpotInstanceRequests> Null on error