7. Compute
Connects to the Openstack Nova API for managing
Instances (Servers), Security Groups, Floating IPs, etc
http://rubydoc.info/gems/fog/1.9.0/Fog/Compute/OpenStack
8. Identity
Connects to the Openstack Keystone API for managing Users, Tenants and Authentication
http://rubydoc.info/gems/fog/1.9.0/Fog/Identity/OpenStack
9. Volumes
Connects to the Openstack Nova/Cinder API for managing Block Storage
http://rubydoc.info/gems/fog/1.9.0/Fog/Volume/OpenStack
10. Images
Connects to the Openstack Glance API for managing VM Images and Snapshots
http://rubydoc.info/gems/fog/1.9.0/Fog/Images/OpenStack
11. Storage
Connects to the Openstack Swift API for managing Object Storage
http://rubydoc.info/gems/fog/1.9.0/Fog/Storage/OpenStack
12. Network
Connects to the Openstack Quantum API for managing Networks
http://rubydoc.info/gems/fog/1.9.0/Fog/Network/OpenStack
18. Real (Example)
class Real
def list_flavors
request(
:expects => [200, 203],
:method => 'GET',
:path => 'flavors.json'
)
end
end
19. Models
• Ruby Object representation of a Cloud
Service Entity (Instance, Image, etc)
• Uses one or many ‘Request’ methods to
retrieve data about an Entity
• Includes convenience methods for easy
access
21. Collections
• Ruby Object representation of many groups of
Cloud Service Entities (Instances, Images,
etc)
• Handles querying and iteration of multiple
models of a single type
22. Collections (Example)
class Servers < Fog::Collection
model Fog::Compute::OpenStack::Server
def all(filters = filters)
self.filters = filters
data = service.list_servers_detail(filters).body['servers']
load(data)
end
def get(server_id)
if server = service.get_server_details(server_id).body['server']
new(server)
end
rescue Fog::Compute::OpenStack::NotFound
nil
end
end
23. Collection Servers
Models Server Server Server Server
25. • service.unscoped_token
• The reusable token which can be used to retrieve scoped tokens “auth_token” on each
tenant.
• service.auth_token
• The current authentication token sent to OpenStack on each request as a header (“X-
Auth-Token”).
• service.current_user
• The Hash representation of the JSON returned information about the current user
returned by OpenStack upon authentication.
• service.current_tenant
• The Hash representation of the JSON returned information about the current tenant
returned by OpenStack upon authentication.
• service.credentials
• A convenience method to extract needed credentials to easily instantiate a new usable
service object. The new service object uses the “auth_token” returned by the
OpenStack API and not the provided username and password originally used for
authentication.