Skip to content

Commit

Permalink
merge EMR changes with upstream repo
Browse files Browse the repository at this point in the history
  • Loading branch information
rbriski committed Nov 4, 2011
2 parents 0449132 + ca78fba commit 4221127
Show file tree
Hide file tree
Showing 445 changed files with 8,986 additions and 1,029 deletions.
4 changes: 2 additions & 2 deletions README.rdoc
Expand Up @@ -105,7 +105,7 @@ geemus says: "That should give you everything you need to get started, but let m

== Contributing

* Find something you would like to work on. For suggestions look for the `easy`, `medium` and `hard` tags in the {issues}[http://github.com/geemus/fog/issues]
* Find something you would like to work on. For suggestions look for the `easy`, `medium` and `hard` tags in the {issues}[http://github.com/fog/fog/issues]
* Fork the project and do your work in a topic branch.
* Add shindo tests to prove your code works and run all the tests using `bundle exec rake`.
* Rebase your branch against geemus/fog to make sure everything is up to date.
Expand All @@ -116,7 +116,7 @@ geemus says: "That should give you everything you need to get started, but let m
Wonder how you can get a lovely fog shirt? Look no further!

* Blue shirts go to people who have contributed indirectly, great examples are writing blog posts or giving lightning talks.
* Grey shirts and a follow from @fog go to people who have made it on to the {contributors list}[https://github.com/geemus/fog/contributors] by submitting code.
* Grey shirts and a follow from @fog go to people who have made it on to the {contributors list}[https://github.com/fog/fog/contributors] by submitting code.
* Black shirts go to people who have made it on to the {collaborators list}[https://github.com/api/v2/json/repos/show/geemus/fog/collaborators] by coercing geemus into adding them.

== Additional Resources
Expand Down
19 changes: 17 additions & 2 deletions Rakefile
Expand Up @@ -98,6 +98,7 @@ end

task :nuke do
Fog.providers.each do |provider|
next if ['Vmfusion'].include?(provider)
begin
compute = Fog::Compute.new(:provider => provider)
for server in compute.servers
Expand All @@ -106,6 +107,17 @@ task :nuke do
end
rescue
end
begin
dns = Fog::DNS.new(:provider => provider)
for zone in dns.zones
for record in zone.records
record.destroy rescue nil
end
Formatador.display_line("[#{provider}] destroying zone #{zone.identity}")
zone.destroy rescue nil
end
rescue
end
end
end

Expand Down Expand Up @@ -191,8 +203,10 @@ task :changelog do
changelog << ''

require 'multi_json'
github_data = MultiJson.decode(Excon.get('http://github.com/api/v2/json/repos/show/geemus/fog').body)
data = github_data['repository'].reject {|key, value| !['forks', 'open_issues', 'watchers'].include?(key)}
github_repo_data = MultiJson.decode(Excon.get('http://github.com/api/v2/json/repos/show/fog/fog').body)
data = github_repo_data['repository'].reject {|key, value| !['forks', 'open_issues', 'watchers'].include?(key)}
github_collaborator_data = MultiJson.decode(Excon.get('http://github.com/api/v2/json/repos/show/fog/fog/collaborators').body)
data['collaborators'] = github_collaborator_data['collaborators'].length
rubygems_data = MultiJson.decode(Excon.get('https://rubygems.org/api/v1/gems/fog.json').body)
data['downloads'] = rubygems_data['downloads']
stats = []
Expand Down Expand Up @@ -236,6 +250,7 @@ task :changelog do
'Lincoln Stoll',
'Luqman Amjad',
'nightshade427',
'Patrick Debois',
'Wesley Beary'
].include?(committer)
next
Expand Down
434 changes: 434 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions docs/_layouts/default.html
Expand Up @@ -35,32 +35,32 @@ <h1>{{ page.title }}</h1>
<dl>
<dt>version</dt><dd>vX.Y.Z</dd>
<dt>install</dt><dd><code>gem install fog</code></dd>
<dt>source</dt><dd><a href="http://github.com/geemus/fog">geemus/fog</a></dd>
<dt>source</dt><dd><a href="http://github.com/fog/fog">geemus/fog</a></dd>
</dl>
</header>

<div id="main">

{{ content }}

<h2>Services</h2>
<nav>
<ul>
<li><a href="/cdn">CDN</a></li>
<li><a href="/">Home</a></li>
<li><a href="/about/structure.html">Structure</a></li>
<li><a href="/about/getting_started.html">Getting Started</a></li>
<li>&nbsp;</li>
<li><a href="/storage">Storage</a></li>
<li><a href="/compute">Compute</a></li>
<li><a href="/dns">DNS</a></li>
<li><a href="/storage">Storage</a></li>
{% for post in site.posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
<li><a href="/cdn">CDN</a></li>
</ul>
</nav>

<div id="main">

{{ content }}

<h2>About</h2>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about/contributing.html">Contributing</a></li>
<li><a href="/about/getting_started.html">Getting Started</a></li>
<li><a href="/about/press.html">Press</a></li>
<li><a href="/about/structure.html">Structure</a></li>
<li><a href="/about/supported_services.html">Supported Services</a></li>
<li><a href="/about/users.html">Users</a></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/about/contributing.markdown
Expand Up @@ -86,7 +86,7 @@ end

## Tests

Now would be a good time to write some tests to make sure what you have written works (and will continue to). I've tried a couple variations on testing in the past, but have settled on consolidated lifetime testing. These vary enough that its hard to give a single simple example, but you can see many examples in "tests/compute/requests/aws":https://github.com/geemus/fog/tree/master/tests/compute/requests/aws/.
Now would be a good time to write some tests to make sure what you have written works (and will continue to). I've tried a couple variations on testing in the past, but have settled on consolidated lifetime testing. These vary enough that its hard to give a single simple example, but you can see many examples in "tests/compute/requests/aws":https://github.com/fog/fog/tree/master/tests/compute/requests/aws/.

### Highlights:
* Reuse the same objects and take them through their whole life cycle (this is much faster, and most of the time if one portion fails the others would anyway).
Expand Down
4 changes: 2 additions & 2 deletions docs/about/getting_started.markdown
Expand Up @@ -24,7 +24,7 @@ Now in order to play with our data we need to setup a storage connection.

storage = Fog::Storage.new({
:local_root => '~/fog',
:provider => 'Local',
:provider => 'Local'
})

`storage` will now contain our storage object, configured to use the Local provider from our specified directory.
Expand All @@ -33,7 +33,7 @@ Now in order to play with our data we need to setup a storage connection.

Now that you have cleared the preliminaries you are ready to start storing data. Storage providers in fog segregate files into `directories` to make it easier to organize things. So lets create a directory so we can see that in action.

directory = Fog::Storage.directories.create(
directory = storage.directories.create(
:key => 'data'
)

Expand Down
4 changes: 4 additions & 0 deletions docs/about/press.markdown
Expand Up @@ -5,6 +5,10 @@ title: Press

Mentions and blog posts from elsewhere in reverse chronological order by day (and alphasorted for same days).

**September 13th, 2011**

* [Libvirt support for fog](http://jedi.be/blog/2011/09/13/libvirt-fog-provider/)

**August 1st, 2011**

* [Using EBS Snapshots with Fog](http://www.mediamolecule.com/lab/article/using_ebs_snapshots_with_fog/)
Expand Down
8 changes: 4 additions & 4 deletions docs/dns/index.markdown
Expand Up @@ -41,23 +41,23 @@ Now that you have a zone you will need to update your registrar to let them know
With your new zone in hand you can add records as needed. First and foremost you will probably want the 'www' version of your site to point to whatever your ip might be:

record = @zone.records.create(
:ip => '1.2.3.4',
:value => '1.2.3.4',
:name => 'example.com',
:type => 'A'
)

Adding other records is similarly easy, for instance if we want 'www.example.com' to go to the same place, we can use a cname record:

record = @zone.records.create(
:ip => 'example.com',
:value => 'example.com',
:name => 'www',
:type => 'CNAME'
)

Or, similarly you might want to have your blog elsewhere:

record = @zone.records.create(
:ip => '4.3.2.1',
:value => '4.3.2.1',
:name => 'blog.example.com',
:type => 'A'
)
Expand All @@ -76,4 +76,4 @@ If you already have an account with another service you can just as easily use t

## Go Forth and Resolve

You can see an example of reusing code like this in the <a href="https://github.com/geemus/fog/blob/master/examples/dns_tests.rb">examples folder</a>. Using this makes it easier to give yourself shortcuts to your cloud servers and manage how clients and users access them as well. It is great to have this flexibility so that you can modify your cloud infrastructure as needed while keeping everything ship shape. It also provides a nice way to create custom subdomains for users and just generally round out your cloud solution.
You can see an example of reusing code like this in the <a href="https://github.com/fog/fog/blob/master/examples/dns_tests.rb">examples folder</a>. Using this makes it easier to give yourself shortcuts to your cloud servers and manage how clients and users access them as well. It is great to have this flexibility so that you can modify your cloud infrastructure as needed while keeping everything ship shape. It also provides a nice way to create custom subdomains for users and just generally round out your cloud solution.
8 changes: 4 additions & 4 deletions docs/index.markdown
Expand Up @@ -42,7 +42,7 @@ geemus says: "That should give you everything you need to get started, but let m

## Contributing

* Find something you would like to work on. For suggestions look for the `easy`, `medium` and `hard` tags in the [issues](http://github.com/geemus/fog/issues)
* Find something you would like to work on. For suggestions look for the `easy`, `medium` and `hard` tags in the [issues](http://github.com/fog/fog/issues)
* Fork the project and do your work in a topic branch.
* Add shindo tests to prove your code works and run all the tests using `bundle exec rake`.
* Rebase your branch against geemus/fog to make sure everything is up to date.
Expand All @@ -53,8 +53,8 @@ geemus says: "That should give you everything you need to get started, but let m
Wonder how you can get a lovely fog shirt? Look no further!

* Blue shirts go to people who have contributed indirectly, great examples are writing blog posts or giving lightning talks.
* Grey shirts and a follow from @fog go to people who have made it on to the [contributors list](https://github.com/geemus/fog/contributors) by submitting code.
* Black shirts go to people who have made it on to the [collaborators list](https://github.com/api/v2/json/repos/show/geemus/fog/collaborators) by coercing geemus into adding them (geemus is currently the only member of this list).
* Grey shirts and a follow from @fog go to people who have made it on to the [contributors list](https://github.com/fog/fog/contributors) by submitting code.
* Black shirts go to people who have made it on to the [collaborators list](https://github.com/api/v2/json/repos/show/geemus/fog/collaborators) by coercing geemus into adding them.

## Resources

Expand All @@ -65,7 +65,7 @@ Enjoy, and let me know what I can do to continue improving fog!
* Stay up to date by following [@fog](http://twitter.com/fog) and/or [@geemus](http://twitter.com/geemus) on Twitter.
* Get and give help on the [#ruby-fog](irc://irc.freenode.net/ruby-fog) irc channel on Freenode
* Follow release notes and discussions on the [mailing list](http://groups.google.com/group/ruby-fog)
* Report bugs or find tasks to help with in the [issues](http://github.com/geemus/fog/issues)
* Report bugs or find tasks to help with in the [issues](http://github.com/fog/fog/issues)
* Learn about [contributing](/about/contributing.html)
* See where fog is used and let the world know how you use it [in the wild](/about/users.html)
* Check out blog posts and other mentions in the [press](/about/press.html)
Expand Down
15 changes: 14 additions & 1 deletion docs/public/css/fog.css
Expand Up @@ -56,7 +56,7 @@ header dl dt {
font-weight: bold;
}

#main {
nav, #main {
background-color: #FFF;
-moz-border-radius: 0.5em;
border-radius: 0.5em;
Expand All @@ -66,6 +66,19 @@ header dl dt {
margin-bottom: 2em;
}

nav {
padding: 1em;
}

nav li {
display: inline;
padding-left: 2em;
}

nav li a {
font-size: 1.5em;
}

footer {
background-color: #A0C0E1;
border-color: #70A1D2;
Expand Down
4 changes: 2 additions & 2 deletions docs/storage/index.markdown
Expand Up @@ -5,13 +5,13 @@ title: Storage

Having Ruby experience makes you hirable; but how can you stand out? You need to demonstrate your abilities. What better way than using Ruby and "the cloud" to store and serve your resume!

In this blog post you will learn to use <a href="http://github.com/geemus/fog">fog</a> - the cloud computing library - to upload your resume to Amazon's <a href="http://aws.amazon.com/s3/">Simple Storage Service</a> (S3), Rackspace's <a href="http://www.rackspacecloud.com/cloud_hosting_products/files">CloudFiles</a> or Google's <a href="http://code.google.com/apis/storage/">Storage for Developers</a>.
In this blog post you will learn to use <a href="http://github.com/fog/fog">fog</a> - the cloud computing library - to upload your resume to Amazon's <a href="http://aws.amazon.com/s3/">Simple Storage Service</a> (S3), Rackspace's <a href="http://www.rackspacecloud.com/cloud_hosting_products/files">CloudFiles</a> or Google's <a href="http://code.google.com/apis/storage/">Storage for Developers</a>.

Here's my out of date resume stored on <a href="http://geemus.s3.amazonaws.com/resume.html">S3</a>, <a href="http://c0023559.cdn2.cloudfiles.rackspacecloud.com/resume.html">CloudFiles</a> and <a href="https://geemus.commondatastorage.googleapis.com/resume.html">Google Storage</a>; programmatically stored in the cloud using this tutorial. NOTE: my boss would like me to add that I'm not currently looking for a new gig ;)

Check out those cloud-specific URLs! You could put all three in your job application, add the Ruby source for how you did it, and have your choice of Ruby jobs for being so awesome!

How? The all-clouds-in-one library of choice is <a href="https://github.com/geemus/fog">fog</a>.
How? The all-clouds-in-one library of choice is <a href="https://github.com/fog/fog">fog</a>.

## Installing fog

Expand Down
10 changes: 5 additions & 5 deletions fog.gemspec
Expand Up @@ -6,21 +6,21 @@ Gem::Specification.new do |s|
## If your rubyforge_project name is different, then edit it and comment out
## the sub! line in the Rakefile
s.name = 'fog'
s.version = '0.11.0'
s.date = '2011-08-18'
s.version = '1.0.0'
s.date = '2011-09-29'
s.rubyforge_project = 'fog'

## Make sure your summary is short. The description may be as long
## as you like.
s.summary = "brings clouds to you"
s.description = "The Ruby cloud services library."
s.description = "The Ruby cloud services library. Supports all major cloud providers including AWS, Rackspace, Linode, Blue Box, StormOnDemand, and many others. Full support for most AWS services including EC2, S3, CloudWatch, SimpleDB, ELB, and RDS."

## List the primary authors. If there are a bunch of authors, it's probably
## better to set the email to an email list or something. If you don't have
## a custom homepage, consider using your GitHub URL or the like.
s.authors = ["geemus (Wesley Beary)"]
s.email = 'geemus@gmail.com'
s.homepage = 'http://github.com/geemus/fog'
s.homepage = 'http://github.com/fog/fog'

## This sections is only necessary if you have C extensions.
# s.require_paths << 'ext'
Expand All @@ -37,7 +37,7 @@ Gem::Specification.new do |s|
## List your runtime dependencies here. Runtime dependencies are those
## that are needed for an end user to actually USE your code.
s.add_dependency('builder')
s.add_dependency('excon', '~>0.6.5')
s.add_dependency('excon', '~>0.7.4')
s.add_dependency('formatador', '~>0.2.0')
s.add_dependency('multi_json', '~>1.0.3')
s.add_dependency('mime-types')
Expand Down
2 changes: 1 addition & 1 deletion lib/fog.rb
Expand Up @@ -3,7 +3,7 @@
module Fog

unless const_defined?(:VERSION)
VERSION = '0.11.0'
VERSION = '1.0.0'
end

end
Expand Down
33 changes: 18 additions & 15 deletions lib/fog/aws.rb
Expand Up @@ -5,21 +5,22 @@ module AWS

extend Fog::Provider

service(:auto_scaling, 'aws/auto_scaling')
service(:cdn, 'aws/cdn')
service(:compute, 'aws/compute')
service(:cloud_formation, 'aws/cloud_formation')
service(:cloud_watch, 'aws/cloud_watch')
service(:dns, 'aws/dns')
service(:elb, 'aws/elb')
service(:emr, 'aws/emr')
service(:iam, 'aws/iam')
service(:rds, 'aws/rds')
service(:ses, 'aws/ses')
service(:simpledb, 'aws/simpledb')
service(:sns, 'aws/sns')
service(:sqs, 'aws/sqs')
service(:storage, 'aws/storage')
service(:auto_scaling, 'aws/auto_scaling', 'AutoScaling')
service(:cdn, 'aws/cdn', 'CDN')
service(:compute, 'aws/compute', 'Compute')
service(:cloud_formation, 'aws/cloud_formation', 'CloudFormation')
service(:cloud_watch, 'aws/cloud_watch', 'CloudWatch')
service(:dns, 'aws/dns', 'DNS')
service(:elasticache, 'aws/elasticache', 'Elasticache')
service(:elb, 'aws/elb', 'ELB')
service(:emr, 'aws/emr', 'EMR')
service(:iam, 'aws/iam', 'IAM')
service(:rds, 'aws/rds', 'RDS')
service(:ses, 'aws/ses', 'SES')
service(:simpledb, 'aws/simpledb', 'SimpleDB')
service(:sns, 'aws/sns', 'SNS')
service(:sqs, 'aws/sqs', 'SQS')
service(:storage, 'aws/storage', 'Storage')

def self.indexed_param(key, values)
params = {}
Expand Down Expand Up @@ -202,6 +203,8 @@ def self.request_id
class << self
alias :reserved_instances_id :request_id
alias :reserved_instances_offering_id :request_id
alias :sqs_message_id :request_id
alias :sqs_sender_id :request_id
end

def self.reservation_id
Expand Down
1 change: 1 addition & 0 deletions lib/fog/aws/cloud_formation.rb
Expand Up @@ -9,6 +9,7 @@ class CloudFormation < Fog::Service

request_path 'fog/aws/requests/cloud_formation'
request :create_stack
request :update_stack
request :delete_stack
request :describe_stack_events
request :describe_stack_resources
Expand Down
14 changes: 14 additions & 0 deletions lib/fog/aws/cloud_watch.rb
Expand Up @@ -13,12 +13,26 @@ class CloudWatch < Fog::Service
request :list_metrics
request :get_metric_statistics
request :put_metric_data
request :describe_alarms
request :put_metric_alarm
request :delete_alarms
request :describe_alarm_history
request :enable_alarm_actions
request :disable_alarm_actions
request :describe_alarms_for_metric
request :set_alarm_state

model_path 'fog/aws/models/cloud_watch'
model :metric
collection :metrics
model :metric_statistic
collection :metric_statistics
model :alarm_datum
collection :alarm_data
model :alarm_history
collection :alarm_histories
model :alarm
collection :alarms

class Mock

Expand Down

0 comments on commit 4221127

Please sign in to comment.