The document discusses using the Fog gem to interact with cloud infrastructure providers through a unified interface. It provides examples of using Fog to get a list of providers and services, retrieve and create resources using collections and models, and execute requests directly against cloud APIs. Reader exercises demonstrate bootstrapping a server and executing SSH commands on the server instance.
7. The Plan
Blueprints for Willborough Home - btobin - flickr.com/photos/btobin/4456582998
8. The Plan
Yet Another Cloud Library?
Blueprints for Willborough Home - btobin - flickr.com/photos/btobin/4456582998
9. The Plan
Yet Another Cloud Library?
Blind Date
Blueprints for Willborough Home - btobin - flickr.com/photos/btobin/4456582998
10. The Plan
Yet Another Cloud Library?
Blind Date
Reader Exercises
Blueprints for Willborough Home - btobin - flickr.com/photos/btobin/4456582998
11. The Plan
Yet Another Cloud Library?
Blind Date
Reader Exercises
Next Steps
Blueprints for Willborough Home - btobin - flickr.com/photos/btobin/4456582998
33. Installation
geymus ~ ⌘ sudo gem install fog
Successfully installed fog-X.Y.Z
geymus ~ ⌘ fog
34. Installation
geymus ~ ⌘ sudo gem install fog
Successfully installed fog-X.Y.Z
geymus ~ ⌘ fog
To run as 'default', add the following to ~/.fog
:default:
:aws_access_key_id: INTENTIONALLY_LEFT_BLANK
:aws_secret_access_key: INTENTIONALLY_LEFT_BLANK
[...]
54. Collections
interface to cloud resources
#all - returns all matching resources
#new - initializes a local model
#create - provisions a new resource
#get - returns a particular resource
#reload - update to latest remote state
Star Wars Collection - ception - flickr.com/photos/ception/356449209
77. Collection #reload
update to latest remote state
>> AWS[:compute].addresses.all.reload
78. Collection #reload
update to latest remote state
>> AWS[:compute].addresses.all.reload
<Fog::AWS::Compute::Addresses ... []>
79. Models
Flying Into Boston 005 - Tilt Shift - tostie14 - flickr.com/photos/tostie14/117610830
80. Models
representation of a cloud resource
Flying Into Boston 005 - Tilt Shift - tostie14 - flickr.com/photos/tostie14/117610830
81. Models
representation of a cloud resource
#save - provision or update resource
#reload - update to latest remote state
#wait_for - poll block until timeout or true
#destroy - destroy resource
Flying Into Boston 005 - Tilt Shift - tostie14 - flickr.com/photos/tostie14/117610830
106. Requests
API Docs - thesmith - flickr.com/photos/thesmith/4574969567
107. Requests
down and dirty with specifics
API Docs - thesmith - flickr.com/photos/thesmith/4574969567
108. Requests
down and dirty with specifics
provides flexibility and power
but requires vendor specifics
API Docs - thesmith - flickr.com/photos/thesmith/4574969567
137. servers#create
>> Bluebox[:compute].servers.create
ArgumentError: image_id is required ...
>> Rackspace[:compute].servers.create
ArgumentError: image_id and name are required ...
>> Slicehost[:compute].servers.create
ArgumentError: image_id and name are required ...
different parameters, same methods
139. Simulation
make believing
your way to
better infrastructure
John Manning John’s Flight Simulator - yugen - flickr.com/photos/yugen/3119723360
140. Simulation
make believing
your way to
better infrastructure
Fog.mock!
or
⌘ FOG_MOCK=true fog
John Manning John’s Flight Simulator - yugen - flickr.com/photos/yugen/3119723360