1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

fixing merge issues

This commit is contained in:
Kyle Rames 2013-03-11 16:02:00 -05:00
parent 05282866de
commit 15f04b2448
134 changed files with 3264 additions and 1527 deletions

View file

@ -1,3 +1,3 @@
source "http://rubygems.org"
source "https://rubygems.org"
gemspec

View file

@ -1,3 +1,746 @@
1.10.0 03/05/2013 2f30de2ab357a5bbdb505b94ada8aa637ba936f5
==========================================================
Stats! { 'collaborators' => 45, 'downloads' => 1813647, 'forks' => 720, 'open_issues' => 117, 'watchers' => 2386 }
MVP! Rupak Ganguly
[Brightbox]
Adds update firewall request. thanks Paul Thornthwaite
Adds compatibility mode to template. thanks Paul Thornthwaite
Updates to requests. thanks Paul Thornthwaite
[Glesys]
Template list request does not take options. thanks Simon Gate
Only make one request when fetching templates. thanks Simon Gate
Fix template attributes, now they work. thanks Simon Gate
Attribute :keepip removed from server model. thanks Simon Gate
Clean up attributes on server model. thanks Simon Gate
Add public_ip_method to server model. thanks Simon Gate
Add setup method to copy fog ssh keys to server. thanks Simon Gate
Wrap ssh method to use rootpassword if present. thanks Simon Gate
[HP]
Add BlockStorage provider and add volumes and snapshots support. Add support for bootable volumes, persistent server, cross-tenant acls and temp urls. Add support for Windows instances. Merge the latest code from fog 1.9.0 release. thanks Rupak Ganguly
[HP|storage]
Fix generate_object_temp_url to use signer that is backward compatible to 1.8.7. thanks Rupak Ganguly
[Rackspace|Compute]
fixed issue with bootstrap method where server was ready, but it had not received an ipv4 address yet. Added check for ip address in server ready block as well as a timeout parameter. thanks Kyle Rames
[Rackspace|Storage]
This tests consistently fails on either ruby 1.8.7 or ruby 1.9.3 because hash order is indeterminate. I believe the spirt of this test is to ensure that only one header value is generated and thus I have updated the test to reflect that. thanks Kyle Rames
[aws]
Fixes typo in fetching credentials error. thanks Paul Thornthwaite
Fixes security group template. thanks Paul Thornthwaite
[aws|compute]
Fixes schema in image tests. thanks Paul Thornthwaite
[aws|dynamodb]
fix port to match https default closes #1531. thanks geemus
[aws|rds]
remove some superfluous reloads, hopefully help with travis test timing issues. thanks geemus
[aws|storage]
Fixes Yard tags. thanks Paul Thornthwaite
[bluebox|blb]
clean up, define types returned. thanks Josh Yotty
some cleanup of model stubs. thanks Josh Yotty
add model to application and server collections. thanks Josh Yotty
require model. thanks Josh Yotty
require model. thanks Josh Yotty
fix more stub/copypaste inanity. thanks Josh Yotty
lb_service collection implementation. thanks Josh Yotty
service must be passed from caller. thanks Josh Yotty
atone for additional sins in the lb service and backend models. thanks Josh Yotty
add last set of index requests for lb_machines. thanks Josh Yotty
add_machine. thanks Josh Yotty
rename for consistency. thanks Josh Yotty
typo, whitespace. thanks Josh Yotty
lb_machine API coverage. thanks Josh Yotty
missing end. thanks Josh Yotty
testing stubs. thanks Josh Yotty
rename to tests, plural. thanks Josh Yotty
more request tests, missing comma. thanks Josh Yotty
parsing is hard, let's go shopping. thanks Josh Yotty
account for text/plain endpoint. thanks Josh Yotty
update tests. thanks Josh Yotty
[core]
Uses Logger deprecation for Compute.new. thanks Paul Thornthwaite
Fix display_stdout to process multiple lines output. thanks Rupak Ganguly
[dreamhost|dns]
remove connection deprecation notices. thanks Sergio Rubio
Use the new fog-dream.com domain for testing. thanks Sergio Rubio
remove silly debugging code. thanks Sergio Rubio
do not delete the do-not-delete record when testing. thanks Sergio Rubio
added test helpers. thanks Sergio Rubio
Added README.md file documenting testing procedure. thanks Sergio Rubio
Removed get_record request. thanks Sergio Rubio
refactor dns requests tests. thanks Sergio Rubio
added Record model tests, fix Record.save. thanks Sergio Rubio
record tests fixes. thanks Sergio Rubio
Emulate zone model and collection, added tests. thanks Sergio Rubio
Do not add duplicated zones to the Zones collection. thanks Sergio Rubio
Moved getting started guide to examples/dns. thanks Sergio Rubio
Zone.records: list only records matching the current zone. thanks Sergio Rubio
Updated testing documentation. thanks Sergio Rubio
Updated Dreamhost/DNS getting started guide. thanks Sergio Rubio
drop uuid gem requirements, not needed. thanks Sergio Rubio
drop uuid gem dep from fog.gemspec. thanks Sergio Rubio
Add dreamhost to the list of providers. thanks Sergio Rubio
[dreamhost|docs]
Added getting started guide, initial release. thanks Sergio Rubio
[dremhost|dns]
added DNS service tests. thanks Sergio Rubio
[ecloud]
fixed object returns in mock. thanks Eugene Howe
[fog]
Typo fixed in identity. thanks Anshul Khandelwal
Cleanup: Use the service registry for requiring libs where possible. thanks Anshul Khandelwal
[glesys]
Add description to server model. thanks Simon Gate
Ability to pass in options to server details. thanks Simon Gate
Consistent naming of attributes. thanks Simon Gate
ip details should be ip details, not listfree. thanks Simon Gate
Fix ip model name to match nameing convention. thanks Simon Gate
Fix ip attributes, they didn't work. thanks Simon Gate
Return nil if there isn't any public ip address. thanks Simon Gate
Refactor the ip interface, did not work earlier. thanks Simon Gate
add take method to ip model. thanks Simon Gate
Fix error in ip tests. thanks Simon Gate
Make compute test pass. thanks Simon Gate
Attributes were overwritten when getting server details. thanks Simon Gate
Fix bug when trying to attach a ip to a server. thanks Simon Gate
Platform methods to templates. thanks Simon Gate
Rename template model to match Fog convention. thanks Simon Gate
Remove unused features from template model. thanks Simon Gate
[hp/openstack|compute]
remove erroneous block argument to get_object; fixes issue #1588 for OpenStack and HP. thanks Kyle Rames
[libvirt|volume]
Fix typo in image_suffix. thanks David Wittman
[misc]
Enable ebs-optimized spot instance requests. thanks Adam Bozanich
test spot instance request parser. thanks Adam Bozanich
add internet_archive to fog providers, bin, storage. thanks Andrew Kuklewicz
and internet_archive code, tests. thanks Andrew Kuklewicz
fix testing mock. thanks Andrew Kuklewicz
set defaults to be scheme http, port 80, as that is what internet_archive supports. thanks Andrew Kuklewicz
Pass the management URI if no public endpoint. thanks BK Box
Need to check for management variable as well. thanks BK Box
Add support for pulling out virtualization type when parsing AWS Describe Instances results. thanks Brad Heller
Ignore tags. thanks Brad Heller
NextMarker => NextToken. Maybe that's what it used to be...?. thanks Brad Heller
Fix Params related to network configuration. thanks Chirag Jog
Support to Configure the VM network. thanks Chirag Jog
Ability to track vApp level status of readiness. thanks Chirag Jog
Fix Params related to network configuration. thanks Chirag Jog
Support to Configure the VM network. thanks Chirag Jog
Ability to track vApp level status of readiness. thanks Chirag Jog
Remove extraneous print. thanks Chirag Jog
Remove existing (unused) parser module and introduce a TerremarkParser - which extends the base parser with the ability to extract relevant attributes. thanks Chirag Jog
Use the TerremarkParser to extract relevant attributes. thanks Chirag Jog
Minor Fix to delete the internet service. thanks Chirag Jog
OpenStack: update used limits tests. thanks Dan Prince
OpenStack: update tenant_list tests. thanks Dan Prince
OpenStack: get identity tests passing in real mode. thanks Dan Prince
Drop 'extras' from tenant test validations. thanks Dan Prince
Openstack: fix bin/openstack.rb errors. thanks Dan Prince
OpenStack Compute: Fix server model metadata. thanks Dan Prince
OpenStack: Add missing metadatum requests. thanks Dan Prince
vsphere: Support multiple NIC backings. thanks Ewoud Kohl van Wijngaarden
vsphere: Allow listing virtual port groups. thanks Ewoud Kohl van Wijngaarden
Add a zones.find(substring) method to return only zones whose name matches that substring. thanks H. Wade Minter
Add initial support for pulling in >100 zones via Zones.each. thanks H. Wade Minter
Get rid of the extra load() calls. thanks H. Wade Minter
copy & paste to get Blocks LB API working. thanks Josh Yotty
register blb feature. thanks Josh Yotty
Rudimentary CRUD for AWS Data Pipeline. thanks Keith Barrette
Simple model tests. thanks Keith Barrette
Simple request tests. thanks Keith Barrette
Fix failing model tests. thanks Keith Barrette
Mark data pipeline tests pending if mocked. thanks Keith Barrette
Make compatible with Ruby 1.8.7. thanks Keith Barrette
Finished initial draft of Cloud Server docs. thanks Kyle Rames
updating Rackspace Cloud Server Documentation. thanks Kyle Rames
moving documents to another branch. thanks Kyle Rames
adding white space to force travis build. thanks Kyle Rames
refined examples; moved samples into cloud_servers sub directory. thanks Kyle Rames
moving examples; added readme. thanks Kyle Rames
tweaking example readme file. thanks Kyle Rames
tweaking examples document. thanks Kyle Rames
merging with latest master. thanks Kyle Rames
Adding Rackspace getting started and compute documents back in. thanks Kyle Rames
apply edits to Rackspace compute documents. thanks Kyle Rames
fixing links to anchors in Rackspace Compute doc. thanks Kyle Rames
fixing links to anchors in Rackspace Compute doc one more time. thanks Kyle Rames
fixing links to anchors in Rackspace Compute doc AGAIN. thanks Kyle Rames
fixing merge conflicts. thanks Kyle Rames
added 30 second timeout for SSH and SCP connect. thanks Kyle Rames
moved cloud servers examples to lib/fog/rackspace/examples/compute_v2; renamed cloud_servers.md to compute_v2.md. thanks Kyle Rames
rebased with master. thanks Kyle Rames
merging with the latest file_metadata. thanks Kyle Rames
rebasing cdn branch with latest master. thanks Kyle Rames
rebasing with master. thanks Kyle Rames
rebasing with master. thanks Kyle Rames
rebasing with master. thanks Kyle Rames
fixing broken tests. thanks Kyle Rames
Revert "[rackspace] adding accept headers to block_storage, cdn, compute_v2, databases, identity, load_balancers, storage". thanks Kyle Rames
Revert "Revert "[rackspace] adding accept headers to block_storage, cdn, compute_v2, databases, identity, load_balancers, storage"". thanks Kyle Rames
Follow redirection from response even if response is a Hash. thanks Marc G Gauthier
Set the User-Agent as Fog, to help differentiate from HP's CLI tools that have a vendored 'hpfog'. thanks Matt Ray
Make sure no requests are ever sent to the wrong endpoint by default. thanks Matt Sanders
Bump release to 0.0.7. thanks Matt Sanders
Remove matt as contact. thanks Matt Sanders
Bumped net-scp dependency to ~>1.1. thanks Michael D. Hall
remove unneeded url param. thanks Michał Krzyżanowski
Fix Mock#allocate_address method arity. thanks Mike Moore
Fix Mock#get_snapshot_details argument. thanks Mike Moore
Fix Mock#get_volume_details argument. thanks Mike Moore
Fix Mock#list_servers method arity. thanks Mike Moore
Fix Mock#remove_fixed_ip arguments. thanks Mike Moore
Fix Mock#update_server arguments. thanks Mike Moore
Removes docs since they are in wrong repo. thanks Paul Thornthwaite
Adds new Code Climate badge to README. thanks Paul Thornthwaite
Disables tests with race conditions affecting CI. thanks Paul Thornthwaite
Update gitignore and add a rvmrc file. thanks Rupak Ganguly
Add a new HP provider. thanks Rupak Ganguly
Add a case for the new HP provider. thanks Rupak Ganguly
Add a new HP provider. thanks Rupak Ganguly
Add a storage service implementation to the HP provider. thanks Rupak Ganguly
Add #get_containers, #get_container, #put_container and #delete_container methods to the storage service. thanks Rupak Ganguly
Add #head_containers and #head_container methods. thanks Rupak Ganguly
Enable #get, #put, #head and #delete object methods. thanks Rupak Ganguly
Add implementation for #get_object method. thanks Rupak Ganguly
Add implementation for #put_object method. thanks Rupak Ganguly
Add implementation for #head_object method. thanks Rupak Ganguly
Add implementation for #delete_object method. thanks Rupak Ganguly
Enable models layer methods and return nil from cdn call. thanks Rupak Ganguly
Add the directories model implementation. thanks Rupak Ganguly
Add the directory model implementation. thanks Rupak Ganguly
Add the files model implementation. thanks Rupak Ganguly
Add the file model implementation. thanks Rupak Ganguly
Add an implementation of copy method to copy files between containers. thanks Rupak Ganguly
Require HP provider for the fog binary. thanks Rupak Ganguly
Add a HP provider class for the fog binary. thanks Rupak Ganguly
Enable compute service with HP provider. Refactor hp_auth_url into hp_host, hp_port and hp_auth_path to enable flexibility in specifying the host, port and auth path separately. thanks Rupak Ganguly
Add the new hp_host, hp_port and hp_auth_path attributes and remove hp_auth_url. thanks Rupak Ganguly
Add a new HP provider for compute service. Note the new hp_host, hp_port and hp_auth_path attributes. thanks Rupak Ganguly
Add a case for the new HP provider for compute service. thanks Rupak Ganguly
Add the #list_servers method. thanks Rupak Ganguly
Enable #create_server, #list_servers and #list_servers_detail services for Nova. thanks Rupak Ganguly
Add implementation for #list_servers_detail. thanks Rupak Ganguly
Enable #list_images and #list_images_detail services. thanks Rupak Ganguly
Add implementation for #list_images service. thanks Rupak Ganguly
Add implementation for #list_images_detail service. thanks Rupak Ganguly
Enable #list_flavors and #list_flavors_detail services for Nova. thanks Rupak Ganguly
Add implementation for #list_flavors service. thanks Rupak Ganguly
Add implementation for #list_flavors_detail service. thanks Rupak Ganguly
Add implementation for #get_server_details service. thanks Rupak Ganguly
Add implementation for #get_image_details service. thanks Rupak Ganguly
Add implementation for #get_flavor_details service. thanks Rupak Ganguly
Enable #get_server_details, #get_image_details and #get_flavor_details services for Nova. thanks Rupak Ganguly
Add implementation for #create_server service. thanks Rupak Ganguly
Enable #create_image and #delete_image services. thanks Rupak Ganguly
Add implementation for #create_image service. thanks Rupak Ganguly
Add implementation for #delete_image service. thanks Rupak Ganguly
Enable the #create_server, #update_server and #delete_server services for Nova. thanks Rupak Ganguly
Update code with differences from Rackspace API and OS, to make it work with the Nova instance. thanks Rupak Ganguly
Add the implementation for #update_server services. thanks Rupak Ganguly
Add the implementation for #delete_server services. thanks Rupak Ganguly
Enable #list_addresses, #list_public_addresses and #list_private_addresses services for Nova. thanks Rupak Ganguly
Add implementation for #list_addresses service. thanks Rupak Ganguly
Add implementation for #list_public_addresses service. thanks Rupak Ganguly
Add implementation for #list_private_addresses service. thanks Rupak Ganguly
Enable #server_action, #reboot_server, #resize_server, #confirm_resized_server and #revert_resized services for Nova. thanks Rupak Ganguly
Add implementation for #server_action, #reboot_server, #resize_server, #confirm_resized_server and #revert_resized services. thanks Rupak Ganguly
Enable flavors and flavor models. thanks Rupak Ganguly
Add implementation for flavors and flavor model layer. thanks Rupak Ganguly
Enable images and image models. thanks Rupak Ganguly
Add implementation for images and image model layers. thanks Rupak Ganguly
Enable models for servers and server for Nova services. thanks Rupak Ganguly
Add implementaion for servers model. thanks Rupak Ganguly
Add implementaion for server model. thanks Rupak Ganguly
Refactor connection parameters to accept a single endpoint and credentials. thanks Rupak Ganguly
Refactor Nova connection parameters to accept a single endpoint and credentials. thanks Rupak Ganguly
Add a options hash so that headers can be passed in to set acls. thanks Rupak Ganguly
Fix public_url property to generate a url when cdn is not enabled. Also, create a new url method that returns the full url. thanks Rupak Ganguly
Add a helper method to convert a acl string to a header name/value pair that Swift understands. thanks Rupak Ganguly
Add an acl property that will allow setting of acls strings. Also, add fix the public property to now toggle the appropriate acl string. thanks Rupak Ganguly
Remove Content-Length header incase Transfer-Encoding header is present. This was done to get the streaming for PUT working. thanks Rupak Ganguly
Fix a JSON parse error for Nova service methods like reboot. The server returns plain text instead of JSON text and hence JSON.parse barfs. thanks Rupak Ganguly
Revise fog gemspec to reflect hpfog name and tag it with v0.0.6. thanks Rupak Ganguly
Add mocking support to Swift HP provider calls. thanks Rupak Ganguly
Add a public? method to query a directory's state. thanks Rupak Ganguly
Add header_to_acl helper method to convert an acl header into corresponding acl strings. thanks Rupak Ganguly
Retrieve acl headers if present and set the acl string on a directory. thanks Rupak Ganguly
Add a check to see if acl string is nil and if so set it to 'private'. thanks Rupak Ganguly
Change serverRef to serverId. This was a change from Rackspace API but has been sync'd upon now. thanks Rupak Ganguly
Change flavorRef to flavorId and imageRef to imageId. This was a change from Rackspace API but has been sync'd upon now. thanks Rupak Ganguly
Fix DEVEX-634: Remove services that our out of scope. thanks Rupak Ganguly
Add CHANGELOG for HP specific fog extensions. thanks Rupak Ganguly
Add README with documentation for HP specific fog extensions. thanks Rupak Ganguly
Bump version. thanks Rupak Ganguly
Fix differences that were there in OS API. thanks Rupak Ganguly
Add special char. support including '?' in container and object names. thanks Rupak Ganguly
Add a helper method to expose some base info. for clients. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Fix bug DEVEX-1296. Encode container and object names for public_url. thanks Rupak Ganguly
Update changelog. thanks Rupak Ganguly
Update date for release. thanks Rupak Ganguly
Change flavorId to flavorRef and imageId to imageRef as the specs changed. Also, change expected status to be 202 instead of 200. thanks Rupak Ganguly
Change expected status to be 204 instead of 202. thanks Rupak Ganguly
Change expected status to be 204 instead of 200. thanks Rupak Ganguly
Update date for fog merge with upstream milestone. thanks Rupak Ganguly
Add connection options param to the HP provider for Storage and Compute services that can be used to customize various connection related timeouts and other options. thanks Rupak Ganguly
Remove deprecated provider recognize clause. thanks Rupak Ganguly
Enable HP CDN provider. thanks Rupak Ganguly
Integrate HP CDN service with storage service. thanks Rupak Ganguly
Fix small bug with returning public url in the case when cdn is used. thanks Rupak Ganguly
Add initial implementation for cdn services i.e. GET, PUT, POST, HEAD and DELETE. thanks Rupak Ganguly
Hardcode X-Storage-Url as service is returning wrong url. thanks Rupak Ganguly
Assign hp_auth_uri to an instance var. so that CDN can use it. thanks Rupak Ganguly
Enable delete_container on the CDN service. thanks Rupak Ganguly
Add fix for special chars. in CDN-enabled container names. thanks Rupak Ganguly
Catch new exception that is being thrown. thanks Rupak Ganguly
Update code to call delete_container if CDN is enabled. thanks Rupak Ganguly
Make headers camel cased in public_url and remove manipulation of public_url in save method. Use delete_container in CDN context instead of out_container. thanks Rupak Ganguly
Remove CDN integration from within Storage service, till CDN service is more mature. thanks Rupak Ganguly
Update image and images model, and create_image call now uses server_action. Behavior change in Diablo 4. thanks Rupak Ganguly
Add new request layer method for rebuild_server and enable it for compute services. Behavior added in Diablo 4. thanks Rupak Ganguly
Enable new compute services. thanks Rupak Ganguly
Add name, accessIPv4 and accessIPv6 as properties. Change create_server signature to include the now required name param. Breaking change due to OS API. thanks Rupak Ganguly
Add new attributes, update flavor and image attributes and add corresponding accessors for them. Add new methods for rebuild, resize, revert_resize, confirm_resize, and create_image. Update save method to use new attributes. Update create_server call to pass in name param. thanks Rupak Ganguly
Remove resize related calls as they are not fully functional yet. thanks Rupak Ganguly
Update changelog for 0.0.10 tagged version. thanks Rupak Ganguly
Add a new option for CDN endpoint url and build the CDN mgmt url. thanks Rupak Ganguly
Add a new cdn uri to the Storage service to enable a CDN service from within the Storage service. thanks Rupak Ganguly
Update destroy and save methods to call appropriate CDN counterparts when CDN service is available and enabled. thanks Rupak Ganguly
Add some new attributes. Fix image_id and flavor_id getters. thanks Rupak Ganguly
Add request and model methods for change_password_server, and enable it for compute. thanks Rupak Ganguly
Add list_key_pairs compute request layer method, and mocks for it as well. thanks Rupak Ganguly
Add some mocking helper methods. thanks Rupak Ganguly
Fix issue with list in mock mode. thanks Rupak Ganguly
Enable create_key_pair service for compute. Add key_pairs array for mocking support. thanks Rupak Ganguly
Add implementation for creating keypair and also provide mocking support. thanks Rupak Ganguly
Remove a debug message. thanks Rupak Ganguly
Fix param name. thanks Rupak Ganguly
Enable delete_key_pair request method and implement it, along with mocking support. thanks Rupak Ganguly
Enable and implement key pairs model layer for compute service. thanks Rupak Ganguly
Add implementation for list_security_groups request layer method and enable it for compute services. Add mocking support as well. thanks Rupak Ganguly
Fix a small typo in mocks. thanks Rupak Ganguly
Enable and implemented create_security_groups method for request layer for compute services. thanks Rupak Ganguly
Fix code to remove from last modified hash afetr delete in mock code. thanks Rupak Ganguly
Use id instead of name to index the security groups hash in mock data structure. thanks Rupak Ganguly
Enable and implemented delete_security_groups method in requets layer for compute services. thanks Rupak Ganguly
Enable and implement create, get and delete security group methods for compute service. thanks Rupak Ganguly
Enable and add the security groups model layer implementation for the compute services. thanks Rupak Ganguly
Enable and add implementation for create security group rules for compute service. thanks Rupak Ganguly
Fix bugs in mocking support. thanks Rupak Ganguly
Small fix in mocks. thanks Rupak Ganguly
Enable and implement delete security group rules for compute service. thanks Rupak Ganguly
Add security group rule methods to security group model. thanks Rupak Ganguly
Fix create_rule to return response instead of boolean. thanks Rupak Ganguly
Add helper methods for mocking. thanks Rupak Ganguly
Enable and implement allocate address with mocking support for compute services. thanks Rupak Ganguly
Add options for keyname, security group and availability zone. thanks Rupak Ganguly
Enable and add implementation for release address for request layer for the compute service. thanks Rupak Ganguly
Fix documentation. thanks Rupak Ganguly
Enable and implement get address for request layer along with mocking support for the compute service. thanks Rupak Ganguly
Rename these to add a server prefix as they pertain to server addresses. thanks Rupak Ganguly
Enable and implement list addresses for request layer for the compute service. thanks Rupak Ganguly
Enable and implement the address model layer for the compute service. thanks Rupak Ganguly
Fix the documentation. thanks Rupak Ganguly
Enable and add associating and disassociating addresses to a server instance in the request layer for the compute service. thanks Rupak Ganguly
Add new attributes and revise addresses hash structure for the mock. thanks Rupak Ganguly
Fix doc, and status. thanks Rupak Ganguly
Revise implementation for returning private and public ip addresses for a given server, along with mocking support. thanks Rupak Ganguly
Revise mocking support to manage ip address collection in servers. thanks Rupak Ganguly
Add server attribute to associate and disassociate a server to an address. thanks Rupak Ganguly
Remove some attributes from object. thanks Rupak Ganguly
Add support for passing in key pairs, security groups, availability zone and min/max count to the create server request layer method. thanks Rupak Ganguly
Update the server model to support passing in keypairs and security groups. thanks Rupak Ganguly
Fix some verbiage and update some links. thanks Rupak Ganguly
Remove instance_id as an accessor. thanks Rupak Ganguly
Add vcpus as an attribute. thanks Rupak Ganguly
Add back some attributes. thanks Rupak Ganguly
Update inline docs to add some params. thanks Rupak Ganguly
Update changelog with changes for this version release. thanks Rupak Ganguly
Bump version to 0.0.11. thanks Rupak Ganguly
Update HP provider with the new CS authentication method and also refactor the legacy authentication method. Also, update HP Storage provider to use the CS authentication scheme. thanks Rupak Ganguly
Retrofit HP Storage provider to work with both legacy and CS authentication schemes. thanks Rupak Ganguly
Refactor code to get endpoints from service catalog for v1 and v2 auths. thanks Rupak Ganguly
Update Storage provider to work with v1 and v2 auths. thanks Rupak Ganguly
Update CDN provider to work with v1 and v2 auths. Also, patch code for incorrect endpoint via CS catalog. thanks Rupak Ganguly
Update for cdn endpoint fix in place. thanks Rupak Ganguly
Update inline docs as per real responses. thanks Rupak Ganguly
Update CDN integration with Storage with respect to CS authentication. thanks Rupak Ganguly
Update HP Compute provider to use CS authentication and retrofit code to use v1 auth as well. thanks Rupak Ganguly
Add cdn_enabled?, cdn_enable= and cdn_public_url for directory model. Also, add cdn_public_url for file model. thanks Rupak Ganguly
Add connection_options for AWS Compute provider. thanks Rupak Ganguly
Refactor to remove service_type param from provider call. thanks Rupak Ganguly
Update inline documentation. thanks Rupak Ganguly
Escape the key in the call. thanks Rupak Ganguly
Remove bits and cores from flavor. thanks Rupak Ganguly
Add cores as an attribute to alias vcpus. thanks Rupak Ganguly
Add some attributes that are implemented as methods. thanks Rupak Ganguly
Add copyright message for HP extensions for fog. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Update copyright notice. thanks Rupak Ganguly
Update inline documentation. thanks Rupak Ganguly
Fix for auth uri using Identity service. thanks Rupak Ganguly
Add parameter :hp_avl_zone to access the az2 availability zone to the HP Compute provider. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Add key_pair get/set methods for server model. thanks Rupak Ganguly
Hack to fix public_ip_address. thanks Rupak Ganguly
Fix for Fog::HP::CDN::NotFound exception. thanks Rupak Ganguly
Update public_ip_address method to return first public ip address. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Add an Errors module for handling HP provider specific exceptions. thanks Rupak Ganguly
Refactor escape method for container and object names and move it to the HP provider from individual namespaces. thanks Rupak Ganguly
Remove obsolete method. thanks Rupak Ganguly
Remove bad service. thanks Rupak Ganguly
Fix mock to return integer value for count. thanks Rupak Ganguly
Raise the correct exception in the mock. thanks Rupak Ganguly
Add HP provider and credentials to support testing with mocks. thanks Rupak Ganguly
Fix mocks to match real implementation. thanks Rupak Ganguly
Add object tests for storage. thanks Rupak Ganguly
Add mocking support for copy operation using puut object. thanks Rupak Ganguly
Add more tests for containers and objects. thanks Rupak Ganguly
Fix an issue in copy mocking portion. thanks Rupak Ganguly
Add test for copy objects. thanks Rupak Ganguly
Add test for copying from one container to another. thanks Rupak Ganguly
Fix format of flavors in mocks. thanks Rupak Ganguly
Add tests for flavor. thanks Rupak Ganguly
Add implementation for mocks. thanks Rupak Ganguly
Add mocking support. thanks Rupak Ganguly
Minor fix for mocks. thanks Rupak Ganguly
Add tests for images. thanks Rupak Ganguly
Update mocking support. thanks Rupak Ganguly
Add tests for server requests. thanks Rupak Ganguly
Update mocking support. thanks Rupak Ganguly
Add tests for addresses and floating ips. thanks Rupak Ganguly
Fix minor things in tests. thanks Rupak Ganguly
Update mocking support. thanks Rupak Ganguly
Add tests for keypairs. thanks Rupak Ganguly
Update mocking support for security groups. thanks Rupak Ganguly
Add tests for security groups. thanks Rupak Ganguly
Update mocking support for security groups and security group rules. thanks Rupak Ganguly
Add tests for security group rules. thanks Rupak Ganguly
Fix mocks for create_key_pair. thanks Rupak Ganguly
Fix mocks for list_key_pairs. thanks Rupak Ganguly
Fix format for list_key_pairs. thanks Rupak Ganguly
Add tests for address model and addresses collection. thanks Rupak Ganguly
Add HP provider in the helper. thanks Rupak Ganguly
Add tests for key_pair model and key_pairs collection. thanks Rupak Ganguly
Add tests for security group model and collection. thanks Rupak Ganguly
Add HP credential params. thanks Rupak Ganguly
Add HP credential params for mocking support. thanks Rupak Ganguly
Add mocking support for HP CDN provider. thanks Rupak Ganguly
Add tests for CDN containers. thanks Rupak Ganguly
Update mocks to simulate real results in containers. thanks Rupak Ganguly
Update tests and mocks based on real pro data. thanks Rupak Ganguly
Update tests and mock formats based on real pro data. thanks Rupak Ganguly
Update mocks to simulate real behavior. thanks Rupak Ganguly
Update key pair tests to work with real pro results. thanks Rupak Ganguly
Update mocks to simulate real results. thanks Rupak Ganguly
Update mocks and tests to simulate real results. thanks Rupak Ganguly
Update mocks and tests to simulate real results. thanks Rupak Ganguly
Update mocks and tests for flavor to simulate real results. thanks Rupak Ganguly
Update mocks and tests to simulate real calls in pro. thanks Rupak Ganguly
Update mocks for address in create_server and corresponding tests. thanks Rupak Ganguly
Add hp_tenant_id as a required param for connection to HP providers. thanks Rupak Ganguly
Update default scheme from http to https in the v1 auth. thanks Rupak Ganguly
Add uuid and links atrributes to the list servers mock. thanks Rupak Ganguly
Pass connection_options hash to the cdn connection in the storage provider. thanks Rupak Ganguly
Fix a bug where cdn state was not preserved. thanks Rupak Ganguly
Add helper method for cdn public ssl url and remove check for hp_cdn_ssl flag. thanks Rupak Ganguly
Add helper method for cdn public url for file. thanks Rupak Ganguly
Add helper method to get cdn ssl url for the files collection. thanks Rupak Ganguly
Add and enable get_console_output request method and add server method console_output. Add test for get_console_output. thanks Rupak Ganguly
Add avl zone as required param. Update endpoint retrieving logic from catalog to allow future avl zones. Fix minor error in tests. thanks Rupak Ganguly
Add avl zone as required param. Update endpoint retrieving logic from catalog to allow future avl zones. Fix minor error in tests. thanks Rupak Ganguly
Add availability zone required parameter for storage and cdn services. thanks Rupak Ganguly
Add availability zone required parameter for storage and cdn services. thanks Rupak Ganguly
Minor fix. thanks Rupak Ganguly
Add security_groups attribute to the server model. thanks Rupak Ganguly
Change hp_service_type to check for 'name' in the service catalog rather than 'type'. thanks Rupak Ganguly
Update tests to reflect addition of security_groups attribute to server model. thanks Rupak Ganguly
Update to not raise exception if service is not active or not present. thanks Rupak Ganguly
Upgrade to excon version 0.13.0 to take advantage of the ssl_verify_peer and ssl_ca_file params via the connection_options hash. Also, remove the use of :hp_servicenet setting for ssl for storage and compute providers. thanks Rupak Ganguly
Add request layer code for metadata. thanks Rupak Ganguly
Update mocking support for metadata to match real responses. thanks Rupak Ganguly
Add tests for metadata requests methods. thanks Rupak Ganguly
Minor fix to mocks. thanks Rupak Ganguly
Add metadata models support. Also, include metadata attribute in server and image models, to manage metadata. thanks Rupak Ganguly
Add some more metadata requests tests. thanks Rupak Ganguly
Minor fix and add a destroy method. thanks Rupak Ganguly
Add metadata tests for servers and images. thanks Rupak Ganguly
Fix code to metadata to the create image call. thanks Rupak Ganguly
Add an attribute for network_name to make it easy to switch. thanks Rupak Ganguly
Add a multi_json require so that json parsing is available. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Update call to include response_block rather than passing a block, to conform to excon deprecation message. thanks Rupak Ganguly
Add attributes to image model by extracting them from metadata. thanks Rupak Ganguly
Add a BlockStorage service to the HP provider. thanks Rupak Ganguly
Add list_volumes for block storage. thanks Rupak Ganguly
Add get_volume_details request method for block storage. thanks Rupak Ganguly
Add delete_volumes request method for block storage. thanks Rupak Ganguly
Add create_volume request method for block storage service. thanks Rupak Ganguly
Add ability to send in metadata to create_volume request method. thanks Rupak Ganguly
Fix mock for tests. thanks Rupak Ganguly
Fix typo in service folder. thanks Rupak Ganguly
Add the block storage service to the binary. thanks Rupak Ganguly
Fix mock for tests. thanks Rupak Ganguly
Add shindo tests for requests methods for block storage. thanks Rupak Ganguly
Add server attach block storage request methods. thanks Rupak Ganguly
Add list_server_volumes request method for block storage service. thanks Rupak Ganguly
Add attach_volume request method for block storage service. thanks Rupak Ganguly
Add detach_volume request method for block storage service. thanks Rupak Ganguly
Add shindo tests for server volume request methdos for block storage service. thanks Rupak Ganguly
Add volume model and volumes collection for block storage service. thanks Rupak Ganguly
Add shindo tests for volume models and collection. thanks Rupak Ganguly
Fix mock to provide correct status after creation. thanks Rupak Ganguly
Add a compute service attribute to peek into the compute service from within the block_storage service. thanks Rupak Ganguly
Add attach and detach methods to the volume model using the compute service attribute. thanks Rupak Ganguly
Add shindo tests for attach and detach. thanks Rupak Ganguly
Fix mock. Fix tests for mocking and real modes. thanks Rupak Ganguly
Add a head method for the directories collection. thanks Rupak Ganguly
Upgrade to excon 0.14.0 to take advantage of the new StandardInstrumentor for debug use. thanks Rupak Ganguly
Capture hp_auth_uri for passing down to compute provider. thanks Rupak Ganguly
Add a list_snapshot request method, a corresponding mock, and add support for it in the block storage provider. thanks Rupak Ganguly
Add a create_snapshot request method, a corresponding mock, and add support for it in the block storage provider. thanks Rupak Ganguly
Minor fix to the inline help. thanks Rupak Ganguly
Add a get_snapshot_details request method, a corresponding mock, and add support for it in the block storage provider. thanks Rupak Ganguly
Add a delete_snapshot request method, a corresponding mock, and add support for it in the block storage provider. thanks Rupak Ganguly
Add shindo tests for snapshots request layer methods. thanks Rupak Ganguly
Minor update to inline help. thanks Rupak Ganguly
Add snapshot model and collection to bloack storage provider. thanks Rupak Ganguly
Add snapshot model/collection and corresponding tests. thanks Rupak Ganguly
Add user_agent string to the core fog connection with corresponding tests. thanks Rupak Ganguly
Add customised user_agent string for HP providers. Also, enable passing a custom user_agent string from calling clients. Add corresponding tests. thanks Rupak Ganguly
Add volume_attachments to server model. thanks Rupak Ganguly
Bump version to 0.0.16 and update changelog. thanks Rupak Ganguly
Removed 'server' attribute from server model, and fixed 'all' method. thanks Rupak Ganguly
Removed 'images' attribute from server model. thanks Rupak Ganguly
Fix version info. that is used by user-agent. thanks Rupak Ganguly
Add object temp url generation capability with mock support. thanks Rupak Ganguly
Add object temp url functionality to file model layer. thanks Rupak Ganguly
Add request layer tests for object_temp_url functionality. thanks Rupak Ganguly
Add tenant_id to the mix to tighten security for the temp_url generation. thanks Rupak Ganguly
Update mock for tenp_url. thanks Rupak Ganguly
Call the request layer method instead of the generic util method. thanks Rupak Ganguly
Add model tests for storage service. thanks Rupak Ganguly
Add the request layer method to extract the windows password from the console log in case of a windows instance. thanks Rupak Ganguly
Update the server model with a method to retrieve the windows password. thanks Rupak Ganguly
Update the get_windows_password to return the encrypted password instead of the decrypted one. thanks Rupak Ganguly
Add grant, revoke and list methods for cross tenant object acls implementation. thanks Rupak Ganguly
Add request layer methods for shared container and shared object access. thanks Rupak Ganguly
Bump version and update changelog. thanks Rupak Ganguly
Fix response status for mocks. thanks Rupak Ganguly
Add mocks for shared container and objects calls. thanks Rupak Ganguly
Add a new exception class and handled exceptions in exception messages. thanks Rupak Ganguly
Add request method for put_shared_object. Add model and collection for shared_directory and shared_file. thanks Rupak Ganguly
Refactor common code into separate method. thanks Rupak Ganguly
Fix mock for put_container to reflect new acl changes. thanks Rupak Ganguly
Fix head call to return an empty body. thanks Rupak Ganguly
Removed comment. thanks Rupak Ganguly
Minor fix to allow options on save to pass in metadata. thanks Rupak Ganguly
Add method all. thanks Rupak Ganguly
Add methods for destroy and save. thanks Rupak Ganguly
Add method for destroy. thanks Rupak Ganguly
Add request layer method for put_shared_container. thanks Rupak Ganguly
Minor bug fix when acls are nil. Also, added support for specifying list of users for grant and revoke as a comma-separated list. thanks Rupak Ganguly
Allow the models to raise exception when there is insufficient access. thanks Rupak Ganguly
Add delete_shared_object and corresponding model support. thanks Rupak Ganguly
Update inline documentation. thanks Rupak Ganguly
Update method to remove availability_zone as input data parameter. thanks Rupak Ganguly
Allows creation of bootable volumes by passing in single part images. thanks Rupak Ganguly
Allows creation of server instances that use a bootable volume rather than an image as its base. This gives us persistant instances. thanks Rupak Ganguly
Fix failing shindo tests. thanks Rupak Ganguly
Fix some null checks. thanks Rupak Ganguly
Add request layer methods for listing and getting bootable volumes. thanks Rupak Ganguly
Update volume model and collection to handle bootable volumes as well. thanks Rupak Ganguly
Add code to accept config_drive and block_device_mapping parameters while creating a server instance. thanks Rupak Ganguly
Move CHANGELOG.hp under hp folder. thanks Rupak Ganguly
Bump the version and update the changelog. thanks Rupak Ganguly
Fix public_key attribute to be visible in table. thanks Rupak Ganguly
Add create_persistent_server request layer method to compute service. Add mocks and tests as well. thanks Rupak Ganguly
Remove block_device_mapping param from create_server request method call. thanks Rupak Ganguly
Add capability of creating regular and persistent servers via the server model. Make image_id an optional parameter for creating servers. thanks Rupak Ganguly
Add bootable_volumes collection for managing only bootable volumes. thanks Rupak Ganguly
Remove bootable volumes list and get methods and moved them under the bootable_volumes collection. thanks Rupak Ganguly
Update changelog and release date. thanks Rupak Ganguly
Updated the BlockStorage namespace to be Fog::HP::BlockStorage. thanks Rupak Ganguly
Updated the tests to reflect the BlockStorage namespace changes. thanks Rupak Ganguly
Fix case where invalid CDN endpoint was causing issues. thanks Rupak Ganguly
Update to new code and tests based on changes from upstream fog. thanks Rupak Ganguly
Deprecate hp_account_id to use hp_access_key instead. thanks Rupak Ganguly
Fix fog.gemspec. thanks Rupak Ganguly
* [dreamhost|dns] initial import. thanks Sergio Rubio
Switch gem source to https://rubygems.org. thanks Sergio Rubio
A whitespace fix :v:. thanks Simon Gate
add install.txt. thanks Terry Howe
remove file. thanks Terry Howe
Update put_object to accept blocks, and remove deprecation message. thanks Terry Howe
Fix warning. thanks William Lawson
version. thanks William Lawson
reverse version change. thanks William Lawson
joyent resize smartmachine incorrect class type. thanks angus
Typo in instantiate_vapp_template.rb. thanks dJason
fix for user agent tests excon usage. thanks geemus
fixed bug, quantum api need no underscore valiable name. (ex floatingips. thanks kanetann
Update lib/fog/ecloud/requests/compute/virtual_machine_create_from_template.rb. thanks tipt0e
Fog::Vsphere::Compute - misspelled method 'get_vm_by_ref' in vm_reconfig_hardware. thanks tipt0e
[openstack]
Register the image service. thanks Anshul Khandelwal
string interpolation problem image create fixes #1493. thanks Ruben Koster
[openstack|compute]
fix get_metadata call. thanks Ben Bleything
rename meta_hash to to_hash; make it public. thanks Ben Bleything
adds methods to retireve floating & fixed ip addresses. thanks Ohad Levy
ensures we clear ipaddresses cache upload reload. thanks Ohad Levy
configurable :openstack_endpoint_type. thanks Sergio Rubio
images collection should not return nil for #all. thanks Sergio Rubio
[openstack|identity]
Marks test as pending. thanks Paul Thornthwaite
Configurable :openstack_endpoint_type. thanks Sergio Rubio
user model tests fixes. thanks Sergio Rubio
cleanup the test role when no longer in use. thanks Sergio Rubio
[openstack|network]
Added missing Network model attributes. thanks Sergio Rubio
[openstack|storage]
intial import. thanks Sergio Rubio
added OpenStack Storage to lib/fog/storage.rb. thanks Sergio Rubio
Added OpenStack.escape utility method. thanks Sergio Rubio
Added storage service to lib/fog/bin/openstack.rb. thanks Sergio Rubio
Added OpenStack Storage service tests. thanks Sergio Rubio
configurable service_type and service_name. thanks Sergio Rubio
added openstack_tenant and openstack_region params. thanks Sergio Rubio
replace 'object_store' service type with 'object-store'. thanks Sergio Rubio
[openstack|volume]
Configurable :openstack_endpoint_type. thanks Sergio Rubio
remove extra comma. thanks Sergio Rubio
Added missing service declaration. thanks Sergio Rubio
[ovirt]
Add support for reading the oVirt api version. thanks Amos Benari
Added support for oVirt volume status. thanks Amos Benari
Updated the blocking start logic to fit oVirt 3.1 api. thanks Amos Benari
[rackspace]
adding accept headers to block_storage, cdn, compute_v2, databases, identity, load_balancers, storage. thanks Kyle Rames
fixing merge. thanks Kyle Rames
[rackspace|cdn]
implemented purge object from CDN; added CDN tests and mocks. thanks Kyle Rames
more refactoring. thanks Kyle Rames
more refactoring of cdn. thanks Kyle Rames
[rackspace|compute]
Fix typo in attachments model. thanks Brad Gignac
Handle malformed API responses. thanks Brad Gignac
Update server to use default networks. thanks Brad Gignac
Allow custom network on server. thanks Brad Gignac
this should address a metadata issue discovered in chef http://tickets.opscode.com/browse/KNIFE-217. thanks Kyle Rames
this should address a metadata issue discovered in chef http://tickets.opscode.com/browse/KNIFE-217(cherry picked from commit a859b9ecf550469ac43ea35402785dad59d7c7f2). thanks Kyle Rames
added create server example. thanks Kyle Rames
Adding more cloud server examples. thanks Kyle Rames
tweaking examples. thanks Kyle Rames
fixing typo in metadata class. thanks Kyle Rames
fixing connection deprecation warnings. thanks Kyle Rames
Adding API documentation. thanks Kyle Rames
updated to check for public_ip_address instead of ip4_address as setup uses the public_ip_address. thanks Kyle Rames
removed timeout from bootstrap method signature and hard coded it in method per geemus. thanks Kyle Rames
added test for put_container with an optional parameter. thanks Kyle Rames
updated mocking framework to support any flavor or image. thanks Kyle Rames
remove erroneous block argument to get_object fixes #1588. thanks geemus
[rackspace|compute_v2]
fixing merge issues; added metadata test for servers. thanks Kyle Rames
Added note indicating that RackConnect users should use Server personalization rather than the bootstrap method. thanks Kyle Rames
fixing bootstrap example. thanks Kyle Rames
compute_v2 tests were failing because the flavor used in the tests was too small for the image selected. I updating tests to use the an Ubuntu image in hopes of making the tests less brittle. thanks Kyle Rames
[rackspace|database]
remove extraneous colon. thanks Kyle Rames
[rackspace|databases]
removed trailing stash from hard coded endpoints; added accept header. thanks Kyle Rames
[rackspace|dns]
added tests for zones.find. thanks Brian Hartsock
fix issue in zones.find where results with no links throw exception. thanks Brian Hartsock
[rackspace|identity]
Correctly populate model from request data. thanks Brad Gignac
Remove unused get_credentials request. thanks Brad Gignac
[rackspace|lb]
fixed issue where double paths cause API errors. thanks Brian Hartsock
removed puts. thanks Brian Hartsock
[rackspace|networks]
Add Cloud Networks requests. thanks Brad Gignac
Add networks model and collection. thanks Brad Gignac
Add mock responses. thanks Brad Gignac
[rackspace|storage]
refactored storage/cdn. thanks Kyle Rames
fixed issue in ruby 1.8.7 where metadata was not being deleted when set to nil. thanks Kyle Rames
tweaked directory implementation; added directory model tests. thanks Kyle Rames
updating to return true after saving directory. thanks Kyle Rames
added support for container metadata; added directory tests. thanks Kyle Rames
Cloud Files will not process a header without a value so I added a stand in value for nil. thanks Kyle Rames
added delete method to metadata. thanks Kyle Rames
removing test of dubious distinction per geemus. thanks Kyle Rames
updated file class to use the same metadata implementation as the directory class. thanks Kyle Rames
added test to check for metadata on object creation; tweaked metadata on object creation test. thanks Kyle Rames
updated metadata class to decode incoming header values using FOG::JSON. thanks Kyle Rames
fixing Metadata#respond_to? method. thanks Kyle Rames
updated directory to lazy load metadata when necessary. thanks Kyle Rames
added tests for metadata class; fixed bug with method missing. thanks Kyle Rames
updated file class to use the same metadata implementation as the directory class. thanks Kyle Rames
added test to check for metadata on object creation; tweaked metadata on object creation test. thanks Kyle Rames
updated metadata class to decode incoming header values using FOG::JSON. thanks Kyle Rames
rebased with dir_metadata branch - https://github.com/fog/fog/pull/1563. thanks Kyle Rames
added ios_url and streaming_url methods to directory and file; added more tests. thanks Kyle Rames
added account model. thanks Kyle Rames
removing type conversion for metadata per https://github.com/fog/fog/pull/1587. thanks Kyle Rames
added the ability to determine meta prefixes from Class objects as well as Fog object. This addresses issue in Files#get method. thanks Kyle Rames
[tests]
Updates format tests. thanks Paul Thornthwaite
Changes to format testing helper. thanks Paul Thornthwaite
Extracts schema validator to class. thanks Paul Thornthwaite
Fixes schema validator for arrays. thanks Paul Thornthwaite
[virtualbox]
Removed VirtualBox since it has many problems and the gem it's based on is no longer maintained. thanks Kevin Menard
1.9.0 01/19/2013 0283cac581edc36fe58681c51d6fa2a5d2db3f41
=========================================================

View file

@ -6,8 +6,8 @@ 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 = '1.9.0'
s.date = '2013-01-19'
s.version = '1.10.0'
s.date = '2013-03-05'
s.rubyforge_project = 'fog'
## Make sure your summary is short. The description may be as long
@ -60,7 +60,6 @@ Gem::Specification.new do |s|
s.add_development_dependency('rspec', '~>1.3.1')
s.add_development_dependency('rbovirt', '>=0.0.11')
s.add_development_dependency('shindo', '~>0.3.4')
s.add_development_dependency('virtualbox', '~>0.9.1')
s.add_development_dependency('fission')
s.add_development_dependency('pry')
# s.add_development_dependency('ruby-libvirt','~>0.4.0')

View file

@ -202,7 +202,7 @@ module Fog
end
# wait for aws to be ready
wait_for { sshable? }
wait_for { sshable?(credentials) }
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
end

View file

@ -223,7 +223,7 @@ module Fog
#
# required attributes: key
#
# @param expires [String] number of seconds before url expires
# @param expires [String] number of seconds (since 1970-01-01 00:00) before url expires
# @param options [Hash]
# @return [String] url
#

View file

@ -3,15 +3,13 @@ module Fog
class AWS
class Real
# Delete a distribution from CloudFront
# Delete a distribution from CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - Id of distribution to delete
# * etag<~String> - etag of that distribution from earlier get or put
# @param distribution_id [String] Id of distribution to delete.
# @param etag [String] etag of that distribution from earlier get or put
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/DeleteDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/DeleteDistribution.html
def delete_distribution(distribution_id, etag)
request({
:expects => 204,

View file

@ -3,15 +3,13 @@ module Fog
class AWS
class Real
# Delete a streaming distribution from CloudFront
# Delete a streaming distribution from CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - Id of distribution to delete
# * etag<~String> - etag of that distribution from earlier get or put
# @param distribution_id [String] Id of distribution to delete.
# @parma etag [String] Etag of that distribution from earlier get or put
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/DeleteStreamingDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/DeleteStreamingDistribution.html
def delete_streaming_distribution(distribution_id, etag)
request({
:expects => 204,

View file

@ -5,42 +5,39 @@ module Fog
require 'fog/aws/parsers/cdn/distribution'
# Get information about a distribution from CloudFront
# Get information about a distribution from CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - id of distribution
# @param distribution_id [String] Id of distribution.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
# @return [Excon::Response]
# * body [Hash]:
# * S3Origin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# * OriginAccessIdentity [String] - Optional: Used when serving private content.
# or
# * 'CustomOrigin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
# * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
# * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
# * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
# * CustomOrigin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'www.example.com'.
# * HTTPPort [Integer] - HTTP port of origin, in [80, 443] or (1024...65535).
# * HTTPSPort [Integer] - HTTPS port of origin, in [80, 443] or (1024...65535).
# * OriginProtocolPolicy [String] - Policy on using http vs https, in ['http-only', 'match-viewer'].
#
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Status'<~String> - Status of distribution
# * 'DistributionConfig'<~Array>:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'CNAME'<~Array> - array of associated cnames
# * 'Comment'<~String> - comment associated with distribution
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'InProgressInvalidationBatches'<~Integer> - number of invalidation batches in progress
# * 'Logging'<~Hash>:
# * 'Bucket'<~String> - bucket logs are stored in
# * 'Prefix'<~String> - prefix logs are stored with
# * 'Origin'<~String> - s3 origin bucket
# * 'TrustedSigners'<~Array> - trusted signers
# * Id [String] Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Status [String] - Status of distribution.
# * DistributionConfig [Array]:
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
# * CNAME [Array] - Array of associated cnames.
# * Comment [String] - Comment associated with distribution.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * InProgressInvalidationBatches [Integer] - Number of invalidation batches in progress.
# * Logging [Hash]:
# * Bucket [String] - Bucket logs are stored in.
# * Prefix [String] - Prefix logs are stored with.
# * Origin [String] - S3 origin bucket.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/GetDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/GetDistribution.html
def get_distribution(distribution_id)
request({
:expects => 200,

View file

@ -5,43 +5,39 @@ module Fog
require 'fog/aws/parsers/cdn/get_distribution_list'
# List information about distributions in CloudFront
# List information about distributions in CloudFront.
#
# ==== Parameters
# * options<~Hash> - config arguments for list. Defaults to {}.
# * 'Marker'<~String> - limits object keys to only those that appear
# lexicographically after its value.
# * 'MaxItems'<~Integer> - limits number of object keys returned
# @param options [Hash] Config arguments for list.
# @option options Marker [String] Limits object keys to only those that appear lexicographically after its value.
# @option options MaxItems [Integer] Limits number of object keys returned.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated
# * 'Marker'<~String> - Marker specified for query
# * 'MaxItems'<~Integer> - Maximum number of keys specified for query
# * 'NextMarker'<~String> - Marker to specify for next page (id of last result of current page)
# * 'DistributionSummary'<~Array>:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
# @return [Excon::Response]
# * body [Hash]:
# * IsTruncated [Boolean] - Whether or not the listing is truncated.
# * Marker [String] Marker specified for query.
# * MaxItems [Integer] - Maximum number of keys specified for query.
# * NextMarker [String] - Marker to specify for next page (id of last result of current page).
# * DistributionSummary [Array]:
# * S3Origin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# * OriginAccessIdentity [String] - Optional: Used when serving private content.
# or
# * 'CustomOrigin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
# * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
# * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
# * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
# * 'Comment'<~String> - comment associated with distribution
# * 'CNAME'<~Array> - array of associated cnames
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Origin'<~String> - s3 origin bucket
# * 'Status'<~String> - Status of distribution
# * 'TrustedSigners'<~Array> - trusted signers
# * CustomOrigin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'www.example.com'.
# * HTTPPort [Integer] - HTTP port of origin, in [80, 443] or (1024...65535).
# * HTTPSPort [Integer] - HTTPS port of origin, in [80, 443] or (1024...65535).
# * OriginProtocolPolicy [String] - Policy on using http vs https, in ['http-only', 'match-viewer'].
# * Comment [String] - Comment associated with distribution.
# * CNAME [Array] - Array of associated cnames.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * Id [String] - Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Origin [String] - S3 origin bucket.
# * Status [String] - Status of distribution.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListDistributions.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListDistributions.html
#
def get_distribution_list(options = {})
request({
:expects => 200,

View file

@ -5,19 +5,21 @@ module Fog
require 'fog/aws/parsers/cdn/get_invalidation'
# ==== Parameters
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'Id'<~String> - Invalidation id
# * 'Status'<~String>
# * 'CreateTime'<~String>
# * 'InvalidationBatch'<~Array>:
# * 'Path'<~String>
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/2010-11-01/APIReference/GetInvalidation.html
# Get invalidation.
#
# @param distribution_id [String] Distribution id.
# @param invalidation_id [String] Invalidation id.
#
# @return [Excon::Response]
# * body [Hash]:
# * Id [String] - Invalidation id.
# * Status [String]
# * CreateTime [String]
# * InvalidationBatch [Array]:
# * Path [String]
#
# @see http://docs.amazonwebservices.com/AmazonCloudFront/2010-11-01/APIReference/GetInvalidation.html
def get_invalidation(distribution_id, invalidation_id)
request({
:expects => 200,

View file

@ -5,25 +5,23 @@ module Fog
require 'fog/aws/parsers/cdn/get_invalidation_list'
# ==== Parameters
# * options<~Hash> - config arguments for list. Defaults to {}.
# * 'Marker'<~String> - limits object keys to only those that appear
# lexicographically after its value.
# * 'MaxItems'<~Integer> - limits number of object keys returned
# Get invalidation list.
#
# @param options [Hash] Config arguments for list.
# @option options Marker [String] Limits object keys to only those that appear lexicographically after its value.
# @option options MaxItems [Integer] Limits number of object keys returned.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated
# * 'Marker'<~String> - Marker specified for query
# * 'MaxItems'<~Integer> - Maximum number of keys specified for query
# * 'NextMarker'<~String> - Marker to specify for next page (id of last result of current page)
# * 'InvalidationSummary'<~Array>:
# * 'Id'<~String>:
# * 'Status'<~String>:
# @return [Excon::Response]
# * body [Hash]:
# * IsTruncated [Boolean] - Whether or not the listing is truncated.
# * Marker [String] - Marker specified for query.
# * MaxItems [Integer] - Maximum number of keys specified for query.
# * NextMarker [String] - Marker to specify for next page (id of last result of current page).
# * InvalidationSummary [Array]:
# * Id [String]
# * Status [String]
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListInvalidation.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListInvalidation.html
def get_invalidation_list(distribution_id, options = {})
request({

View file

@ -5,35 +5,32 @@ module Fog
require 'fog/aws/parsers/cdn/streaming_distribution'
# Get information about a streaming distribution from CloudFront
# Get information about a streaming distribution from CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - id of distribution
# @param distribution_id [String] Id of distribution.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Status'<~String> - Status of distribution
# * 'StreamingDistributionConfig'<~Array>:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'CNAME'<~Array> - array of associated cnames
# * 'Comment'<~String> - comment associated with distribution
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'InProgressInvalidationBatches'<~Integer> - number of invalidation batches in progress
# * 'Logging'<~Hash>:
# * 'Bucket'<~String> - bucket logs are stored in
# * 'Prefix'<~String> - prefix logs are stored with
# * 'Origin'<~String> - s3 origin bucket
# * 'TrustedSigners'<~Array> - trusted signers
# @return [Excon::Response]
# * body [Hash]:
# * S3Origin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# * OriginAccessIdentity [String] - Optional: Used when serving private content.
# * Id [String] - Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Status [String] - Status of distribution.
# * StreamingDistributionConfig [Array]:
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
# * CNAME [Array] - Array of associated cnames.
# * Comment [String] - Comment associated with distribution.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * InProgressInvalidationBatches [Integer] - Number of invalidation batches in progress.
# * Logging [Hash]:
# * Bucket [String] - Bucket logs are stored in.
# * Prefix [String] - Prefix logs are stored with.
# * Origin [String] - S3 origin bucket.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/GetStreamingDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/GetStreamingDistribution.html
def get_streaming_distribution(distribution_id)
request({
:expects => 200,

View file

@ -5,43 +5,39 @@ module Fog
require 'fog/aws/parsers/cdn/get_streaming_distribution_list'
# List information about distributions in CloudFront
# List information about distributions in CloudFront.
#
# ==== Parameters
# * options<~Hash> - config arguments for list. Defaults to {}.
# * 'Marker'<~String> - limits object keys to only those that appear
# lexicographically after its value.
# * 'MaxItems'<~Integer> - limits number of object keys returned
# @param options [Hash] Config arguments for list.
# @option options Marker [String] Limits object keys to only those that appear lexicographically after its value.
# @option options MaxItems [Integer] Limits number of object keys returned.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'IsTruncated'<~Boolean> - Whether or not the listing is truncated
# * 'Marker'<~String> - Marker specified for query
# * 'MaxItems'<~Integer> - Maximum number of keys specified for query
# * 'NextMarker'<~String> - Marker to specify for next page (id of last result of current page)
# * 'StreamingDistributionSummary'<~Array>:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
# @return [Excon::Response]
# * body [Hash]:
# * IsTruncated [Boolean] - Whether or not the listing is truncated.
# * Marker [String] - Marker specified for query.
# * MaxItems [Integer] - Maximum number of keys specified for query.
# * NextMarker [String] - Marker to specify for next page (id of last result of current page).
# * StreamingDistributionSummary [Array]:
# * S3Origin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# * OriginAccessIdentity [String] - Optional: Used when serving private content.
# or
# * 'CustomOrigin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
# * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
# * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
# * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
# * 'Comment'<~String> - comment associated with distribution
# * 'CNAME'<~Array> - array of associated cnames
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Origin'<~String> - s3 origin bucket
# * 'Status'<~String> - Status of distribution
# * 'TrustedSigners'<~Array> - trusted signers
# * CustomOrigin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'www.example.com'.
# * HTTPPort [Integer] - HTTP port of origin, in [80, 443] or (1024...65535).
# * HTTPSPort [Integer] - HTTPS port of origin, in [80, 443] or (1024...65535).
# * OriginProtocolPolicy [String] - Policy on using http vs https, in ['http-only', 'match-viewer'].
# * Comment [String] - Comment associated with distribution.
# * CNAME [Array] - Array of associated cnames.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * Id [String] - Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Origin [String] - S3 origin bucket.
# * Status [String] - Status of distribution.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListStreamingDistributions.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListStreamingDistributions.html
def get_streaming_distribution_list(options = {})
request({
:expects => 200,

View file

@ -5,54 +5,52 @@ module Fog
require 'fog/aws/parsers/cdn/distribution'
# create a new distribution in CloudFront
# Create a new distribution in CloudFront.
#
# ==== Parameters
# * options<~Hash> - config for distribution. Defaults to {}.
# @param options [Hash] Config for distribution.
#
# REQUIRED:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
# * S3Origin [Hash]:
# * DNSName [String] Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# * OriginAccessIdentity [String] Optional: used when serving private content.
# or
# * 'CustomOrigin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
# * 'HTTPPort'<~Integer> - Optional HTTP port of origin, in [80, 443] or (1024...65535), defaults to 80
# * 'HTTPSPort'<~Integer> - Optional HTTPS port of origin, in [80, 443] or (1024...65535), defaults to 443
# * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
# * CustomOrigin [Hash]:
# * DNSName [String] Origin to associate with distribution, ie 'www.example.com'.
# * HTTPPort [Integer] Optional HTTP port of origin, in [80, 443] or (1024...65535), defaults to 80.
# * HTTPSPort [Integer] Optional HTTPS port of origin, in [80, 443] or (1024...65535), defaults to 443.
# * OriginProtocolPolicy [String] Policy on using http vs https, in ['http-only', 'match-viewer'].
# OPTIONAL:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'Comment'<~String> - Optional comment about distribution
# * 'CNAME'<~Array> - Optional array of strings to set as CNAMEs
# * 'DefaultRootObject'<~String> - Optional default object to return for '/'
# * 'Enabled'<~Boolean> - Whether or not distribution should accept requests, defaults to true
# * 'Logging'<~Hash>: Optional logging config
# * 'Bucket'<~String> - Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'
# * 'Prefix'<~String> - Optional prefix for log filenames, ie 'myprefix/'
# * 'OriginAccessIdentity'<~String> - Used for serving private content, in format 'origin-access-identity/cloudfront/ID'
# * 'RequiredProtocols'<~String> - Optional, set to 'https' to force https connections
# * 'TrustedSigners'<~Array> - Optional grant of rights to up to 5 aws accounts to generate signed URLs for private content, elements are either 'Self' for your own account or an AWS Account Number
# * CallerReference [String] Used to prevent replay, defaults to Time.now.to_i.to_s.
# * Comment [String] Optional comment about distribution.
# * CNAME [Array] Optional array of strings to set as CNAMEs.
# * DefaultRootObject [String] Optional default object to return for '/'.
# * Enabled [Boolean] Whether or not distribution should accept requests, defaults to true.
# * Logging [Hash]: Optional logging config.
# * Bucket [String] Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'.
# * Prefix [String] Optional prefix for log filenames, ie 'myprefix/'.
# * OriginAccessIdentity [String] Used for serving private content, in format 'origin-access-identity/cloudfront/ID'.
# * RequiredProtocols [String] Optional, set to 'https' to force https connections.
# * TrustedSigners [Array] Optional grant of rights to up to 5 aws accounts to generate signed URLs for private content, elements are either 'Self' for your own account or an AWS Account Number.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'DomainName'<~String>: Domain name of distribution
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Status'<~String> - Status of distribution
# * 'DistributionConfig'<~Array>:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'CNAME'<~Array> - array of associated cnames
# * 'Comment'<~String> - comment associated with distribution
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'Logging'<~Hash>:
# * 'Bucket'<~String> - bucket logs are stored in
# * 'Prefix'<~String> - prefix logs are stored with
# * 'Origin'<~String> - s3 origin bucket
# * 'TrustedSigners'<~Array> - trusted signers
# @return [Excon::Response]
# * body [Hash]:
# * DomainName [String] - Domain name of distribution.
# * Id [String] - Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Status [String] - Status of distribution.
# * DistributionConfig [Array]:
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
# * CNAME [Array] - Array of associated cnames.
# * Comment [String] - Comment associated with distribution.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * Logging [Hash]:
# * Bucket [String] - Bucket logs are stored in.
# * Prefix [String] - Prefix logs are stored with.
# * Origin [String] - S3 origin bucket.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html
def post_distribution(options = {})
options['CallerReference'] = Time.now.to_i.to_s
data = '<?xml version="1.0" encoding="UTF-8"?>'

View file

@ -5,27 +5,23 @@ module Fog
require 'fog/aws/parsers/cdn/post_invalidation'
# List information about distributions in CloudFront
# List information about distributions in CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - Id of distribution for invalidations
# * paths<~Array> - Array of string paths to objects to invalidate
# * caller_reference<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# @param distribution_id [String] Id of distribution for invalidations.
# @param paths [Array] Array of string paths to objects to invalidate.
# @param caller_reference [String] Used to prevent replay, defaults to Time.now.to_i.to_s.
#
# @return [Excon::Response]
# * body [Hash]:
# * Id [String] - Id of invalidation.
# * Status [String] - Status of invalidation.
# * CreateTime [Integer] - Time of invalidation creation.
# * InvalidationBatch [Array]:
# * Path [Array] - Array of strings of objects to invalidate.
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'Id'<~String> - Id of invalidation
# * 'Status'<~String> - Status of invalidation
# * 'CreateTime'<~Integer> - Time of invalidation creation
# * 'InvalidationBatch'<~Array>:
# * 'Path'<~Array> - Array of strings of objects to invalidate
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateInvalidation.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateInvalidation.html
def post_invalidation(distribution_id, paths, caller_reference = Time.now.to_i.to_s)
body = '<?xml version="1.0" encoding="UTF-8"?>'
body << "<InvalidationBatch>"

View file

@ -5,41 +5,39 @@ module Fog
require 'fog/aws/parsers/cdn/streaming_distribution'
# create a new streaming distribution in CloudFront
# Create a new streaming distribution in CloudFront.
#
# ==== Parameters
# * options<~Hash> - config for distribution. Defaults to {}.
# @param options [Hash] Config for distribution.
#
# REQUIRED:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * S3Origin [Hash]:
# * DNSName [String] Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# OPTIONAL:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'Comment'<~String> - Optional comment about distribution
# * 'CNAME'<~Array> - Optional array of strings to set as CNAMEs
# * 'Enabled'<~Boolean> - Whether or not distribution should accept requests, defaults to true
# * 'Logging'<~Hash>: Optional logging config
# * 'Bucket'<~String> - Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'
# * 'Prefix'<~String> - Optional prefix for log filenames, ie 'myprefix/'
# * CallerReference [String] Used to prevent replay, defaults to Time.now.to_i.to_s.
# * Comment [String] Optional comment about distribution.
# * CNAME [Array] Optional array of strings to set as CNAMEs.
# * Enabled [Boolean] Whether or not distribution should accept requests, defaults to true.
# * Logging [Hash]: Optional logging config.
# * Bucket [String] Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'.
# * Prefix [String] Optional prefix for log filenames, ie 'myprefix/'.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'Id'<~String> - Id of distribution
# * 'Status'<~String> - Status of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'DomainName'<~String>: Domain name of distribution
# * 'StreamingDistributionConfig'<~Array>:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'CNAME'<~Array> - array of associated cnames
# * 'Comment'<~String> - comment associated with distribution
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'Logging'<~Hash>:
# * 'Bucket'<~String> - bucket logs are stored in
# * 'Prefix'<~String> - prefix logs are stored with
# @return [Excon::Response]
# * body[Hash]:
# * Id [String] - Id of distribution.
# * Status'[String] - Status of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * DomainName [String] - Domain name of distribution.
# * StreamingDistributionConfig [Array]:
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
# * CNAME [Array] - Array of associated cnames.
# * Comment [String] - Comment associated with distribution.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * Logging [Hash]:
# * Bucket [String] - Bucket logs are stored in.
# * Prefix [String] - Prefix logs are stored with.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateStreamingDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateStreamingDistribution.html
def post_streaming_distribution(options = {})
options['CallerReference'] = Time.now.to_i.to_s
data = '<?xml version="1.0" encoding="UTF-8"?>'

View file

@ -5,55 +5,53 @@ module Fog
require 'fog/aws/parsers/cdn/distribution'
# update a distribution in CloudFront
# Update a distribution in CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - Id of distribution to update config for
# * options<~Hash> - config for distribution. Defaults to {}.
# @parm distribution_id [String] Id of distribution to update config for.
# @param options [Hash] Config for distribution.
#
# REQUIRED:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
# * S3Origin [Hash]:
# * DNSName [String] - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# * OriginAccessIdentity [String] - Optional: Used when serving private content.
# or
# * 'CustomOrigin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
# * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
# * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
# * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
# * CustomOrigin [Hash]:
# * DNSName [String] - Origin to associate with distribution, ie 'www.example.com'.
# * HTTPPort [Integer] - HTTP port of origin, in [80, 443] or (1024...65535).
# * HTTPSPort [Integer] - HTTPS port of origin, in [80, 443] or (1024...65535).
# * OriginProtocolPolicy [String] - Policy on using http vs https, in ['http-only', 'match-viewer'].
# OPTIONAL:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'Comment'<~String> - Optional comment about distribution
# * 'CNAME'<~Array> - Optional array of strings to set as CNAMEs
# * 'DefaultRootObject'<~String> - Optional default object to return for '/'
# * 'Enabled'<~Boolean> - Whether or not distribution should accept requests, defaults to true
# * 'Logging'<~Hash>: Optional logging config
# * 'Bucket'<~String> - Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'
# * 'Prefix'<~String> - Optional prefix for log filenames, ie 'myprefix/'
# * 'OriginAccessIdentity'<~String> - Used for serving private content, in format 'origin-access-identity/cloudfront/ID'
# * 'RequiredProtocols'<~String> - Optional, set to 'https' to force https connections
# * 'TrustedSigners'<~Array> - Optional grant of rights to up to 5 aws accounts to generate signed URLs for private content, elements are either 'Self' for your own account or an AWS Account Number
# * CallerReference [String] Used to prevent replay, defaults to Time.now.to_i.to_s.
# * Comment [String] Optional comment about distribution.
# * CNAME [Array] Optional array of strings to set as CNAMEs.
# * DefaultRootObject [String] Optional default object to return for '/'.
# * Enabled [Boolean] Whether or not distribution should accept requests, defaults to true.
# * Logging [Hash]: Optional logging config.
# * Bucket [String] Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'.
# * Prefix [String] Optional prefix for log filenames, ie 'myprefix/'.
# * OriginAccessIdentity [String] Used for serving private content, in format 'origin-access-identity/cloudfront/ID'.
# * RequiredProtocols [String] Optional, set to 'https' to force https connections.
# * TrustedSigners [Array] Optional grant of rights to up to 5 aws accounts to generate signed URLs for private content, elements are either 'Self' for your own account or an AWS Account Number.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'DomainName'<~String>: Domain name of distribution
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Status'<~String> - Status of distribution
# * 'DistributionConfig'<~Array>:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'CNAME'<~Array> - array of associated cnames
# * 'Comment'<~String> - comment associated with distribution
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'Logging'<~Hash>:
# * 'Bucket'<~String> - bucket logs are stored in
# * 'Prefix'<~String> - prefix logs are stored with
# * 'Origin'<~String> - s3 origin bucket
# * 'TrustedSigners'<~Array> - trusted signers
# @return [Excon::Response]
# * body [Hash]:
# * DomainName [String]: Domain name of distribution.
# * Id [String] - Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Status [String] - Status of distribution.
# * DistributionConfig [Array]:
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
# * CNAME [Array] - Array of associated cnames.
# * Comment [String] - Comment associated with distribution.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * Logging [Hash]:
# * Bucket [String] - Bucket logs are stored in.
# * Prefix [String] - Prefix logs are stored with.
# * Origin [String] - S3 origin bucket.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html
def put_distribution_config(distribution_id, etag, options = {})
data = '<?xml version="1.0" encoding="UTF-8"?>'
data << "<DistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"

View file

@ -5,44 +5,42 @@ module Fog
require 'fog/aws/parsers/cdn/streaming_distribution'
# update a streaming distribution in CloudFront
# Update a streaming distribution in CloudFront.
#
# ==== Parameters
# * distribution_id<~String> - Id of distribution to update config for
# * options<~Hash> - config for distribution. Defaults to {}.
# @param distribution_id [String] - Id of distribution to update config for.
# @param options [Hash] - Config for distribution.
#
# REQUIRED:
# * 'S3Origin'<~Hash>:
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
# * S3Origin [Hash]:
# * DNSName [String] Origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'.
# OPTIONAL:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'Comment'<~String> - Optional comment about distribution
# * 'CNAME'<~Array> - Optional array of strings to set as CNAMEs
# * 'Enabled'<~Boolean> - Whether or not distribution should accept requests, defaults to true
# * 'Logging'<~Hash>: Optional logging config
# * 'Bucket'<~String> - Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'
# * 'Prefix'<~String> - Optional prefix for log filenames, ie 'myprefix/'
# @option options CallerReference [String] Used to prevent replay, defaults to Time.now.to_i.to_s
# @option options Comment [String] Optional comment about distribution
# @option options CNAME [Array] Optional array of strings to set as CNAMEs
# @option options Enabled [Boolean] Whether or not distribution should accept requests, defaults to true
# @option options Logging [Hash]: Optional logging config
# * Bucket [String] Bucket to store logs in, ie 'mylogs.s3.amazonaws.com'
# * Prefix String] Optional prefix for log filenames, ie 'myprefix/'
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'DomainName'<~String>: Domain name of distribution
# * 'Id'<~String> - Id of distribution
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
# * 'Status'<~String> - Status of distribution
# * 'StreamingDistributionConfig'<~Array>:
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
# * 'CNAME'<~Array> - array of associated cnames
# * 'Comment'<~String> - comment associated with distribution
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
# * 'Logging'<~Hash>:
# * 'Bucket'<~String> - bucket logs are stored in
# * 'Prefix'<~String> - prefix logs are stored with
# * 'Origin'<~String> - s3 origin bucket
# * 'TrustedSigners'<~Array> - trusted signers
# @return [Excon::Response]
# * body [Hash]:
# * DomainName [String] - Domain name of distribution.
# * Id [String] - Id of distribution.
# * LastModifiedTime [String] - Timestamp of last modification of distribution.
# * Status [String] - Status of distribution.
# * StreamingDistributionConfig [Array]:
# * CallerReference [String] - Used to prevent replay, defaults to Time.now.to_i.to_s.
# * CNAME [Array] - Array of associated cnames.
# * Comment [String] - Comment associated with distribution.
# * Enabled [Boolean] - Whether or not distribution is enabled.
# * Logging [Hash]:
# * Bucket [String] - Bucket logs are stored in.
# * Prefix [String] - Prefix logs are stored with.
# * Origin [String] - S3 origin bucket.
# * TrustedSigners [Array] - Trusted signers.
#
# ==== See Also
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/PutStreamingDistribution.html
# @see http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/PutStreamingDistribution.html
def put_streaming_distribution_config(distribution_id, etag, options = {})
data = '<?xml version="1.0" encoding="UTF-8"?>'
data << "<StreamingDistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"

View file

@ -5,29 +5,25 @@ module Fog
require 'fog/aws/parsers/cloud_formation/create_stack'
# Create a stack
#
# ==== Parameters
# * stack_name<~String>: name of the stack to create
# * options<~Hash>:
# * TemplateBody<~String>: structure containing the template body
# Create a stack.
#
# * stack_name [String] Name of the stack to create.
# * options [Hash]:
# * TemplateBody [String] Structure containing the template body.
# or (one of the two Template parameters is required)
# * TemplateURL<~String>: URL of file containing the template body
# * DisableRollback<~Boolean>: Controls rollback on stack creation failure, defaults to false
# * NotificationARNs<~Array>: List of SNS topics to publish events to
# * Parameters<~Hash>: Hash of providers to supply to template
# * TimeoutInMinutes<~Integer>: Minutes to wait before status is set to CREATE_FAILED
# * Capabilities<~Array>: List of capabilties the stack is granted. Currently CAPABILITY_IAM
# for allowing the creation of IAM resources
# * TemplateURL [String] URL of file containing the template body.
# * DisableRollback [Boolean] Controls rollback on stack creation failure, defaults to false.
# * NotificationARNs [Array] List of SNS topics to publish events to.
# * Parameters [Hash] Hash of providers to supply to template
# * TimeoutInMinutes [Integer] Minutes to wait before status is set to CREATE_FAILED
# * Capabilities [Array] List of capabilties the stack is granted. Currently CAPABILITY_IAM for allowing the creation of IAM resources
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'StackId'<~String> - Id of the new stack
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html
# @return [Excon::Response]:
# * body [Hash:
# * StackId [String] - Id of the new stack
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html
def create_stack(stack_name, options = {})
params = {
'StackName' => stack_name,

View file

@ -5,17 +5,14 @@ module Fog
require 'fog/aws/parsers/cloud_formation/basic'
# Delete a stack
# Delete a stack.
#
# ==== Parameters
# * stack_name<~String>: name of the stack to create
# @param stack_name String] Name of the stack to create.
#
# ==== Returns
# * response<~Excon::Response>:
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DeleteStack.html
# @return [Excon::Response]
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DeleteStack.html
def delete_stack(stack_name)
request(
'Action' => 'DeleteStack',

View file

@ -5,31 +5,28 @@ module Fog
require 'fog/aws/parsers/cloud_formation/describe_stack_events'
# Describe stack events
# Describe stack events.
#
# ==== Parameters
# * stack_name<~String>: stack name to return events for
# * options<~Hash>:
# * NextToken<~String>: identifies the start of the next list of events, if there is one
# @param stack_name [String] stack name to return events for.
# @param options [Hash]
# @option options NextToken [String] Identifies the start of the next list of events, if there is one.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'StackEvents'<~Array> - Matching resources
# * event<~Hash>:
# * 'EventId'<~String> -
# * 'StackId'<~String> -
# * 'StackName'<~String> -
# * 'LogicalResourceId'<~String> -
# * 'PhysicalResourceId'<~String> -
# * 'ResourceType'<~String> -
# * 'Timestamp'<~Time> -
# * 'ResourceStatus'<~String> -
# * 'ResourceStatusReason'<~String> -
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStackEvents.html
# @return [Excon::Response]
# * body [Hash]:
# * StackEvents [Array] - Matching resources
# * event [Hash]:
# * EventId [String] -
# * StackId [String] -
# * StackName [String] -
# * LogicalResourceId [String] -
# * PhysicalResourceId [String] -
# * ResourceType [String] -
# * Timestamp [Time] -
# * ResourceStatus [String] -
# * ResourceStatusReason [String] -
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStackEvents.html
def describe_stack_events(stack_name, options = {})
request({
'Action' => 'DescribeStackEvents',

View file

@ -5,31 +5,28 @@ module Fog
require 'fog/aws/parsers/cloud_formation/describe_stack_resources'
# Describe stack resources
# Describe stack resources.
#
# ==== Parameters
# * options<~Hash>:
# * 'PhysicalResourceId'<~String>: name or unique identifier that corresponds to a physical instance ID
# @param options Hash]:
# * PhysicalResourceId [String] name or unique identifier that corresponds to a physical instance ID
# or (one of PhysicalResourceId and StackName is required)
# * 'StackName'<~String>: only return events related to this stack name
# * 'LogicalResourceId'<~String>: logical name of the resource as specified in the template
# * StackName [String] Only return events related to this stack name
# * LogicalResourceId [String] Logical name of the resource as specified in the template
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'StackResources'<~Array> - Matching resources
# * resource<~Hash>:
# * 'StackId'<~String> -
# * 'StackName'<~String> -
# * 'LogicalResourceId'<~String> -
# * 'PhysicalResourceId'<~String> -
# * 'ResourceType'<~String> -
# * 'Timestamp'<~Time> -
# * 'ResourceStatus'<~String> -
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html
# @return [Excon::Response]
# * body [Hash]:
# * StackResources [Array] - Matching resources
# * resource [Hash]:
# * StackId [String] -
# * StackName [String] -
# * LogicalResourceId [String] -
# * PhysicalResourceId [String] -
# * ResourceType [String] -
# * Timestamp [Time] -
# * ResourceStatus [String] -
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html
def describe_stack_resources(options = {})
request({
'Action' => 'DescribeStackResources',

View file

@ -5,30 +5,27 @@ module Fog
require 'fog/aws/parsers/cloud_formation/describe_stacks'
# Describe stacks
# Describe stacks.
#
# ==== Parameters
# * options<~Hash>:
# * 'StackName'<~String>: name of the stack to describe
# @param options [Hash]
# @option options StackName [String] Name of the stack to describe.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'Stacks'<~Array> - Matching stacks
# * stack<~Hash>:
# * 'StackName'<~String> -
# * 'StackId'<~String> -
# * 'CreationTime'<~String> -
# * 'StackStatus'<~String> -
# * 'DisableRollback'<~String> -
# * 'Outputs'<~Array> -
# * output<~Hash>:
# * 'OutputKey'<~String> -
# * 'OutputValue'<~String> -
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStacks.html
# @return [Excon::Response]
# * body [Hash]:
# * Stacks [Array] - Matching stacks
# * stack [Hash]:
# * StackName [String] -
# * StackId [String] -
# * CreationTime [String] -
# * StackStatus [String] -
# * DisableRollback [String] -
# * Outputs [Array] -
# * output [Hash]:
# * OutputKey [String] -
# * OutputValue [String] -
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStacks.html
def describe_stacks(options = {})
request({
'Action' => 'DescribeStacks',

View file

@ -5,19 +5,16 @@ module Fog
require 'fog/aws/parsers/cloud_formation/get_template'
# Describe stacks
# Describe stacks.
#
# ==== Parameters
# * stack_name<~String> - stack name to get template from
# @param stack_name [String] stack name to get template from
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'TemplateBody'<~String> - structure containing the template body (json)
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_GetTemplate.html
# @return [Excon::Response]
# * body [Hash]:
# * TemplateBody [String] - structure containing the template body (json)
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_GetTemplate.html
def get_template(stack_name)
request(
'Action' => 'GetTemplate',

View file

@ -5,26 +5,22 @@ module Fog
require 'fog/aws/parsers/cloud_formation/update_stack'
# Update a stack
# Update a stack.
#
# ==== Parameters
# * stack_name<~String>: name of the stack to update
# * options<~Hash>:
# * TemplateBody<~String>: structure containing the template body
# @parm stack_name [String] Name of the stack to update.
# @parm options [Hash]
# * TemplateBody [String] Structure containing the template body.
# or (one of the two Template parameters is required)
# * TemplateURL<~String>: URL of file containing the template body
# * Parameters<~Hash>: Hash of providers to supply to template
# * Capabilities<~Array>: List of capabilties the stack is granted. Currently CAPABILITY_IAM
# for allowing the creation of IAM resources
# * TemplateURL [String] URL of file containing the template body.
# * Parameters [Hash] Hash of providers to supply to template.
# * Capabilities [Array] List of capabilties the stack is granted. Currently CAPABILITY_IAM for allowing the creation of IAM resources.
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'StackId'<~String> - Id of the stack being updated
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html
# @return [Excon::Response]
# * body [Hash]:
# * StackId [String] - Id of the stack being updated
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html
def update_stack(stack_name, options = {})
params = {
'StackName' => stack_name,

View file

@ -5,22 +5,19 @@ module Fog
require 'fog/aws/parsers/cloud_formation/validate_template'
# Describe stacks
# Describe stacks.
#
# ==== Parameters
# * options<~Hash>:
# * 'TemplateBody'<~String> - template structure
# * 'TemplateURL'<~String> - template url
# @para options [Hash]
# @option options TemplateBody [String] template structure
# @option options TemplateURL [String] template url
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'Description'<~String> - description found within the template
# * 'Parameters'<~String> - list of template parameter structures
# @return [Excon::Response]
# * body [Hash]:
# * Description [String] - description found within the template
# * Parameters [String] - list of template parameter structures
#
# ==== See Also
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_ValidateTemplate.html
#
def validate_template(options = {})
request({
'Action' => 'ValidateTemplate',

View file

@ -48,19 +48,25 @@ module Fog
address = public_ip.nil? ? nil : self.data[:addresses][public_ip]
if ((instance && address) || (instance && !allocation_id.nil?) || (!allocation_id.nil? && !network_interface_id.nil?))
if !allocation_id.nil?
allocation_ip = describe_addresses( 'allocation-id' => "#{allocation_id}").body['addressesSet']
public_ip = allocation_ip['publicIp']
allocation_ip = describe_addresses( 'allocation-id' => "#{allocation_id}").body['addressesSet'].first
if !allocation_ip.nil?
public_ip = allocation_ip['publicIp']
end
end
if current_instance = self.data[:instances][address['instanceId']]
current_instance['ipAddress'] = current_instance['originalIpAddress']
if !address.nil?
if current_instance = self.data[:instances][address['instanceId']]
current_instance['ipAddress'] = current_instance['originalIpAddress']
end
address['instanceId'] = instance_id
end
address['instanceId'] = instance_id
# detach other address (if any)
if self.data[:addresses][instance['ipAddress']]
self.data[:addresses][instance['ipAddress']]['instanceId'] = nil
end
instance['ipAddress'] = public_ip
instance['dnsName'] = Fog::AWS::Mock.dns_name_for(public_ip)
if !public_ip.nil?
instance['ipAddress'] = public_ip
instance['dnsName'] = Fog::AWS::Mock.dns_name_for(public_ip)
end
response.status = 200
if !instance_id.nil? && !public_ip.nil?
response.body = {

View file

@ -14,6 +14,7 @@ module Fog
# @option options If-Unmodified-Since [Time] Returns object only if it has not been modified since this time, otherwise returns 412 (Precodition Failed).
# @option options Range [String] Range of object to download
# @option options versionId [String] specify a particular version to retrieve
# @option options query[Hash] specify additional query string
#
# @return [Excon::Response] response:
# * body [String]- Contents of object
@ -34,8 +35,11 @@ module Fog
end
params = { :headers => {} }
params[:query] = options.delete('query') || {}
if version_id = options.delete('versionId')
params[:query] = {'versionId' => version_id}
params[:query] = params[:query].merge({'versionId' => version_id})
end
params[:headers].merge!(options)
if options['If-Modified-Since']
@ -54,7 +58,7 @@ module Fog
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'GET',
:path => CGI.escape(object_name),
:path => CGI.escape(object_name)
}))
end

View file

@ -7,7 +7,7 @@ module Fog
extend Fog::AWS::CredentialFetcher::ServiceMethods
requires :aws_access_key_id, :aws_secret_access_key
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at
recognizes :endpoint, :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style
secrets :aws_secret_access_key, :hmac
@ -294,6 +294,7 @@ module Fog
@persistent = options.fetch(:persistent, false)
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@path_style = options[:path_style] || false
end
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
end
@ -324,11 +325,12 @@ DATA
string_to_sign << canonical_amz_headers
subdomain = params[:host].split(".#{@host}").first
unless subdomain =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
Fog::Logger.warning("fog: the specified s3 bucket name(#{subdomain}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
valid_dns = !!(subdomain =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/)
if !valid_dns || @path_style
Fog::Logger.warning("fog: the specified s3 bucket name(#{subdomain}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html") unless valid_dns
params[:host] = params[:host].split("#{subdomain}.")[-1]
if params[:path]
params[:path] = "#{subdomain}/#{params[:path]}"
params[:path] = "#{subdomain}/#{params[:path]}" unless subdomain == @host
else
params[:path] = subdomain
end

View file

@ -81,13 +81,13 @@ require 'fog/bin/local'
require 'fog/bin/bare_metal_cloud'
require 'fog/bin/ninefold'
require 'fog/bin/rackspace'
require 'fog/bin/riakcs'
require 'fog/bin/openstack'
require 'fog/bin/ovirt'
require 'fog/bin/serverlove'
require 'fog/bin/stormondemand'
require 'fog/bin/terremark'
require 'fog/bin/vcloud'
require 'fog/bin/virtual_box'
require 'fog/bin/vmfusion'
require 'fog/bin/vsphere'
require 'fog/bin/voxel'

View file

@ -7,6 +7,8 @@ class Bluebox < Fog::Bin
Fog::Compute::Bluebox
when :dns
Fog::DNS::Bluebox
when :blb
Fog::Bluebox::BLB
else
raise ArgumentError, "Unsupported #{self} service: #{key}"
end

27
lib/fog/bin/riakcs.rb Normal file
View file

@ -0,0 +1,27 @@
class RiakCS < Fog::Bin
class << self
def class_for(key)
case key
when :provisioning
Fog::RiakCS::Provisioning
when :usage
Fog::RiakCS::Usage
else
raise ArgumentError, "Unrecognized service: #{key}"
end
end
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = class_for(key)
end
@@connections[service]
end
def services
Fog::RiakCS.services
end
end
end

View file

@ -1,57 +0,0 @@
module VirtualBox # deviates from other bin stuff to accomodate gem
class << self
def class_for(key)
case key
when :compute
Fog::Compute::VirtualBox
else
raise ArgumentError, "Unrecognized service: #{key}"
end
end
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :compute
Fog::Logger.warning("VirtualBox[:compute] is not recommended, use Compute[:virtualbox] for portability")
Fog::Compute.new(:provider => 'VirtualBox')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"
end
end
@@connections[service]
end
def available?
availability = if Gem::Specification.respond_to?(:find_all_by_name)
!Gem::Specification.find_all_by_name('virtualbox').empty? # newest rubygems
else
!Gem.source_index.find_name('virtualbox').empty? # legacy
end
if availability
for service in services
for collection in self.class_for(service).collections
unless self.respond_to?(collection)
self.class_eval <<-EOS, __FILE__, __LINE__
def self.#{collection}
self[:#{service}].#{collection}
end
EOS
end
end
end
end
availability
end
def collections
services.map {|service| self[service].collections}.flatten.sort_by {|service| service.to_s}
end
def services
Fog::VirtualBox.services
end
end
end

View file

@ -5,6 +5,7 @@ module Fog
extend Fog::Provider
service(:blb, 'bluebox/blb', 'BLB')
service(:compute, 'bluebox/compute', 'Compute')
service(:dns, 'bluebox/dns', 'DNS')

85
lib/fog/bluebox/blb.rb Normal file
View file

@ -0,0 +1,85 @@
require 'fog/bluebox'
module Fog
module Bluebox
class BLB < Fog::Service
requires :bluebox_api_key, :bluebox_customer_id
recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent
model_path 'fog/bluebox/models/blb'
model :lb_application
collection :lb_applications
model :lb_service
collection :lb_services
model :lb_backend
collection :lb_backends
request_path 'fog/bluebox/requests/blb'
request :get_lb_application
request :get_lb_applications
request :get_lb_service
request :get_lb_services
request :get_lb_backend
request :get_lb_backends
request :add_machine_to_lb_application
request :add_machine_to_lb_backend
request :remove_machine_from_lb_backend
request :update_lb_backend_machine
class Mock
end
class Real
def initialize(options={})
@bluebox_api_key = options[:bluebox_api_key]
@bluebox_customer_id = options[:bluebox_customer_id]
@connection_options = options[:connection_options] || {}
@host = options[:bluebox_host] || "boxpanel.bluebox.net"
@persistent = options[:persistent] || false
@port = options[:bluebox_port] || 443
@scheme = options[:bluebox_scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end
def reload
@connection.reset
end
def request(params)
params[:headers] ||= {}
params[:headers].merge!({
'Authorization' => "Basic #{Base64.encode64([@bluebox_customer_id, @bluebox_api_key].join(':')).delete("\r\n")}"
})
begin
response = @connection.request(params.merge!({:host => @host}))
rescue Excon::Errors::HTTPStatusError => error
raise case error
when Excon::Errors::NotFound
Fog::Compute::Bluebox::NotFound.slurp(error)
else
error
end
end
unless response.body.empty? || params[:headers]['Accept'] == 'text/plain'
response.body = Fog::JSON.decode(response.body)
end
response
end
end
end
end
end

View file

@ -0,0 +1,32 @@
require 'fog/core/model'
module Fog
module Bluebox
class BLB
class LbApplication < Fog::Model
identity :id
attribute :name
attribute :ip_v4
attribute :ip_v6
attribute :description
attribute :created, :aliases => 'created_at'
def add_machine(lb_machine_id, options)
requires :id
service.add_machine_to_lb_application(id, lb_machine_id, options)
end
def lb_services
Fog::Bluebox::BLB::LbServices.new({
:service => service,
:lb_application => self
})
end
end
end
end
end

View file

@ -0,0 +1,26 @@
require 'fog/bluebox/models/blb/lb_application'
module Fog
module Bluebox
class BLB
class LbApplications < Fog::Collection
model Fog::Bluebox::BLB::LbApplication
def all
data = service.get_lb_applications.body
load(data)
end
def get(application_id)
if application_id && application = service.get_lb_application(application_id).body
new(application)
end
rescue Fog::Bluebox::BLB::NotFound
nil
end
end
end
end
end

View file

@ -0,0 +1,22 @@
require 'fog/core/model'
module Fog
module Bluebox
class BLB
class LbBackend < Fog::Model
identity :id
attribute :name
attribute :lb_machines
attribute :monitoring_url
attribute :monitoring_url_hostname
attribute :acl_name
attribute :acl_rule
attribute :check_interval
end
end
end
end

View file

@ -0,0 +1,30 @@
require 'fog/core/collection'
require 'fog/bluebox/models/blb/lb_backend'
module Fog
module Bluebox
class BLB
class LbBackends < Fog::Collection
model Fog::Bluebox::BLB::LbBackend
attr_accessor :lb_service
def all
data = service.get_lb_backends(lb_service.id).body
load(data)
end
def get(lb_backend_id)
if lb_backend = service.get_lb_backend(lb_service.id, lb_backend_id).body
new(lb_backend)
end
rescue Fog::Compute::Bluebox::NotFound
nil
end
end
end
end
end

View file

@ -0,0 +1,35 @@
require 'fog/core/model'
module Fog
module Bluebox
class BLB
class LbService < Fog::Model
identity :id
attribute :name
attribute :port
attribute :service_type
attribute :private
attribute :status_url
attribute :status_username
attribute :status_password
attribute :created, :aliases => 'created_at'
def lb_application
collection.lb_application
end
def lb_backends
Fog::Bluebox::BLB::LbBackends.new({
:service => service,
:lb_service => self
})
end
end
end
end
end

View file

@ -0,0 +1,29 @@
require 'fog/core/collection'
require 'fog/bluebox/models/blb/lb_service'
module Fog
module Bluebox
class BLB
class LbServices < Fog::Collection
model Fog::Bluebox::BLB::LbService
attr_accessor :lb_application
def all
data = service.get_lb_services(lb_application.id).body
load(data)
end
def get(lb_service_id)
if lb_service = service.get_lb_service(lb_application.id, lb_service_id).body
new(lb_service)
end
rescue Fog::Bluebox::BLB::NotFound
nil
end
end
end
end
end

View file

@ -0,0 +1,33 @@
module Fog
module Bluebox
class BLB
class Real
# Add machine to default lb_backend for each lb_service
# in the application.
#
# === Parameters
# * lb_application_id<~String> - ID of application
# * lb_machine_id<~String> - ID of machine
# * options<~Hash>:
# * port<~Integer> - port machine listens on; defaults to service listening port
# * maxconn<~Integer> - maximum number of connections server can be sent
# * backup<~Boolean> - only send traffic to machine if all others are down
#
def add_machine_to_lb_application(lb_application_id, lb_machine_id, options = {})
# convert to CGI array args
body = Hash[options.map {|k,v| ["lb_options[#{k}]", v] }]
body['lb_machine'] = lb_machine_id
request(
:expects => 200,
:method => 'POST',
:path => "/api/lb_applications/add_machine/#{lb_application_id}.json",
:body => body.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v.to_s)}"}.join('&')
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,31 @@
module Fog
module Bluebox
class BLB
class Real
# Add machine to specified lb_backend
#
# === Parameters
# * lb_backend_id<~String> - ID of backend
# * lb_machine_id<~String> - ID of machine
# * options<~Hash>:
# * port<~Integer> - port machine listens on; defaults to service listening port
# * maxconn<~Integer> - maximum number of connections server can be sent
# * backup<~Boolean> - only send traffic to machine if all others are down
def add_machine_to_lb_backend(lb_backend_id, lb_machine_id, options = {})
# convert to CGI array args
body = Hash[options.map {|k,v| ["lb_options[#{k}]", v] }]
body['lb_machine'] = lb_machine_id
request(
:expects => 200,
:method => 'POST',
:path => "/api/lb_backends/#{lb_backend_id}/lb_machines.json",
:body => body.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v.to_s)}"}.join('&')
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,33 @@
module Fog
module Bluebox
class BLB
class Real
# Get details of an lb_application.
#
# ==== Parameters
# * lb_application_id<~Integer> - ID of application
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'id'<~String> - UUID of application
# * 'ip_v4'<~Array> - IPv4 addresses
# * 'ip_v6'<~String> - IPv6 address
# * 'name'<~String> - The hostname
# * 'lb_services'<~Array> - Listening services
# * 'source_ip_v4'<~String> - address that application connects to pool members from (v1 only)
def get_lb_application(lb_application_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_applications/#{lb_application_id}.json"
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,31 @@
module Fog
module Bluebox
class BLB
class Real
# Get list of applications
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * 'application'<~Hash>:
# * 'id'<~String> - UUID of application
# * 'ip_v4'<~Array> - IPv4 addresses
# * 'ip_v6'<~String> - IPv6 address
# * 'name'<~String> - The hostname
# * 'lb_services'<~Array> - Listening services
# * 'source_ip_v4'<~String> - address that application connects to pool members from (v1 only)
def get_lb_applications
request(
:expects => 200,
:method => 'GET',
:path => 'api/lb_applications.json'
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,36 @@
module Fog
module Bluebox
class BLB
class Real
# Get details of an lb_backend.
#
# ==== Parameters
# * lb_service_id<~String> - service backend belongs to
# * lb_backend_id<~String> - backend to look up
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * id<~String> - backend ID
# * backend_name<~String>
# * lb_machines<~Array> - array of backend members
# * acl_name<~String> - name of ACL for this backend
# * acl_rule<~String>
# * monitoring_url_hostname<~String> - HTTP host header for health check
# * monitoring_url<~String> - URL for health check
# * check_interval<~Integer> - time between checks, in milliseconds
def get_lb_backend(lb_service_id, lb_backend_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_services/#{lb_service_id}/lb_backends/#{lb_backend_id}.json"
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,36 @@
module Fog
module Bluebox
class BLB
class Real
# Get list of backends
#
# ==== Parameters
# * lb_service_id<~String> - service containing backends
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * backend<~Hash>:
# * id<~String> - backend ID
# * backend_name<~String>
# * lb_machines<~Array> - array of backend members
# * acl_name<~String> - name of ACL for this backend
# * acl_rule<~String>
# * monitoring_url_hostname<~String> - HTTP host header for health check
# * monitoring_url<~String> - URL for health check
# * check_interval<~Integer> - time between checks, in milliseconds
def get_lb_backends(lb_service_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_services/#{lb_service_id}/lb_backends.json"
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,35 @@
module Fog
module Bluebox
class BLB
class Real
# Get details of an lb_machine.
#
# ==== Parameters
# * lb_backend_id<~String> - backend machine belongs to
# * lb_machine_id<~String> - machine to look up
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * id<~String> - machine ID
# * ip<~String> - machine IP address for this member (v4 or v6)
# * port<~Integer> - service port for this member
# * hostname<~String> - name as registered with Box Panel
# * acl_name<~String> - name of ACL for this machine
# * created<~DateTime> - when machine was added to load balancer backend
# * maxconn<~Integer> - maximum concurrent connections for this member (BLBv2 only)
def get_lb_machine(lb_backend_id, lb_machine_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_backends/#{lb_backend_id}/lb_machines/#{lb_machine_id}.json"
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,35 @@
module Fog
module Bluebox
class BLB
class Real
# Get list of machines
#
# ==== Parameters
# * lb_backend_id<~String> - backend containing machines
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * machine<~Hash>:
# * id<~String> - machine ID
# * ip<~String> - machine IP address for this member (v4 or v6)
# * port<~Integer> - service port for this member
# * hostname<~String> - name as registered with Box Panel
# * acl_name<~String> - name of ACL for this machine
# * created<~DateTime> - when machine was added to load balancer backend
# * maxconn<~Integer> - maximum concurrent connections for this member (BLBv2 only)
def get_lb_machines(lb_backend_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_backends/#{lb_backend_id}/lb_machines.json"
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,36 @@
module Fog
module Bluebox
class BLB
class Real
# Get details of a lb_service.
#
# ==== Parameters
# * lb_application_id<~String> - ID of application the service belongs to
# * lb_service_id<~String> - ID of service to look up
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * name<~String> - service name
# * port<~Integer> - port of load balanced service
# * private<~Boolean> - whether service is only available internally
# * status_username<~String> - HTTP basic auth username
# * status_password<~String> - HTTP basic auth password
# * status_url<~String> - URL of stats page
# * service_type<~String> - proto being load balanced (e.g. 'http', 'tcp')
# * created<~DateTime> - when service was created
def get_lb_service(lb_application_id, lb_service_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_applications/#{lb_application_id}/lb_services/#{lb_service_id}.json",
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,36 @@
module Fog
module Bluebox
class BLB
class Real
# Get list of load balancing services
#
# ==== Parameters
# * lb_application_id<~String> - Id of application services to list
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * backend<~Hash>:
# * name<~String> - service name
# * port<~Integer> - port of load balanced service
# * private<~Boolean> - whether service is only available internally
# * status_username<~String> - HTTP basic auth username
# * status_password<~String> - HTTP basic auth password
# * status_url<~String> - URL of stats page
# * service_type<~String> - proto being load balanced (e.g. 'http', 'tcp')
# * created<~DateTime> - when service was created
def get_lb_services(lb_application_id)
request(
:expects => 200,
:method => 'GET',
:path => "api/lb_applications/#{lb_application_id}/lb_services.json"
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,28 @@
module Fog
module Bluebox
class BLB
class Real
# remove machine from single backend
#
# === Parameters
# * lb_backend_id<~String> - ID of backend
# * lb_machine_id<~String> - ID of machine
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~String> - success or failure message
def remove_machine_from_lb_backend(lb_backend_id, lb_machine_id)
request(
:expects => 200,
:method => 'DELETE',
:path => "/api/lb_backends/#{lb_backend_id}/lb_machines/#{lb_machine_id}",
:headers => {"Accept" => "text/plain"},
)
end
end
class Mock
end
end
end
end

View file

@ -0,0 +1,29 @@
module Fog
module Bluebox
class BLB
class Real
# change machine attributes (port &c) in a single backend
#
# === Parameters
# * lb_backend_id<~String> - ID of backend
# * lb_machine_id<~String> - ID of machine
# * options<~Hash>:
# * port<~Integer> - port machine listens on
# * maxconn<~Integer> - maximum number of connections server can be sent
# * backup<~Boolean> - only send traffic to machine if all others are down
def update_lb_backend_machine(lb_backend_id, lb_machine_id, options = {})
# inconsistent, no?
request(
:expects => 202,
:method => 'PUT',
:path => "/api/lb_backends/#{lb_backend_id}/lb_machines/#{lb_machine_id}",
:body => options.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v.to_s)}"}.join('&')
)
end
end
class Mock
end
end
end
end

View file

@ -35,9 +35,9 @@ module Fog
when :stormondemand
require 'fog/storm_on_demand/compute'
Fog::Compute::StormOnDemand.new(attributes)
when :virtualbox
require 'fog/virtual_box/compute'
Fog::Compute::VirtualBox.new(attributes)
when :vcloud
require 'fog/vcloud/compute'
Fog::Vcloud::Compute.new(attributes)
else
if self.providers.include?(provider)
require "fog/#{provider}/compute"

View file

@ -62,8 +62,8 @@ module Fog
22
end
def sshable?
ready? && !public_ip_address.nil? && !!Timeout::timeout(8) { ssh 'pwd' }
def sshable?(options={})
ready? && !public_ip_address.nil? && !!Timeout::timeout(8) { ssh('pwd', options) }
rescue SystemCallError, Net::SSH::AuthenticationFailed, Timeout::Error
false
end

View file

@ -71,6 +71,8 @@ An alternate file may be used by placing its path in the FOG_RC environment vari
:rackspace_username:
:rackspace_servicenet:
:rackspace_cdn_ssl:
:riakcs_access_key_id:
:riakcs_secret_access_key:
:stormondemand_username:
:stormondemand_password:
:terremark_username:

View file

@ -87,13 +87,13 @@ module Fog
commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys}
end
# wait for aws to be ready
wait_for { sshable? }
if credentials[:password].nil? && !rootpassword.nil?
credentials[:password] = rootpassword
end
# wait for glesys to be ready
wait_for { sshable?(credentials) }
Fog::SSH.new(public_ip_address, username, credentials).run(commands)
end

View file

@ -55,7 +55,7 @@ module Fog
params[:headers]['Date'] = expires.to_i
params[:path] = CGI.escape(params[:path]).gsub('%2F', '/')
query = [params[:query]].compact
query << "GoogleAccessKeyId=#{@google_storage_access_key_id}"
query << "GoogleAccessId=#{@google_storage_access_key_id}"
query << "Signature=#{CGI.escape(signature(params))}"
query << "Expires=#{params[:headers]['Date']}"
"#{params[:host]}/#{params[:path]}?#{query.join('&')}"

View file

@ -206,6 +206,10 @@ module Fog
@host = uri.host
@path = uri.path
@path.sub!(/\/$/, '')
unless @path.match(/v1(\.1)*/)
raise Fog::OpenStack::Errors::ServiceUnavailable.new(
"OpenStack binding only supports version 1.1 (a.k.a. 1)")
end
@port = uri.port
@scheme = uri.scheme
true

View file

@ -13,10 +13,11 @@ module Fog
def all
data = service.list_images_detail.body['images']
load(data)
images = load(data)
if server
self.replace(self.select {|image| image.server_id == server.id})
end
images
end
def get(image_id)

View file

@ -7,7 +7,7 @@ module Fog
requires :openstack_auth_url
recognizes :openstack_auth_token, :openstack_management_url, :persistent,
:openstack_service_type, :openstack_service_name, :openstack_tenant,
:openstack_api_key, :openstack_username,
:openstack_api_key, :openstack_username, :openstack_endpoint_type,
:current_user, :current_tenant
## MODELS
@ -120,6 +120,7 @@ module Fog
@openstack_must_reauthenticate = false
@openstack_service_type = options[:openstack_service_type] || ['network']
@openstack_service_name = options[:openstack_service_name]
@openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL'
@connection_options = options[:connection_options] || {}
@ -192,7 +193,7 @@ module Fog
:openstack_auth_token => @openstack_auth_token,
:openstack_service_type => @openstack_service_type,
:openstack_service_name => @openstack_service_name,
:openstack_endpoint_type => 'adminURL'
:openstack_endpoint_type => @openstack_endpoint_type
}
credentials = Fog::OpenStack.authenticate_v2(options, @connection_options)

View file

@ -16,7 +16,7 @@ module Fog
end
class Mock
def allocate_address
def allocate_address(pool = nil)
response = Excon::Response.new
response.status = 200
response.headers = {

View file

@ -16,7 +16,7 @@ module Fog
class Mock
def get_snapshot_details(detailed=true)
def get_snapshot_details(snapshot_id)
response = Excon::Response.new
response.status = 200
response.body = {

View file

@ -16,7 +16,7 @@ module Fog
class Mock
def get_volume_details(detailed=true)
def get_volume_details(volume_id)
response = Excon::Response.new
response.status = 200
response.body = {

View file

@ -19,7 +19,7 @@ module Fog
class Mock
def list_servers
def list_servers(options = {})
response = Excon::Response.new
data = list_servers_detail.body['servers']
servers = []

View file

@ -11,7 +11,15 @@ module Fog
}}
body['rebuild']['adminPass'] = admin_pass if admin_pass
body['rebuild']['metadata'] = metadata if metadata
body['rebuild']['personality'] = personality if personality
if personality
body['rebuild']['personality'] = []
for file in personality
body['rebuild']['personality'] << {
'contents' => Base64.encode64(file['contents']),
'path' => file['path']
}
end
end
server_action(server_id, body, 202)
end

View file

@ -20,7 +20,7 @@ module Fog
end # class Real
class Mock
def remove_fixed_ip(server_id, network_id)
def remove_fixed_ip(server_id, address)
true
end # def remove_fixed_ip
end # class Mock

View file

@ -16,7 +16,7 @@ module Fog
class Mock
def update_server(server_id, options)
def update_server(server_id, options = {})
response = Excon::Response.new
if server = list_servers_detail.body['servers'].detect {|_| _['id'] == server_id}
if options['name']

View file

@ -22,12 +22,12 @@ require 'fog/local'
require 'fog/bare_metal_cloud'
require 'fog/ninefold'
require 'fog/rackspace'
require 'fog/riakcs'
require 'fog/openstack'
require 'fog/ovirt'
require 'fog/serverlove'
require 'fog/storm_on_demand'
require 'fog/vcloud'
require 'fog/virtual_box'
require 'fog/vmfusion'
require 'fog/vsphere'
require 'fog/voxel'

View file

@ -94,6 +94,7 @@ module Fog
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

View file

@ -128,6 +128,7 @@ module Fog
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

View file

@ -120,6 +120,7 @@ module Fog
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

View file

@ -8,9 +8,9 @@ module Fog
class InternalServerError < Fog::Rackspace::Errors::InternalServerError; end
class BadRequest < Fog::Rackspace::Errors::BadRequest; end
DFW_ENDPOINT = 'https://dfw.databases.api.rackspacecloud.com/v1.0/'
LON_ENDPOINT = 'https://lon.databases.api.rackspacecloud.com/v1.0/'
ORD_ENDPOINT = 'https://ord.databases.api.rackspacecloud.com/v1.0/'
DFW_ENDPOINT = 'https://dfw.databases.api.rackspacecloud.com/v1.0'
LON_ENDPOINT = 'https://lon.databases.api.rackspacecloud.com/v1.0'
ORD_ENDPOINT = 'https://ord.databases.api.rackspacecloud.com/v1.0'
requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url
@ -82,6 +82,7 @@ module Fog
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

View file

@ -61,6 +61,7 @@ module Fog
parameters = params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
},
:host => @host,

View file

@ -125,6 +125,7 @@ module Fog
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

View file

@ -38,6 +38,7 @@ module Fog
"OS-DCF:diskConfig" => "AUTO",
"created" => "2012-02-28T19:38:57Z",
"id" => image_id,
"name" => "Ubuntu",
"links" => [
{
"href" => "https://dfw.servers.api.rackspacecloud.com/v2/010101/images/#{image_id}",

View file

@ -351,7 +351,7 @@ module Fog
end
# Resize existing server to a different flavor, in essence, scaling the server up or down. The original server is saved for a period of time to allow rollback if there is a problem. All resizes should be tested and explicitly confirmed, at which time the original server is removed. All resizes are automatically confirmed after 24 hours if they are not confirmed or reverted.
# @param [String] flavor to resize
# @param [String] flavor_id to resize
# @return [Boolean] returns true if resize is in process
# @note All resizes are automatically confirmed after 24 hours if you do not explicitly confirm or revert the resize.
# @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/Resize_Server-d1e3707.html

View file

@ -4,16 +4,34 @@ module Fog
module Storage
class Rackspace
class Account < Fog::Model
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/View_Account_Info-d1e11995.html
# @!attribute [rw] meta_temp_url_key
# @return [String] The temporary URL key used to generate temporary access to files
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_TempURL-d1a444.html
attribute :meta_temp_url_key, :aliases => 'X-Account-Meta-Temp-Url-Key'
# @!attribute [r] container_count
# @return [Integer] The number of containers in account
attribute :container_count, :aliases => 'X-Account-Container-Count', :type => :integer
# @!attribute [r] bytes_used
# @return [Integer] The total number of bytes used by the account
attribute :bytes_used, :aliases => 'X-Account-Bytes-Used', :type => :integer
# @!attribute [r] object_count
# @return [Integer] The total number of objects in the account
attribute :object_count, :aliases => 'X-Account-Object-Count', :type => :integer
# Saves account settings (meta_temp_url_key)
# @return [Boolean] returns true if successfully updated
def save
service.post_set_meta_temp_url_key meta_temp_url_key
true
end
# Reload account with latest data from Cloud Files
# @return [Fog::Storage::Rackspace::Account] returns itself
def reload
response = service.head_containers
merge_attributes response.headers

View file

@ -9,15 +9,27 @@ module Fog
model Fog::Storage::Rackspace::Directory
# Returns list of directories
# @return [Array<Fog::Storage::Rackspace::Directory>] Retrieves a list directories.
# @note Fog's current implementation only returns 10,000 directories
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/View_List_of_Containers-d1e1100.html
def all
data = service.get_containers.body
load(data)
end
# Supply the :cdn_cname option to use the Rackspace CDN CNAME functionality on the public_url.
# Retrieves directory
# @param [String] key of directory
# @param options [Hash]:
# @option options [String] cdn_cname CDN CNAME used when calling Directory#public_url
# @return [Fog::Storage::Rackspace::Directory]
# @example
# directory = fog.directories.get('video', :cdn_cname => 'http://cdn.lunenburg.org')
# files = directory.files
# files.first.public_url
#
# > fog.directories.get('video', :cdn_cname => 'http://cdn.lunenburg.org').files.first.public_url
# => 'http://cdn.lunenburg.org/hayley-dancing.mov'
# @see Directory#public_url
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/View-Container_Info-d1e1285.html
def get(key, options = {})
data = service.get_container(key, options)
directory = new(:key => key, :cdn_cname => options[:cdn_cname])

View file

@ -8,14 +8,35 @@ module Fog
class Directory < Fog::Model
# @!attribute [r] key
# @return [String] The name of the directory
identity :key, :aliases => 'name'
# @!attribute [r] bytes
# @return [Integer] The number of bytes used by the directory
attribute :bytes, :aliases => 'X-Container-Bytes-Used', :type => :integer
# @!attribute [r] count
# @return [Integer] The number of objects in the directory
attribute :count, :aliases => 'X-Container-Object-Count', :type => :integer
# @!attribute [rw] cdn_name
# @return [String] The CDN CNAME to be used instead of the default CDN directory URI. The CDN CNAME will need to be setup setup in DNS and
# point to the default CDN directory URI.
# @note This value does not persist and will need to be specified each time a directory is created or retrieved
# @see Directories#get
attribute :cdn_cname
attr_writer :public, :public_url
# @!attribute [w] public
# Required for compatibility with other Fog providers. Not Used.
attr_writer :public
# @!attribute [w] public_url
# Required for compatibility with other Fog providers. Not Used.
attr_writer :public_url
# Set directory metadata
# @param [Hash,Fog::Storage::Rackspace::Metadata] hash contains key value pairs
def metadata=(hash)
if hash.is_a? Fog::Storage::Rackspace::Metadata
attributes[:metadata] = hash
@ -25,6 +46,8 @@ module Fog
attributes[:metadata]
end
# Retrieve directory metadata
# @return [Fog::Storage::Rackspace::Metadata] metadata key value pairs.
def metadata
unless attributes[:metadata]
response = service.head_container(key)
@ -33,6 +56,10 @@ module Fog
attributes[:metadata]
end
# Destroy the directory and remove it from CDN
# @return [Boolean] returns true if directory was deleted
# @note Directory must be empty before it is destroyed.
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Delete_Container-d1e1765.html
def destroy
requires :key
service.delete_container(key)
@ -42,6 +69,8 @@ module Fog
false
end
# Returns collection of files in directory
# @return [Fog::Storage::Rackspace::Files] collection of files in directory
def files
@files ||= begin
Fog::Storage::Rackspace::Files.new(
@ -51,6 +80,8 @@ module Fog
end
end
# Is directory published to CDN
# @return [Boolean] return true if published to CDN
def public?
if @public.nil?
@public ||= (key && public_url) ? true : false
@ -58,6 +89,8 @@ module Fog
@public
end
# Reload directory with latest data from Cloud Files
# @return [Fog::Storage::Rackspace::Directory] returns itself
def reload
@public = nil
@urls = nil
@ -65,23 +98,42 @@ module Fog
super
end
def public_url
# Returns the public url for the directory.
# If the directory has not been published to the CDN, this method will return nil as it is not publically accessible. This method will return the approprate
# url in the following order:
#
# 1. If the service used to access this directory was created with the option :rackspace_cdn_ssl => true, this method will return the SSL-secured URL.
# 2. If the cdn_cname attribute is populated this method will return the cname.
# 3. return the default CDN url.
#
# @return [String] public url for directory
def public_url
return nil if urls.empty?
return urls[:ssl_uri] if service.ssl?
return urls[:ssl_uri] if service.ssl?
cdn_cname || urls[:uri]
end
# URL used to stream video to iOS devices. Cloud Files will auto convert to the approprate format.
# @return [String] iOS URL
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/iOS-Streaming-d1f3725.html
def ios_url
urls[:ios_uri]
end
# URL used to stream resources
# @return [String] streaming url
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Streaming-CDN-Enabled_Containers-d1f3721.html
def streaming_url
urls[:streaming_uri]
end
# Create or update directory and associated metadata
# @return [Boolean] returns true if directory was saved
# @note If public attribute is true, directory will be CDN enabled
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_Container-d1e1694.html
def save
requires :key
create_container
create_or_update_container
raise Fog::Storage::Rackspace::Error.new("Directory can not be set as :public without a CDN provided") if public? && !cdn_enabled?
@urls = service.cdn.publish_container(self, public?)
true
@ -99,7 +151,7 @@ module Fog
@urls ||= service.cdn.urls(self)
end
def create_container
def create_or_update_container
headers = attributes[:metadata].nil? ? {} : metadata.to_headers
service.put_container(key, headers)
end

View file

@ -6,20 +6,53 @@ module Fog
class File < Fog::Model
# @!attribute [r] key
# @return [String] The name of the file
identity :key, :aliases => 'name'
# @!attribute [r] content_length
# @return [Integer] The content length of the file
attribute :content_length, :aliases => ['bytes', 'Content-Length'], :type => :integer
# @!attribute [rw] content_type
# @return [String] The MIME Media Type of the file
# @see http://www.iana.org/assignments/media-types
attribute :content_type, :aliases => ['content_type', 'Content-Type']
# @!attribute [rw] etag
# The MD5 checksum of file. If included file creation request, will ensure integrity of the file.
# @return [String] MD5 checksum of file.
attribute :etag, :aliases => ['hash', 'Etag']
# @!attribute [r] last_modified
# The last time the file was modified
# @return [Time] The last time the file was modified
attribute :last_modified, :aliases => ['last_modified', 'Last-Modified'], :type => :time
# @!attribute [rw] access_control_allow_origin
# A space delimited list of URLs allowed to make Cross Origin Requests. Format is http://www.example.com. An asterisk (*) allows all.
# @return [String] string containing a list of space delimited URLs
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/CORS_Container_Header-d1e1300.html
attribute :access_control_allow_origin, :aliases => ['Access-Control-Allow-Origin']
attribute :origin, :aliases => ['Origin']
attr_writer :public
# @!attribute [rw] origin
# @return [String] The origin is the URI of the object's host.
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/CORS_Container_Header-d1e1300.html
attribute :origin, :aliases => ['Origin']
# @!attribute [r] directory
# @return [Fog::Storage::Rackspace::Directory] directory containing file
attr_accessor :directory
# @!attribute [w] public
# @note Required for compatibility with other Fog providers. Not Used.
attr_writer :public
# Returns the body/contents of file
# @example Retrieve and download contents of Cloud Files object to file system
# file_object = directory.files.get('germany.jpg')
# File.open('germany.jpg', 'w') {|f| f.write(file_object.body) }
# @see Fog::Storage::Rackspace:Files#get
def body
attributes[:body] ||= if last_modified
collection.get(identity).body
@ -28,10 +61,17 @@ module Fog
end
end
# Sets the body/contents of file
# @param [String,File] new_body contents of file
def body=(new_body)
attributes[:body] = new_body
end
# Copy file to another directory or directory
# @param [String] target_directory_key
# @param [String] target_file_key
# @param options [Hash] used to pass in file attributes
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Copy_Object-d1e2241.html
def copy(target_directory_key, target_file_key, options={})
requires :directory, :key
options['Content-Type'] ||= content_type if content_type
@ -42,12 +82,17 @@ module Fog
target_directory.files.get(target_file_key)
end
# Destroy the file
# @return [Boolean] returns true if file is destroyed
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Delete_Object-d1e2264.html
def destroy
requires :directory, :key
service.delete_object(directory.key, key)
true
end
# Set file metadata
# @param [Hash,Fog::Storage::Rackspace::Metadata] hash contains key value pairs
def metadata=(hash)
if hash.is_a? Fog::Storage::Rackspace::Metadata
attributes[:metadata] = hash
@ -57,10 +102,13 @@ module Fog
attributes[:metadata]
end
# File metadata
# @return [Fog::Storage::Rackspace::Metadata] metadata key value pairs.
def metadata
attributes[:metadata] ||= Fog::Storage::Rackspace::Metadata.new(self)
end
# Required for compatibility with other Fog providers. Not Used.
def owner=(new_owner)
if new_owner
attributes[:owner] = {
@ -70,22 +118,42 @@ module Fog
end
end
# Is file published to CDN
# @return [Boolean] return true if published to CDN
def public?
directory.public?
end
# Returns the public url for the file.
# If the file has not been published to the CDN, this method will return nil as it is not publically accessible. This method will return the approprate
# url in the following order:
#
# 1. If the service used to access this file was created with the option :rackspace_cdn_ssl => true, this method will return the SSL-secured URL.
# 2. If the directory's cdn_cname attribute is populated this method will return the cname.
# 3. return the default CDN url.
#
# @return [String] public url for file
def public_url
Files::file_url directory.public_url, key
end
# URL used to stream video to iOS devices without needing to convert your video
# @return [String] iOS URL
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/iOS-Streaming-d1f3725.html
def ios_url
Files::file_url directory.ios_url, key
end
# URL used to stream resources
# @return [String] streaming url
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Streaming-CDN-Enabled_Containers-d1f3721.html
def streaming_url
Files::file_url directory.streaming_url, key
end
# Immediately purge file from the CDN network
# @note You may only PURGE up to 25 objects per day. Any attempt to purge more than this will result in a 498 status code error (Rate Limited).
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Purge_CDN-Enabled_Objects-d1e3858.html
def purge_from_cdn
if public?
service.cdn.purge(self)
@ -94,6 +162,9 @@ module Fog
end
end
# Create or updates file and associated metadata
# @param options [Hash] additional parameters to pass to Cloud Files
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_Update_Object-d1e1965.html
def save(options = {})
requires :body, :directory, :key
options['Content-Type'] = content_type if content_type

View file

@ -7,14 +7,35 @@ module Fog
class Files < Fog::Collection
# @!attribute [rw] directory
# @return [String] The name of the directory
# @note Methods in this class require this attribute to be set
attribute :directory
# @!attribute [rw] limit
# @return [Integer] For an integer value n, limits the number of results to at most n values.
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/List_Large_Number_of_Objects-d1e1521.html
attribute :limit
# @!attribute [rw] marker
# @return [String] Given a string value x, return object names greater in value than the specified marker.
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/List_Large_Number_of_Objects-d1e1521.html
attribute :marker
# @!attribute [rw] path
# @return [String] For a string value x, return the object names nested in the pseudo path.
# Equivalent to setting delimiter to '/' and prefix to the path with a '/' on the end.
attribute :path
# @!attribute [rw] prefix
# @return [String] For a string value x, causes the results to be limited to object names beginning with the substring x.
attribute :prefix
model Fog::Storage::Rackspace::File
# Returns list of files
# @return [Array<Fog::Storage::Rackspace::Files>] Retrieves a list files.
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/List_Objects-d1e1284.html
def all(options = {})
requires :directory
options = {
@ -35,6 +56,10 @@ module Fog
end
end
# Calls block for each file in the directory
# @yieldparam [[Fog::Storage::Rackspace::File]
# @return [Fog::Storage::Rackspace::Directory] returns itself
# @note This method retrieves files in pages. Page size is defined by the limit attribute
alias :each_file_this_page :each
def each
if !block_given?
@ -52,10 +77,28 @@ module Fog
end
end
# Retrieves file
# @param [String] key of file
# @yield get yields to block after chunk of data has been received (Optional)
# @yieldparam [String] data
# @yieldparam [Integer] remaining
# @yieldparam [Integer] content_length
# @return [Fog::Storage::Rackspace:File]
# @note If a block is provided, the body attribute will be empty. By default chunk size is 1 MB. This value can be changed by passing the parameter :chunk_size
# into the :connection_options hash in the service constructor.
# @example Download an image from Cloud Files and save it to file
#
# File.open('download.jpg', 'w') do | f |
# my_directory.files.get("europe.jpg") do |data, remaing, content_length|
# f.syswrite data
# end
# end
#
# @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Retrieve_Object-d1e1856.html
def get(key, &block)
requires :directory
data = service.get_object(directory.key, key, &block)
metadata = Metadata.from_headers(data.headers)
metadata = Metadata.from_headers(self, data.headers)
file_data = data.headers.merge({
:body => data.body,
:key => key,
@ -67,6 +110,10 @@ module Fog
nil
end
# Returns the public_url for the given object key
# @param key of the object
# @return [String] url for object
# @see Directory#public_url
def get_url(key)
requires :directory
if self.directory.public_url
@ -74,6 +121,10 @@ module Fog
end
end
# View directory detail without loading file contents
# @param key of the object
# @param options Required for compatibility with other Fog providers. Not Used.
# @return [Fog::Storage::Rackspace::File]
def head(key, options = {})
requires :directory
data = service.head_object(directory.key, key)
@ -85,11 +136,18 @@ module Fog
nil
end
# Create a new file object
# @param [Hash] attributes of object
# @return [Fog::Storage::Rackspace::File]
def new(attributes = {})
requires :directory
super({ :directory => directory }.merge!(attributes))
end
# Returns an escaped object url
# @param [String] path of the url
# @param [String] key of the object
# @return [String] escaped file url
def self.file_url(path, key)
return nil unless path
"#{path}/#{Fog::Rackspace.escape(key, '/')}"

View file

@ -1,3 +1,8 @@
require 'fog/rackspace/models/storage/directory'
require 'fog/rackspace/models/storage/file'
require 'fog/rackspace/models/storage/directories'
require 'fog/rackspace/models/storage/files'
module Fog
module Storage
class Rackspace
@ -15,20 +20,36 @@ module Fog
CONTAINER_KEY_REGEX = /^#{CONTAINER_META_PREFIX}(.*)/
OBJECT_KEY_REGEX = /^#{OBJECT_META_PREFIX}(.*)/
# @!attribute [rw] data
# @return [Hash] underlying data store for metadata class
attr_reader :data
# @!attribute [rw] parent
# @return [Fog::Storage::Rackspace::Directory,Fog::Storage::Rackspace::File] the parent object of the metadata
attr_reader :parent
attr_reader :data, :parent
# Initialize
# @param [Fog::Storage::Rackspace::Directory,Fog::Storage::Rackspace::File] parent object of the metadata
# @param [Hash] hash containing initial metadata values
def initialize(parent, hash={})
@data = hash || {}
@deleted_hash = {}
@parent = parent
end
# Delete key value pair from metadata
# @param [String] key to be deleted
# @return [Object] returns value for key
# @note Metadata must be deleted using this method in order to properly remove it from Cloud Files
def delete(key)
data.delete(key)
@deleted_hash[key] = nil
end
# Returns metadata in a format expected by Cloud Files
# @return [Hash] Metadata in a format expected by Cloud Files
def to_headers
headers = {}
h = data.merge(@deleted_hash)
@ -40,6 +61,9 @@ module Fog
headers
end
# Creates metadata object from Cloud File Headers
# @param [Fog::Storage::Rackspace::Directory,Fog::Storage::Rackspace::File] parent object of the metadata
# @param [Hash] headers Cloud File headers
def self.from_headers(parent, headers)
metadata = Metadata.new(parent)
headers.each_pair do |k, v|
@ -50,43 +74,59 @@ module Fog
metadata
end
# Returns true if method is implemented by Metadata class
# @param [Symbol] method_sym
# @param [Boolean] include_private
def respond_to?(method_sym, include_private = false)
super(method_sym, include_private) || data.respond_to?(method_sym, include_private)
end
# Invoked by Ruby when obj is sent a message it cannot handle.
def method_missing(method, *args, &block)
data.send(method, *args, &block)
end
private
def directory?
[Fog::Storage::Rackspace::Directory, Fog::Storage::Rackspace::Directories].include? parent_class
end
def file?
[Fog::Storage::Rackspace::File, Fog::Storage::Rackspace::Files].include? parent_class
end
def parent_class
parent.is_a?(Class) ? parent : parent.class
end
def meta_prefix
if parent.is_a? Fog::Storage::Rackspace::Directory
if directory?
CONTAINER_META_PREFIX
elsif parent.is_a? Fog::Storage::Rackspace::File
elsif file?
OBJECT_META_PREFIX
else
raise "Metadata prefix is unknown for #{parent.class}"
raise "Metadata prefix is unknown for #{parent_class}"
end
end
def remove_meta_prefix
if parent.is_a? Fog::Storage::Rackspace::Directory
if directory?
CONTAINER_REMOVE_META_PREFIX
elsif parent.is_a? Fog::Storage::Rackspace::File
elsif file?
OBJECT_REMOVE_META_PREFIX
else
raise "Remove Metadata prefix is unknown for #{parent.class}"
raise "Remove Metadata prefix is unknown for #{parent_class}"
end
end
def meta_prefix_regex
if parent.is_a? Fog::Storage::Rackspace::Directory
if directory?
CONTAINER_KEY_REGEX
elsif parent.is_a? Fog::Storage::Rackspace::File
elsif file?
OBJECT_KEY_REGEX
else
raise "Metadata prefix is unknown for #{parent.class}"
raise "Metadata prefix is unknown for #{parent_class}"
end
end

View file

@ -13,6 +13,7 @@ module Fog
data['volume']['display_description'] = options[:display_description] unless options[:display_description].nil?
data['volume']['volume_type'] = options[:volume_type] unless options[:volume_type].nil?
data['volume']['availability_zone'] = options[:availability_zone] unless options[:availability_zone].nil?
data['volume']['snapshot_id'] = options[:snapshot_id] unless options[:snapshot_id].nil?
request(
:body => Fog::JSON.encode(data),

View file

@ -4,7 +4,7 @@ module Fog
class Real
# Create server
# @param [String] name name of server
# @param [String] image_id id of the image used to create server
# @param [String] image_id of the image used to create server
# @param [String] flavor_id id of the flavor of the image
# @param [String] min_count
# @param [String] max_count

View file

@ -100,15 +100,21 @@ module Fog
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end
# Return Account Details
# @return [Fog::Storage::Rackspace::Account] account details object
def account
account = Fog::Storage::Rackspace::Account.new(:service => self)
account.reload
end
# Using SSL?
# @return [Boolean] return true if service is returning SSL-Secured URLs in public_url methods
# @see Directory#public_url
def ssl?
!rackspace_cdn_ssl.nil?
end
# Resets presistent service connections
def reload
@connection.reset
end
@ -118,6 +124,7 @@ module Fog
response = @connection.request(params.merge({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

122
lib/fog/riakcs.rb Normal file
View file

@ -0,0 +1,122 @@
require(File.expand_path(File.join(File.dirname(__FILE__), 'core')))
module Fog
module RiakCS
module MultipartUtils
require 'net/http'
class Headers
include Net::HTTPHeader
def initialize
initialize_http_header({})
end
# Parse a single header line into its key and value
# @param [String] chunk a single header line
def self.parse(chunk)
line = chunk.strip
# thanks Net::HTTPResponse
return [nil,nil] if chunk =~ /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)\s*(.*)\z/in
m = /\A([^:]+):\s*/.match(line)
[m[1], m.post_match] rescue [nil, nil]
end
# Parses a header line and adds it to the header collection
# @param [String] chunk a single header line
def parse(chunk)
key, value = self.class.parse(chunk)
add_field(key, value) if key && value
end
end
def parse(data, boundary)
contents = data.match(end_boundary_regex(boundary)).pre_match rescue ""
contents.split(inner_boundary_regex(boundary)).reject(&:empty?).map do |part|
parse_multipart_section(part)
end.compact
end
def extract_boundary(header_string)
$1 if header_string =~ /boundary=([A-Za-z0-9\'()+_,-.\/:=?]+)/
end
private
def end_boundary_regex(boundary)
/\r?\n--#{Regexp.escape(boundary)}--\r?\n?/
end
def inner_boundary_regex(boundary)
/\r?\n--#{Regexp.escape(boundary)}\r?\n/
end
def parse_multipart_section(part)
headers = Headers.new
if md = part.match(/\r?\n\r?\n/)
body = md.post_match
md.pre_match.split(/\r?\n/).each do |line|
headers.parse(line)
end
if headers["content-type"] =~ /multipart\/mixed/
boundary = extract_boundary(headers.to_hash["content-type"].first)
parse(body, boundary)
else
{:headers => headers.to_hash, :body => body}
end
end
end
end
module UserUtils
def update_riakcs_user(key_id, user)
response = @s3_connection.put_object('riak-cs', "user/#{key_id}", MultiJson.encode(user), { 'Content-Type' => 'application/json' })
if !response.body.empty?
response.body = MultiJson.decode(response.body)
end
response
end
def update_mock_user(key_id, user)
if data[key_id]
if status = user[:status]
data[key_id][:status] = status
end
if regrant = user[:new_key_secret]
data[key_id][:key_secret] = rand(100).to_s
end
Excon::Response.new.tap do |response|
response.status = 200
response.body = data[key_id]
end
else
Excon::Response.new.tap do |response|
response.status = 403
end
end
end
end
module Utils
def configure_uri_options(options = {})
@host = options[:host] || 'localhost'
@persistent = options[:persistent] || true
@port = options[:port] || 8080
@scheme = options[:scheme] || 'http'
end
def riakcs_uri
"#{@scheme}://#{@host}:#{@port}"
end
end
extend Fog::Provider
service(:provisioning, 'riakcs/provisioning', 'Provisioning')
service(:usage, 'riakcs/usage', 'Usage')
end
end

View file

@ -0,0 +1,100 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'riakcs'))
module Fog
module RiakCS
class Provisioning < Fog::Service
class UserAlreadyExists < Fog::RiakCS::Provisioning::Error; end
class ServiceUnavailable < Fog::RiakCS::Provisioning::Error; end
requires :riakcs_access_key_id, :riakcs_secret_access_key
recognizes :host, :path, :port, :scheme, :persistent
request_path 'fog/riakcs/requests/provisioning'
request :create_user
request :update_user
request :disable_user
request :enable_user
request :list_users
request :get_user
request :regrant_secret
class Mock
include Utils
def self.data
@data ||= Hash.new({})
end
def self.reset
@data = nil
end
def initialize(options = {})
configure_uri_options(options)
end
def data
self.class.data[riakcs_uri]
end
def reset_data
self.class.data.delete(riakcs_uri)
end
end
class Real
include Utils
def initialize(options = {})
require 'mime/types'
require 'multi_json'
configure_uri_options(options)
@riakcs_access_key_id = options[:riakcs_access_key_id]
@riakcs_secret_access_key = options[:riakcs_secret_access_key]
@connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false
@raw_connection = Fog::Connection.new(riakcs_uri, @persistent, @connection_options)
@s3_connection = Fog::Storage.new(
:provider => 'AWS',
:aws_access_key_id => @riakcs_access_key_id,
:aws_secret_access_key => @riakcs_secret_access_key,
:host => @host,
:port => @port,
:scheme => @scheme
)
end
def request(params, parse_response = true, &block)
begin
response = @raw_connection.request(params.merge({
:host => @host,
:path => "#{@path}/#{params[:path]}",
}), &block)
rescue Excon::Errors::HTTPStatusError => error
if match = error.message.match(/<Code>(.*?)<\/Code>(?:.*<Message>(.*?)<\/Message>)?/m)
case match[1]
when 'UserAlreadyExists'
raise Fog::RiakCS::Provisioning.const_get(match[1]).new
when 'ServiceUnavailable'
raise Fog::RiakCS::Provisioning.const_get(match[1]).new
else
raise error
end
else
raise error
end
end
if !response.body.empty? && parse_response
response.body = MultiJson.decode(response.body)
end
response
end
end
end
end
end

View file

@ -0,0 +1,77 @@
module Fog
module RiakCS
class Provisioning
class Real
def create_user(email, name, options = {})
payload = MultiJson.encode({ :email => email, :name => name })
headers = { 'Content-Type' => 'application/json' }
if(options[:anonymous])
request(
:expects => [201],
:method => 'POST',
:path => 'user',
:body => payload,
:headers => headers
)
else
begin
response = @s3_connection.put_object('riak-cs', 'user', payload, headers)
if !response.body.empty?
case response.headers['Content-Type']
when 'application/json'
response.body = MultiJson.decode(response.body)
end
end
response
rescue Excon::Errors::Conflict => e
raise Fog::RiakCS::Provisioning::UserAlreadyExists.new
rescue Excon::Errors::BadRequest => e
raise Fog::RiakCS::Provisioning::ServiceUnavailable.new
end
end
end
end
class Mock
def invalid_email?(email)
!email.include?('@')
end
def user_exists?(email)
data.detect do |key, value|
value[:email] == email
end
end
def create_user(email, name, options = {})
if invalid_email?(email)
raise Fog::RiakCS::Provisioning::ServiceUnavailable, "The email address you provided is not a valid."
end
if user_exists?(email)
raise Fog::RiakCS::Provisioning::UserAlreadyExists, "User with email #{email} already exists."
end
key_id = rand(1000).to_s
key_secret = rand(1000).to_s
data[key_id] = { :email => email, :name => name, :status => 'enabled', :key_secret => key_secret }
Excon::Response.new.tap do |response|
response.status = 200
response.headers['Content-Type'] = 'application/json'
response.body = {
"email" => data[:email],
"display_name" => data[:name],
"name" => "user123",
"key_id" => key_id,
"key_secret" => key_secret,
"id" => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"status" => "enabled"
}
end
end
end
end
end
end

View file

@ -0,0 +1,23 @@
module Fog
module RiakCS
class Provisioning
class Real
include Utils
include UserUtils
include MultipartUtils
def disable_user(key_id)
update_riakcs_user(key_id, { :status => 'disabled' })
end
end
class Mock
include UserUtils
def disable_user(key_id)
update_mock_user(key_id, { :status => 'disabled' })
end
end
end
end
end

View file

@ -0,0 +1,23 @@
module Fog
module RiakCS
class Provisioning
class Real
include Utils
include UserUtils
include MultipartUtils
def enable_user(key_id)
update_riakcs_user(key_id, { :status => 'enabled' })
end
end
class Mock
include UserUtils
def enable_user(key_id)
update_mock_user(key_id, { :status => 'enabled' })
end
end
end
end
end

View file

@ -0,0 +1,41 @@
module Fog
module RiakCS
class Provisioning
class Real
include Utils
include MultipartUtils
def get_user(key_id)
response = @s3_connection.get_object('riak-cs', "user/#{key_id}", { 'Accept' => 'application/json' })
response.body = MultiJson.decode(response.body)
response
end
end
class Mock
def get_user(key_id)
if user = data[key_id]
Excon::Response.new.tap do |response|
response.status = 200
response.headers['Content-Type'] = 'application/json'
response.body = {
"email" => user[:email],
"display_name" => user[:name],
"name" => "user123",
"key_id" => "XXXXXXXXXXXXXXXXXXXX",
"key_secret" => user[:key_secret],
"id" => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"status" => user[:status]
}
end
else
Excon::Response.new.tap do |response|
response.status = 404
response.headers['Content-Type'] = 'application/json'
end
end
end
end
end
end
end

View file

@ -0,0 +1,43 @@
module Fog
module RiakCS
class Provisioning
class Real
include Utils
include MultipartUtils
def list_users(options = {})
response = @s3_connection.get_object('riak-cs', 'users', { 'Accept' => 'application/json', 'query' => options })
boundary = extract_boundary(response.headers['Content-Type'])
parts = parse(response.body, boundary)
decoded = parts.map { |part| MultiJson.decode(part[:body]) }
response.body = decoded.flatten
response
end
end
class Mock
def list_users(options = {})
filtered_data = options[:status] ? data.select { |key, value| value[:status] == options[:status] } : data
Excon::Response.new.tap do |response|
response.status = 200
response.body = filtered_data.map do |key, value|
{
"email" => value[:email],
"display_name" => value[:name],
"name" => "user123",
"key_id" => key,
"key_secret" => value[:key_secret],
"id" => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"status" => value[:status]
}
end.compact
end
end
end
end
end
end

View file

@ -0,0 +1,23 @@
module Fog
module RiakCS
class Provisioning
class Real
include Utils
include UserUtils
include MultipartUtils
def regrant_secret(key_id)
update_riakcs_user(key_id, { :new_key_secret => true })
end
end
class Mock
include UserUtils
def regrant_secret(key_id)
update_mock_user(key_id, { :new_key_secret => true })
end
end
end
end
end

View file

@ -0,0 +1,23 @@
module Fog
module RiakCS
class Provisioning
class Real
include Utils
include UserUtils
include MultipartUtils
def update_user(key_id, user)
update_riakcs_user(key_id, user)
end
end
class Mock
include UserUtils
def update_user(key_id, user)
update_mock_user(key_id, user)
end
end
end
end
end

View file

@ -0,0 +1,68 @@
module Fog
module RiakCS
class Usage
module Utils
TYPES_TO_STRING = { :access => 'a', :storage => 'b' }
DEFAULT_TYPES = TYPES_TO_STRING.keys
DEFAULT_FORMAT = :json
def sanitize_and_convert_time(time)
time.utc.iso8601.gsub(/[:-]/, '')
end
def format_and_types_to_path(format, types)
format_character = format.to_s.split('').first
type_characters = types.map { |t| TYPES_TO_STRING[t] }.compact
[type_characters, format_character].flatten.compact.join
end
def request_uri(access_key_id, options)
format = DEFAULT_FORMAT
types = options[:types] || DEFAULT_TYPES
start_time = options[:start_time] || Time.now.utc - 86400
end_time = options[:end_time] || Time.now.utc
[access_key_id,
format_and_types_to_path(format, types),
sanitize_and_convert_time(start_time),
sanitize_and_convert_time(end_time)].join('.')
end
end
class Real
include Utils
def get_usage(access_key_id, options = {})
response = @connection.get_object('riak-cs', ["usage", request_uri(access_key_id, options)].join("/"))
if !response.body.empty?
response.body = MultiJson.decode(response.body)
end
response
end
end
class Mock
include Utils
def get_usage(access_key, options = {})
Excon::Response.new.tap do |response|
response.status = 200
response.headers['Content-Type'] = 'application/json'
response.body = {
'Access' => {
'Nodes' => [],
'Errors' => []
},
'Storage' => {
'Samples' => [],
'Errors' => []
}
}
end
end
end
end
end
end

66
lib/fog/riakcs/usage.rb Normal file
View file

@ -0,0 +1,66 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'riakcs'))
require 'time'
module Fog
module RiakCS
class Usage < Fog::Service
requires :riakcs_access_key_id, :riakcs_secret_access_key
recognizes :host, :path, :port, :scheme, :persistent
request_path 'fog/riakcs/requests/usage'
request :get_usage
class Mock
include Utils
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {}
end
end
def self.reset
@data = nil
end
def initialize(options = {})
configure_uri_options(options)
end
def data
self.class.data[riakcs_uri]
end
def reset_data
self.class.data.delete(riakcs_uri)
end
end
class Real
include Utils
def initialize(options = {})
require 'mime/types'
require 'multi_json'
configure_uri_options(options)
@riakcs_access_key_id = options[:riakcs_access_key_id]
@riakcs_secret_access_key = options[:riakcs_secret_access_key]
@connection_options = options[:connection_options] || {}
@persistent = options[:persistent] || false
@connection = Fog::Storage.new(
:provider => 'AWS',
:aws_access_key_id => @riakcs_access_key_id,
:aws_secret_access_key => @riakcs_secret_access_key,
:host => @host,
:port => @port,
:scheme => @scheme
)
end
end
end
end
end

View file

@ -301,7 +301,7 @@ module Fog
# Use this to set the Authorization header for login
def authorization_header
"Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}"
"Basic #{Base64.encode64("#{@username}:#{@password}").delete("\r\n")}"
end
# Actually do the request

View file

@ -23,6 +23,14 @@ module Fog
end
end
def password_enabled?
load_unless_loaded!
customization_options = service.get_vapp_template(self.entity[:href]).body[:Children][:Vm][:GuestCustomizationSection]
return false if customization_options[:AdminPasswordEnabled] == "false"
return true if customization_options[:AdminPasswordEnabled] == "true" \
and customization_options[:AdminPasswordAuto] == "false" \
and ( options[:password].nil? or options[:password].empty? )
end
end
end
end

View file

@ -23,7 +23,7 @@ EOF
request(
:body => body,
:expects => 202,
:headers => {'Content-Type' => network_info[:"vcloud_type"] },
:headers => {'Content-Type' => network_info[:"type"] },
:method => 'PUT',
:uri => "#{edit_uri}",
:parse => true

Some files were not shown because too many files have changed in this diff Show more