cloudhealth / amazon-pricing Goto Github PK
View Code? Open in Web Editor NEWA Ruby library for retrieving pricing for Amazon Web Services
License: Other
A Ruby library for retrieving pricing for Amazon Web Services
License: Other
See pull request #45
Hello,
It seems currently the script scrapes only MySQL pricing from the GovCloud pricing page.
Is it possible to fix it to gather prices for the rest of the databases?
For types db.m2.xlarge, db.m2.2xlarge, db.m2.4xlarge, and db.cr1.8xl the pricing gem is not correctly identifying the on-demand multi-AZ prices. The gem's single-AZ prices get overwritten by the correct multi-AZ ones, while the gem's multi-AZ prices are never populated.
I was able to fix this by adjusting line 254 of amazon-pricing.rb --
if url.include?("multiAZ")
is_multi_az = true
else
is_multi_az = is_multi_az? type["name"]
end
The URL include? hack replaces the Oracle-only URL hack that was already there. I've verified that this fixes on-demand pricing for these instance types, but I haven't checked it against the other rate types as that's outside my concern. But I hope someone can replace this hack with something a little more elegant.
mechinize should be required by gemspec
Is it possible to use this gem to get info on the current amount spent?
Do you guys have any example code that works?
There seems to be a problem with the new eu-central-1 region.
[10] pry(main)> AwsPricing::VERSION
"0.1.54"
[11] pry(main)> AwsPricing::Ec2PriceList.new
WARNING: new reserved instances not found for m1.small in eu-central-1
WARNING: new reserved instances not found for m1.medium in eu-central-1
WARNING: new reserved instances not found for m1.large in eu-central-1
WARNING: new reserved instances not found for m1.xlarge in eu-central-1
WARNING: new reserved instances not found for c1.medium in eu-central-1
WARNING: new reserved instances not found for c1.xlarge in eu-central-1
WARNING: new reserved instances not found for cc2.8xlarge in eu-central-1
WARNING: new reserved instances not found for cg1.4xlarge in eu-central-1
WARNING: new reserved instances not found for m2.xlarge in eu-central-1
WARNING: new reserved instances not found for m2.2xlarge in eu-central-1
WARNING: new reserved instances not found for m2.4xlarge in eu-central-1
WARNING: new reserved instances not found for cr1.8xlarge in eu-central-1
WARNING: new reserved instances not found for hi1.4xlarge in eu-central-1
WARNING: new reserved instances not found for t1.micro in eu-central-1
WARNING: new reserved instances not found for m1.small in eu-central-1
WARNING: new reserved instances not found for m1.medium in eu-central-1
WARNING: new reserved instances not found for m1.large in eu-central-1
WARNING: new reserved instances not found for m1.xlarge in eu-central-1
WARNING: new reserved instances not found for c1.medium in eu-central-1
WARNING: new reserved instances not found for c1.xlarge in eu-central-1
WARNING: new reserved instances not found for cc2.8xlarge in eu-central-1
WARNING: new reserved instances not found for cg1.4xlarge in eu-central-1
WARNING: new reserved instances not found for m2.xlarge in eu-central-1
WARNING: new reserved instances not found for m2.2xlarge in eu-central-1
WARNING: new reserved instances not found for m2.4xlarge in eu-central-1
WARNING: new reserved instances not found for cr1.8xlarge in eu-central-1
WARNING: new reserved instances not found for hi1.4xlarge in eu-central-1
WARNING: new reserved instances not found for t1.micro in eu-central-1
WARNING: new reserved instances not found for m1.small in eu-central-1
WARNING: new reserved instances not found for m1.medium in eu-central-1
WARNING: new reserved instances not found for m1.large in eu-central-1
WARNING: new reserved instances not found for m1.xlarge in eu-central-1
WARNING: new reserved instances not found for c1.medium in eu-central-1
WARNING: new reserved instances not found for c1.xlarge in eu-central-1
WARNING: new reserved instances not found for cc2.8xlarge in eu-central-1
WARNING: new reserved instances not found for cg1.4xlarge in eu-central-1
WARNING: new reserved instances not found for m2.xlarge in eu-central-1
WARNING: new reserved instances not found for m2.2xlarge in eu-central-1
WARNING: new reserved instances not found for m2.4xlarge in eu-central-1
WARNING: new reserved instances not found for cr1.8xlarge in eu-central-1
WARNING: new reserved instances not found for hi1.4xlarge in eu-central-1
WARNING: new reserved instances not found for t1.micro in eu-central-1
WARNING: new reserved instances not found for m1.small in eu-central-1
WARNING: new reserved instances not found for m1.medium in eu-central-1
WARNING: new reserved instances not found for m1.large in eu-central-1
WARNING: new reserved instances not found for m1.xlarge in eu-central-1
WARNING: new reserved instances not found for c1.medium in eu-central-1
WARNING: new reserved instances not found for c1.xlarge in eu-central-1
WARNING: new reserved instances not found for cc2.8xlarge in eu-central-1
WARNING: new reserved instances not found for cg1.4xlarge in eu-central-1
WARNING: new reserved instances not found for m2.xlarge in eu-central-1
WARNING: new reserved instances not found for m2.2xlarge in eu-central-1
WARNING: new reserved instances not found for m2.4xlarge in eu-central-1
WARNING: new reserved instances not found for cr1.8xlarge in eu-central-1
WARNING: new reserved instances not found for hi1.4xlarge in eu-central-1
WARNING: new reserved instances not found for t1.micro in eu-central-1
WARNING: new reserved instances not found for m1.small in eu-central-1
WARNING: new reserved instances not found for m1.medium in eu-central-1
WARNING: new reserved instances not found for m1.large in eu-central-1
WARNING: new reserved instances not found for m1.xlarge in eu-central-1
WARNING: new reserved instances not found for c1.medium in eu-central-1
WARNING: new reserved instances not found for c1.xlarge in eu-central-1
WARNING: new reserved instances not found for cc2.8xlarge in eu-central-1
WARNING: new reserved instances not found for cg1.4xlarge in eu-central-1
WARNING: new reserved instances not found for m2.xlarge in eu-central-1
WARNING: new reserved instances not found for m2.2xlarge in eu-central-1
WARNING: new reserved instances not found for m2.4xlarge in eu-central-1
WARNING: new reserved instances not found for cr1.8xlarge in eu-central-1
WARNING: new reserved instances not found for hi1.4xlarge in eu-central-1
WARNING: new reserved instances not found for t1.micro in eu-central-1
WARNING: new reserved instances not found for m1.small in eu-central-1
WARNING: new reserved instances not found for m1.medium in eu-central-1
WARNING: new reserved instances not found for m1.large in eu-central-1
WARNING: new reserved instances not found for m1.xlarge in eu-central-1
WARNING: new reserved instances not found for c1.medium in eu-central-1
WARNING: new reserved instances not found for c1.xlarge in eu-central-1
WARNING: new reserved instances not found for cc2.8xlarge in eu-central-1
WARNING: new reserved instances not found for cg1.4xlarge in eu-central-1
WARNING: new reserved instances not found for m2.xlarge in eu-central-1
WARNING: new reserved instances not found for m2.2xlarge in eu-central-1
WARNING: new reserved instances not found for m2.4xlarge in eu-central-1
WARNING: new reserved instances not found for cr1.8xlarge in eu-central-1
WARNING: new reserved instances not found for hi1.4xlarge in eu-central-1
WARNING: new reserved instances not found for t1.micro in eu-central-1
fetch_ec2_instance_pricing] WARNING: encountered Unknown instance type generalCurrentGen m4.16xlarge
[fetch_ec2_instance_pricing] WARNING: encountered Unknown instance type generalCurrentGen m4.16xlarge
[fetch_ec2_instance_pricing] WARNING: encountered Unknown instance type generalCurrentGen m4.16xlarge
AwsPricing::UnknownTypeError: Unknown instance type m4.16xlarge
it start giveing exception since last few hours it was working earler ?
Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Bundler now generates gems with a default 'MIT' license. There is even a License Finder
to help companies ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.
If you need help choosing a license, github has created a license picker tool
How did I find you?
I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for gemspecs not specifying a license as a public service :)
So far it's going pretty well.
I've written a blog post about it
/worker/bundle/ruby/2.1.0/gems/amazon-pricing-0.1.63/lib/amazon-pricing/aws-price-list.rb:53:in `get_instance_type': Region us-east-1a not found (RuntimeError)
Availability zone on return server is: availability_zone="us-east-1a"
When clicking on the (current) badge in the README:
The resulting page says:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.
I have never used this tool nor have access to the project page, so I do not have much more details to provide.
Is there any particular benefit of using this gem instead of the official pricing gem vended from AWS?
Copied code exactly from your blog post example: http://www.hightechinthehub.com/2012/03/programmatically-retrieving-aws-pricing/
Got this:
/worker/bundle/ruby/2.1.0/gems/amazon-pricing-0.1.63/lib/amazon-pricing/aws-price-list.rb:51:in `get_instance_type': wrong number of arguments (3 for 2) (ArgumentError)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.