Extensions to the Joyent Smart Datacenter API for the financially minded.
Extensions to the Joyent Smart Datacenter API for the financially minded.
npm install smartdc-cost -g
sdc-listmachines-cost
Options
human
or json
alphabetical
or price
hour
, day
, month
, or year
--format=human
flagsdc-listmachines-cost
{
totals: {
hour: '0.12',
day: '3.12'
month: '82.80',
year: '1051.20'
},
devices:
[ { name: 'Host1',
ip: '123.123.123.123',
type: 'Extra Small 512 MB',
prices: {
day: '0.72',
year: '262.80',
month: '22.32',
hour: '0.03' }
},
{ name: 'Host2',
ip: '156.156.156.156',
type: 'Small 1GB',
prices: {
day: '2.04',
year: '744.60',
month: '61.20',
hour: '0.085' }
},
]
}
sdc-listmachines-cost --format=human --sort=price --period=day
Devices:
> Host2 @ 156.156.156.156 (Small 1GB) => $2.04/day
> Host1 @ 123.123.123.123 (Extra Small 512 MB) => $0.72/day
Total:
> $0.12/hr
> $3.12/day
> $82.80/month
> $1051.20/year
Prices for current images are retrived from Joyent's public listing. There are some packages which joyent no longer lists prices for. These prices are either coppied from earlier data, or assumed based on the most similar current package. These prices are stored in /lib/old-prices.json
. If prices are returned from Joyent's public listing, those results will be used rather than those in old-prices.json
All prices are for open-source servers (smartOS, Ubuntu, etc). The prices of your induvidual machines will be higher than listed for licensed servers (windows, zeus, etc).
Currently, the binary package(s) assume you will be running the commands from bash, and have the following environment variables set for the normal smartdc API:
SDC_URL
url for the Joyent API (something like https://us-sw-1.api.joyentcloud.com/
)SDC_ACCOUNT
your joyent account nameSDC_KEY_ID
the fingerprint of your SSH keyIf you are upgrading from smartdc
v6x, note the name change for the required ENV variables, and click visit https://npmjs.org/package/smartdc to learn how to generate your ssh fingerprint