- SpotSpec
- new SpotSpec(options)
- .prices(options)
- .launch(options)
- .describeRequests(options)
- .describeInstances(options, instanceIds)
- .terminateInstances(options, [instanceIds])
- .cancelSpotRequest(options, [spotInstanceRequestIds])
- "initialized" (err, [initData])
- "priced" (err, [priceData])
- "launched" (err, [launchData])
- "requests" (err, [spotInstanceRequests])
- "instances" (err, [instances])
- "terminated" (err)
- "canceled" (err)
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 |
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 |
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 |
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. |
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 |
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. |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |