From 9553c3805e7d8871acf5330af5f3691b37706723 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 22 Jul 2011 11:46:55 -0500 Subject: [PATCH 01/11] [tests] replace letters with letters and numbers with numbers in collection#get failure test --- tests/helpers/collection_helper.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/helpers/collection_helper.rb b/tests/helpers/collection_helper.rb index 9e3dfe47a..7f4447121 100644 --- a/tests/helpers/collection_helper.rb +++ b/tests/helpers/collection_helper.rb @@ -38,12 +38,10 @@ def collection_tests(collection, params = {}, mocks_implemented = true) tests('failure') do if !Fog.mocking? || mocks_implemented - @identity = case @identity - when Integer - @identity.to_s.gsub(/\w/, Fog::Mock.random_numbers(1)).to_i - else - @identity.to_s.gsub(/\w/, Fog::Mock.random_letters(1)) - end + @identity = @identity.to_s + @identity.gsub!(/[a-zA-Z]/) { Fog::Mock.random_letters(1) } + @identity.gsub!(/\d/) { Fog::Mock.random_numbers(1) } + @identity end tests("#get('#{@identity}')").returns(nil) do From 6613711166a4cbd29439741fd6e45ea99443d5fd Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 22 Jul 2011 11:53:06 -0500 Subject: [PATCH 02/11] [compute|ninefold] add default serviceofferingid (flavor) --- lib/fog/compute/models/ninefold/server.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/fog/compute/models/ninefold/server.rb b/lib/fog/compute/models/ninefold/server.rb index f81a1cbec..dda8f2320 100644 --- a/lib/fog/compute/models/ninefold/server.rb +++ b/lib/fog/compute/models/ninefold/server.rb @@ -65,6 +65,9 @@ module Fog def initialize(attributes={}) + merge_attributes({ + :serviceofferingid => 105 # '1CPU, 384MB, 80GB HDD' + }) super end From dc865072bb733ca7b450d370caabcb65c6c66420 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 22 Jul 2011 12:02:34 -0500 Subject: [PATCH 03/11] [compute] fix stormondemand namespace mismatch --- lib/fog/compute.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/compute.rb b/lib/fog/compute.rb index 15a92ee08..e5ca41d4f 100644 --- a/lib/fog/compute.rb +++ b/lib/fog/compute.rb @@ -40,7 +40,7 @@ module Fog Fog::Compute::Slicehost.new(attributes) when :stormondemand require 'fog/compute/storm_on_demand' - Fog::StormOnDemand::Compute.new(attributes) + Fog::Compute::StormOnDemand.new(attributes) when :vcloud require 'fog/compute/vcloud' Fog::Vcloud::Compute.new(attributes) From 351570fb35afdb25b64a4accc209a9ab0c29fa59 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 22 Jul 2011 12:03:36 -0500 Subject: [PATCH 04/11] [compute|ninefold] fix zone format --- tests/compute/requests/ninefold/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compute/requests/ninefold/helper.rb b/tests/compute/requests/ninefold/helper.rb index d0da34130..aa99dc6b7 100644 --- a/tests/compute/requests/ninefold/helper.rb +++ b/tests/compute/requests/ninefold/helper.rb @@ -128,6 +128,7 @@ class Ninefold "name"=>String }] ZONES = [{ + "allocationstate"=>String, "id"=>Integer, "name"=>String, "networktype"=>String, @@ -177,7 +178,6 @@ class Ninefold "guestosid"=>Integer, "rootdeviceid"=>Integer, "rootdevicetype"=>String, - "securitygroup"=>Array, "nic"=>[{ "id"=>Integer, "networkid"=>Integer, From c0ca2cd5dc3934b3eb1b11b4af80bc2fdf094c2a Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 22 Jul 2011 12:04:18 -0500 Subject: [PATCH 05/11] [compute|voxel] fix server format --- tests/compute/requests/voxel/server_tests.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/compute/requests/voxel/server_tests.rb b/tests/compute/requests/voxel/server_tests.rb index 21c125b68..384c2017a 100644 --- a/tests/compute/requests/voxel/server_tests.rb +++ b/tests/compute/requests/voxel/server_tests.rb @@ -12,10 +12,10 @@ Shindo.tests('Fog::Compute[:voxel] | server requests', ['voxel']) do 'devices' => [{ 'access_methods' => [], 'description' => String, - 'drives' => { + 'drives' => [{ 'position' => Fog::Nullable::Integer, 'size' => Integer - }, + }], 'id' => String, 'ipassignments' => [{ 'description' => String, From 3e8a2f3177f2ac767a9316a10baa0c76b73b02d2 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 22 Jul 2011 15:38:48 -0500 Subject: [PATCH 06/11] [compute|ninefold] small consistency fixes for server --- lib/fog/compute/models/ninefold/server.rb | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/fog/compute/models/ninefold/server.rb b/lib/fog/compute/models/ninefold/server.rb index dda8f2320..96be382c7 100644 --- a/lib/fog/compute/models/ninefold/server.rb +++ b/lib/fog/compute/models/ninefold/server.rb @@ -5,6 +5,9 @@ module Fog class Ninefold class Server < Fog::Model + extend Fog::Deprecation + deprecate :serviceofferingid, :flavor_id + deprecate :templateid, :image_id identity :id @@ -13,10 +16,11 @@ module Fog attribute :cpuspeed attribute :cpuused - attribute :created, :type => :time + attribute :created, :type => :time attribute :displayname attribute :domain attribute :domainid + attribute :flavor_id, :aliases => :serviceofferingid attribute :forvirtualnetwork attribute :group attribute :groupid @@ -25,6 +29,7 @@ module Fog attribute :hostid attribute :hostname attribute :hypervisor + attribute :image_id, :aliases => :templateid #attribute :ipaddress attribute :isodisplaytext attribute :isoid @@ -35,20 +40,18 @@ module Fog attribute :name attribute :networkkbsread attribute :networkkbswrite + attribute :nic attribute :password attribute :passwordenabled attribute :rootdeviceid attribute :rootdevicetype - attribute :serviceofferingid + attribute :securitygroup attribute :serviceofferingname attribute :state attribute :templatedisplaytext - attribute :templateid attribute :templatename attribute :zoneid attribute :zonename - attribute :nic - attribute :securitygroup # used for creation only. attribute :networkids @@ -66,7 +69,7 @@ module Fog def initialize(attributes={}) merge_attributes({ - :serviceofferingid => 105 # '1CPU, 384MB, 80GB HDD' + :flavor_id => 105 # '1CPU, 384MB, 80GB HDD' }) super end @@ -102,13 +105,13 @@ module Fog end def flavor - requires :serviceofferingid - connection.flavors.get(serviceofferingid) + requires :flavor_id + connection.flavors.get(flavor_id) end def image - requires :templateid - connection.images.get(templateid) + requires :image_id + connection.images.get(image_id) end def ready? @@ -130,9 +133,7 @@ module Fog def save raise "Operation not supported" if self.identity - requires :serviceofferingid - requires :templateid - requires :zoneid + requires :flavor_id, :image_id, :zoneid unless networkids # No network specified, use first in this zone. @@ -146,8 +147,8 @@ module Fog end options = { - :serviceofferingid => serviceofferingid, - :templateid => templateid, + :serviceofferingid => flavor_id, + :templateid => image_id, :name => name, :zoneid => zoneid, :networkids => networkids, From 9ca8cffc000c417a792235438c12855a277fe1ce Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 25 Jul 2011 14:11:24 -0500 Subject: [PATCH 07/11] [release] make changelog build separate from release --- Rakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Rakefile b/Rakefile index f285b4ce8..4308b5043 100644 --- a/Rakefile +++ b/Rakefile @@ -128,7 +128,6 @@ end ############################################################################# task :release => :build do - Rake::Task[:changelog].invoke unless `git branch` =~ /^\* master$/ puts "You must be on the master branch to release!" exit! From 6bd7ad9d6e0eca70bfa8eb1b8666316a4519be0a Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 25 Jul 2011 14:34:57 -0500 Subject: [PATCH 08/11] Release 0.10.0 --- changelog.txt | 277 ++++++++++++++++++++++++++++++++++++++++++++++++++ fog.gemspec | 4 +- lib/fog.rb | 2 +- 3 files changed, 280 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 7da1e2493..f64987438 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,280 @@ +0.10.0 07/25/2011 9ca8cffc000c417a792235438c12855a277fe1ce +========================================================== + +MVPs! Christopher Oliver, Dylan Egan and Henry Addison + +[AWS Autoscaling] + Fixed typo in put scaling policy request. thanks Christopher Oliver + Fixed error in describe policies parser. thanks Christopher Oliver + Got describe policies returning correctly. thanks Christopher Oliver + Removed unnecessary options merge in Delete Policy request. thanks Christopher Oliver + +[AWS IAM] + Added Alias related functionality to IAM. Also added get_group_policy. thanks Christopher Oliver + Added missing request file for list account aliases. thanks Christopher Oliver + +[AWS RDS] + Added describe db engine versions and describe db reserved instances. Changed the signed params version to 2011-04-01 from 2010-07-28. thanks Christopher Oliver + Added LicenseModel to the db_parser. thanks Christopher Oliver + +[AWS|ELB] + fix bug that was causing availability zones to not parse properly on get/reload. thanks Blake Gentry + default values for Listeners. thanks Blake Gentry + offload Listener defaults to the Listener model. thanks Blake Gentry + +[AWS|SNS] + flesh out basics. thanks geemus + +[AWS|SQS] + flesh out basics. thanks geemus + +[aws|auto_scaling] + implement 2010-08-01 API. thanks Nick Osborn + +[aws|autoscaling] + metrics#get should return nil when not found. thanks geemus + mark unimplemented/unsupported tests as pending. thanks geemus + +[aws|cloudwatch] + mark overly specific test as pending. thanks geemus + +[aws|compute] + improve model and tests. thanks Nick Osborn + +[aws|elb] + add test to verify that ListenerDescriptions work when creating an ELB. thanks Blake Gentry + make describe_load_balancers parse SSLCertificateId. Verify with test. thanks Blake Gentry + Raise proper IAM error for CertificateNotFound when creating an ELB or creating Listeners. thanks Blake Gentry + move ELB error handling related to certs to the ELB service instead of duplicating at the request level. thanks Blake Gentry + use slurp when raising errors to properly capture exception details. thanks Blake Gentry + Add set_load_balancer_listener_ssl_certificate. thanks James Miller + fix listener defaults to use merge_attributes and therefore aliases. thanks geemus + +[aws|iam] + add error handling for common failures resulting from upload_server_certificate. thanks Blake Gentry + fix superclass mismatch. thanks Blake Gentry + add get_server_certificate request. thanks Blake Gentry + raise correct ValidationError when an empty cert or key is used. thanks Blake Gentry + Simplify error handling code for errors with custom classes. thanks Blake Gentry + raise EntityAlreadyExists when creating a duplicate cert name. thanks Blake Gentry + tests and mocks to support many types of key/cert issues. thanks Blake Gentry + add proper error messages. thanks Blake Gentry + fix expected error result from login_profile_tests. thanks geemus + +[aws|rds] + add LicenseModel to format. thanks geemus + +[aws|simpledb] + provide for using ConsistentRead on get_attributes and select. thanks geemus + fix get_attributes mock deprecation. thanks geemus + +[compute] + fix stormondemand namespace mismatch. thanks geemus + +[compute|aws] + cluster compute placement group implementation. thanks geemus + add request level support for spot instances. thanks geemus + fix describe_instances parser to get group ids correctly. thanks geemus + fix compute accessor in tests. thanks geemus + +[compute|bluebox] + fixes for ip accessor usage. thanks geemus + +[compute|brightbox] + Fixed typo in deprecation warning. thanks Paul Thornthwaite + Fixed deprecated use of Brightbox[:compute] to new Compute[:brightbox]. thanks Paul Thornthwaite + New preference exposed in API added to format test. thanks Paul Thornthwaite + +[compute|ninefold] + add default serviceofferingid (flavor). thanks geemus + fix zone format. thanks geemus + small consistency fixes for server. thanks geemus + +[compute|rackspace] + fix for token expiry/reauth. thanks geemus + +[compute|virtualbox] + backwards compatibility for gem availability check. thanks geemus + +[compute|voxel] + fix server format. thanks geemus + +[core] + avoid ArgumentError with Ruby 1.8.5 on CentOS. thanks Nick Osborn + fix to_date_header to use self.utc instead of self.class.now.utc. thanks geemus + avoid ||= in timeout lookup. thanks geemus + +[docs] + update index to use non-deprecated service accessor. thanks geemus + +[misc] + Fix ::AWS[] syntax that's only valid in Fog tests when bin/aws.rb is loaded. thanks Blake Gentry + Typos. thanks Blake Gentry + Require json needed for both Real and Mock implementation of Rackspace; SSH commands in Mock just print to command line. thanks Brian Hartsock + Revert "Require json needed for both Real and Mock implementation of Rackspace; SSH commands in Mock just print to command line". thanks Brian Hartsock + require json for rackspace compute mock. thanks Brian Hartsock + Fixed #444 - Unable to squash kvp with false values. thanks Brian Hartsock + Fix make OpenStack swift working properly. thanks Chmouel Boudjnah + Move the timeout to Mock and stop hardcoding. thanks Christopher Meiklejohn + Fix failures in the simpledb testing due to attribute array option deprecation. thanks Christopher Meiklejohn + Guard against item_name not being a valid key. thanks Christopher Meiklejohn + Switch to the has_key? syntax for cleanliness. thanks Christopher Meiklejohn + Move timeout up to Fog from Fog::Mock. thanks Christopher Meiklejohn + Fix deprecation messages. thanks Claudio Poli + Make Rails' respond_with play nice with to_json. thanks Claudio Poli + Use multi_json gem. thanks Claudio Poli + Public API for force_detach on Fog::Compute::AWS::Volume. thanks Dylan Egan + Should actually use the attachment_aliases hash. thanks Dylan Egan + server method for Fog::Compute::AWS::Volume to easily get the server instance. thanks Dylan Egan + requires_one, allows you to require at least one of the specified attributes. thanks Dylan Egan + Remove pending on iam/server_certificate_tests. Start the mocking. thanks Dylan Egan + list_server_certificates and delete_server_certificates. thanks Dylan Egan + Yes, yes it is better. thanks Dylan Egan + Start ELB mocks. Support create_load_balancer and describe_load_balancers. thanks Dylan Egan + configure_health_check and create_app_cookie_stickiness_policy. thanks Dylan Egan + create_lb_cookie_stickiness_policy and delete_load_balancer_policy. thanks Dylan Egan + create_load_balancer_listeneners and set_load_balancer_policies_of_listener. thanks Dylan Egan + delete_load_balancer_listeners and delete_load_balancer (with two more tests). thanks Dylan Egan + deregister_instances_from_load_balancer, describe_instance_health, disable_availability_for_load_balancer, enable_availability_zones_for_load_balancer, register_instances_with_load_balancer and updates to others to get ELB model_tests working. thanks Dylan Egan + Remove requirement of basic parsers. thanks Dylan Egan + Move things around a bit. Separate ELB test file per concerns. thanks Dylan Egan + SSL for ELB mocking. thanks Dylan Egan + Tested against AWS. Needed this. Apparently SSLCertificateId == Arn. thanks Dylan Egan + Use available availability_zones. thanks Dylan Egan + Wait for volume to be ready again. thanks Dylan Egan + AWS instance tests 100% against real. thanks Dylan Egan + Make stuff pending if you're mocking. Need to fix spot_price_history_tests, see comment. thanks Dylan Egan + Let's just sleep forever. thanks Dylan Egan + Reinstate ipAddress and privateIpAddress as they're provided for non-terminated instances. thanks Dylan Egan + Reinstate ramdiskId. thanks Dylan Egan + Revert "Reinstate ramdiskId." - fuckit! Seems like AWS doesn't return ramdiskId for. thanks Dylan Egan + Clean up timeout and add tests. thanks Dylan Egan + Quick fix, ith != i. thanks Dylan Egan + Begin work on mocking reserved instances. Provide describe_reserved_instances_offerings for mocking and real. REAL TALK. thanks Dylan Egan + reserved_instances mocking. I think, it's hard to test against a real AWS account since it costs money. thanks Dylan Egan + Default to 1. thanks Dylan Egan + add spot instance request models. thanks Edward Middleton + fixed spot_requests. thanks Edward Middleton + spot instance fixes. thanks Edward Middleton + cloud_watch toplevel. thanks Frederick Cheung + add get/put/list metrics. thanks Frederick Cheung + Corrected a couple of syntax errors in the put and get metric cloudwatch requests. thanks Henry Addison + Fixed the parser for list metrics cloudwatch request. thanks Henry Addison + Added first test of successful list metrics. thanks Henry Addison + simplified a bit the long case statement in end element in list_metrics parser. thanks Henry Addison + added a few more cloudwatch request metric tests. thanks Henry Addison + added metrics collection and model for cloudwatch with all and get methods. thanks Henry Addison + split out and got passing get metric statistics request tests. thanks Henry Addison + Added metric statistics model and collection. thanks Henry Addison + removed old test file. thanks Henry Addison + removed empty test for for metric model (nothing to test at the moment). thanks Henry Addison + removed unnecessary attributes from metrics collection (naughty copy and pasting). thanks Henry Addison + got put_metric_data request working and tested. thanks Henry Addison + added model and collection methods and tests to allow putting of metric data. thanks Henry Addison + renamed argument for all method in cloud watch metric_statistics from filters to conditions as filters has a meaning in fog. thanks Henry Addison + added a conditions method to all metrics method to help filter all metrics. thanks Henry Addison + Added some defaults for StartTime, EndTime and Period to model for MetricStatistics. thanks Henry Addison + Begin SQS support. thanks Jon Crosby + Continued SQS support. thanks Jon Crosby + Add SQS get_queue_attributes. thanks Jon Crosby + Fix rubygems warning. thanks Jonas Pfenniger + Patch for AWS S3 Metadata problem. thanks Kenji Kabashima + Changed number of cores reported for rackspace flavors in order to match current rackspace documentation. thanks Steven Danna + Checking path for nil. thanks Timothy Klim + Fixed escaping in Fog::AWS.escape. thanks croaker + Changed the encoding of the space character. thanks croaker + rebuild gemfile during release to include updated changelog. thanks geemus + bump excon dep. thanks geemus + loosen dependencies to avoid conflicts. thanks geemus + bump formatador dep. thanks geemus + to_json calls to use MultiJson. thanks geemus + make collection class_eval more consistent. thanks geemus + update gem deps to latest/greatest. thanks geemus + Return nil if HOME is non-absolute. Fixes #397. thanks jc00ke + Fix a bunch of paths. thanks phiggins + Start of SNS. thanks phiggins + Working ListUsers for SNS. thanks phiggins + Remove copied-and-pasted documentation. thanks phiggins + Add SNS's get_topic_attributes command. thanks phiggins + SNS ListSubscriptions. thanks phiggins + SNS ListSubscriptionsByTopic. thanks phiggins + SNS CreateTopic and DeleteTopic. thanks phiggins + SNS Publish. thanks phiggins + SNS AddPermission. thanks phiggins + SNS RemovePermission. thanks phiggins + SNS SetTopicAttributes. thanks phiggins + SNS Subscribe. thanks phiggins + SNS ConfirmSubscription and Unsubscribe. thanks phiggins + Add sns to fog bin. thanks phiggins + Start SNS tests. thanks phiggins + +[ninefold|storage] + Framework + request method for Ninefold storage. thanks Lincoln Stoll + Directories Functionality. thanks Lincoln Stoll + Nested directories. thanks Lincoln Stoll + File operations. thanks Lincoln Stoll + Update an existing file. thanks Lincoln Stoll + set content type correctly. thanks Lincoln Stoll + +[release] + add mvps and fix fog.io uploader. thanks geemus + remove problematic pbcopy from changelog rake task. thanks geemus + make changelog build separate from release. thanks geemus + +[storage] + provide http/https options for signed urls. thanks geemus + +[storage|aws] + properly format modified headers in get_object. thanks geemus + fix escaping for file#public_url. thanks geemus + +[storage|google] + fix get_object_https_url namespace copy/paste error. thanks geemus + +[storage|ninefold] + fix file#destroy and test cleanup. thanks geemus + +[storage|rackspace] + add large object support via put_object_manifest. thanks geemus + cleanup formatting/style. thanks geemus + +[tests] + make unimplemented mock tests pending. thanks geemus + fix collection helper to play nice with numeric ids. thanks geemus + replace letters with letters and numbers with numbers in collection#get failure test. thanks geemus + +[vcloud|compute] + create server now takes :catalog_items_uri as an option. thanks Kunal Parikh + now referencing catalog_item_uri from options. thanks Kunal Parikh + saving server attributes (uncommented code). thanks Kunal Parikh + Revert "saving server attributes (uncommented code)". thanks Kunal Parikh + duplicate ecloud code for vcloud, remove obvious terremark specific code. thanks Lincoln Stoll + update catalog models for 1.0. thanks Lincoln Stoll + make auth work. thanks Lincoln Stoll + filter non-server items from server list. thanks Lincoln Stoll + update for 1.0 functionality, server operations working. thanks Lincoln Stoll + use correct power status ID for 'off'. thanks Lincoln Stoll + allow specifying a default VDC uri as 'vcloud_default_vdc'. thanks Lincoln Stoll + Add description field to server model. thanks Lincoln Stoll + Correct friendly status power off check. thanks Lincoln Stoll + correct hardware attribute reading. thanks Lincoln Stoll + no longer possible to specify memory & cpu on vapp creation. thanks Lincoln Stoll + remove outdated/invalid mocking & specs. thanks Lincoln Stoll + fix deleting servers. thanks Lincoln Stoll + server creation outside of VDC. thanks Lincoln Stoll + undeploy request. thanks Lincoln Stoll + memory reconfiguration. thanks Lincoln Stoll + make status/ready handling more reliable. thanks Lincoln Stoll + server tests. thanks Lincoln Stoll + only require template name for tests. thanks Lincoln Stoll + add and remove disks. thanks Lincoln Stoll + ruby 1.8 compatibility. thanks Lincoln Stoll + fix error messages in test helper. thanks Lincoln Stoll + Fix setting of description. thanks Lincoln Stoll + method to find catalog item by name across all catalogs. thanks Lincoln Stoll + correct provider lookup. thanks Lincoln Stoll + + 0.9.0 06/24/2011 32960d165a65f12d41785f924e6b6b6d8442516a ========================================================= diff --git a/fog.gemspec b/fog.gemspec index d8ad03d50..d889f50a1 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -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 = '0.9.0' - s.date = '2011-06-24' + s.version = '0.10.0' + s.date = '2011-07-25' s.rubyforge_project = 'fog' ## Make sure your summary is short. The description may be as long diff --git a/lib/fog.rb b/lib/fog.rb index e27b9a721..f55ff4a80 100644 --- a/lib/fog.rb +++ b/lib/fog.rb @@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), 'fog', 'core') module Fog unless const_defined?(:VERSION) - VERSION = '0.9.0' + VERSION = '0.10.0' end end From afde136b89c3b13613667064ddee85a8a93bfbd4 Mon Sep 17 00:00:00 2001 From: Christopher Oliver Date: Mon, 25 Jul 2011 15:42:12 -0400 Subject: [PATCH 09/11] [aws|cdn] Added commands for streaming distribution lists. --- lib/fog/cdn/aws.rb | 6 ++ .../cdn/parsers/aws/get_invalidation_list.rb | 43 ++++++++++ .../aws/get_streaming_distribution_list.rb | 59 +++++++++++++ .../cdn/parsers/aws/streaming_distribution.rb | 59 +++++++++++++ .../aws/delete_streaming_distribution.rb | 28 +++++++ .../cdn/requests/aws/get_invalidation_list.rb | 42 ++++++++++ .../aws/get_streaming_distribution.rb | 50 +++++++++++ .../aws/get_streaming_distribution_list.rb | 59 +++++++++++++ .../aws/post_streaming_distribution.rb | 78 +++++++++++++++++ .../aws/put_streaming_distribution_config.rb | 83 +++++++++++++++++++ 10 files changed, 507 insertions(+) create mode 100644 lib/fog/cdn/parsers/aws/get_invalidation_list.rb create mode 100644 lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb create mode 100644 lib/fog/cdn/parsers/aws/streaming_distribution.rb create mode 100644 lib/fog/cdn/requests/aws/delete_streaming_distribution.rb create mode 100644 lib/fog/cdn/requests/aws/get_invalidation_list.rb create mode 100644 lib/fog/cdn/requests/aws/get_streaming_distribution.rb create mode 100644 lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb create mode 100644 lib/fog/cdn/requests/aws/post_streaming_distribution.rb create mode 100644 lib/fog/cdn/requests/aws/put_streaming_distribution_config.rb diff --git a/lib/fog/cdn/aws.rb b/lib/fog/cdn/aws.rb index 340c04f4d..e9d9ed3e1 100644 --- a/lib/fog/cdn/aws.rb +++ b/lib/fog/cdn/aws.rb @@ -9,11 +9,17 @@ module Fog request_path 'fog/cdn/requests/aws' request 'delete_distribution' + request 'delete_streaming_distribution' request 'get_distribution' request 'get_distribution_list' + request 'get_invalidation_list' + request 'get_streaming_distribution' + request 'get_streaming_distribution_list' request 'post_distribution' + request 'post_streaming_distribution' request 'post_invalidation' request 'put_distribution_config' + request 'put_streaming_distribution_config' class Mock diff --git a/lib/fog/cdn/parsers/aws/get_invalidation_list.rb b/lib/fog/cdn/parsers/aws/get_invalidation_list.rb new file mode 100644 index 000000000..0dba8c26c --- /dev/null +++ b/lib/fog/cdn/parsers/aws/get_invalidation_list.rb @@ -0,0 +1,43 @@ +module Fog + module Parsers + module CDN + module AWS + + class GetInvalidationList < Fog::Parsers::Base + + def reset + @invalidation_summary = { } + @response = { 'InvalidationSummary' => [] } + end + + def start_element(name, attrs = []) + super + end + + def end_element(name) + puts name + case name + when 'InvalidationSummary' + @response['InvalidationSummary'] << @invalidation_summary + @invalidation_summary = {} + when 'Id', 'Status' + @invalidation_summary[name] = @value + when 'IsTruncated' + if @value == 'true' + @response[name] = true + else + @response[name] = false + end + when 'Marker', 'NextMarker' + @response[name] = @value + when 'MaxItems' + @response[name] = @value.to_i + end + end + + end + + end + end + end +end diff --git a/lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb b/lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb new file mode 100644 index 000000000..5a3537d61 --- /dev/null +++ b/lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb @@ -0,0 +1,59 @@ +module Fog + module Parsers + module CDN + module AWS + + class GetStreamingDistributionList < Fog::Parsers::Base + + def reset + @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] } + @response = { 'StreamingDistributionSummary' => [] } + end + + def start_element(name, attrs = []) + super + case name + when 'S3Origin' + @origin = name + @distribution_summary[@origin] = {} + end + end + + def end_element(name) + case name + when 'StreamingDistributionSummary' + @response['StreamingDistributionSummary'] << @distribution_summary + @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] } + when 'Comment', 'DomainName', 'Id', 'Status' + @distribution_summary[name] = @value + when 'CNAME' + @distribution_summary[name] << @value + when 'DNSName', 'OriginAccessIdentity' + @distribution_summary[@origin][name] = @value + when 'Enabled' + if @value == 'true' + @distribution_summary[name] = true + else + @distribution_summary[name] = false + end + when 'LastModifiedTime' + @distribution_summary[name] = Time.parse(@value) + when 'IsTruncated' + if @value == 'true' + @response[name] = true + else + @response[name] = false + end + when 'Marker', 'NextMarker' + @response[name] = @value + when 'MaxItems' + @response[name] = @value.to_i + end + end + + end + + end + end + end +end diff --git a/lib/fog/cdn/parsers/aws/streaming_distribution.rb b/lib/fog/cdn/parsers/aws/streaming_distribution.rb new file mode 100644 index 000000000..fb6cd5ba9 --- /dev/null +++ b/lib/fog/cdn/parsers/aws/streaming_distribution.rb @@ -0,0 +1,59 @@ +module Fog + module Parsers + module CDN + module AWS + + class StreamingDistribution < Fog::Parsers::Base + + def reset + @response = { 'StreamingDistributionConfig' => { 'CNAME' => [], 'Logging' => {}, 'TrustedSigners' => [] } } + end + + def start_element(name, attrs = []) + super + case name + when 'CustomOrigin', 'S3Origin' + @origin = name + @response['StreamingDistributionConfig'][@origin] = {} + end + end + + def end_element(name) + case name + when 'AwsAccountNumber' + @response['StreamingDistributionConfig']['TrustedSigners'] << @value + when 'Bucket', 'Prefix' + @response['StreamingDistributionConfig']['Logging'][name] = @value + when 'CNAME' + @response['StreamingDistributionConfig']['CNAME'] << @value + when 'DNSName', 'OriginAccessIdentity', 'OriginProtocolPolicy' + @response['StreamingDistributionConfig'][@origin][name] = @value + when 'DomainName', 'Id', 'Status' + @response[name] = @value + when 'CallerReference', 'Comment', 'DefaultRootObject', 'Origin', 'OriginAccessIdentity' + @response['StreamingDistributionConfig'][name] = @value + when 'Enabled' + if @value == 'true' + @response['StreamingDistributionConfig'][name] = true + else + @response['StreamingDistributionConfig'][name] = false + end + when 'HTTPPort', 'HTTPSPort' + @response['StreamingDistributionConfig'][@origin][name] = @value.to_i + when 'InProgressInvalidationBatches' + @response[name] = @value.to_i + when 'LastModifiedTime' + @response[name] = Time.parse(@value) + when 'Protocol' + @response['StreamingDistributionConfig']['RequireProtocols'] = @value + when 'Self' + @response['StreamingDistributionConfig']['TrustedSigners'] << 'Self' + end + end + + end + + end + end + end +end diff --git a/lib/fog/cdn/requests/aws/delete_streaming_distribution.rb b/lib/fog/cdn/requests/aws/delete_streaming_distribution.rb new file mode 100644 index 000000000..246da13ff --- /dev/null +++ b/lib/fog/cdn/requests/aws/delete_streaming_distribution.rb @@ -0,0 +1,28 @@ +module Fog + module CDN + class AWS + class Real + + # 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 + # + # ==== See Also + # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/DeleteStreamingDistribution.html + + def delete_streaming_distribution(distribution_id, etag) + request({ + :expects => 204, + :headers => { 'If-Match' => etag }, + :idempotent => true, + :method => 'DELETE', + :path => "/streaming-distribution/#{distribution_id}" + }) + end + + end + end + end +end diff --git a/lib/fog/cdn/requests/aws/get_invalidation_list.rb b/lib/fog/cdn/requests/aws/get_invalidation_list.rb new file mode 100644 index 000000000..a906ad1e3 --- /dev/null +++ b/lib/fog/cdn/requests/aws/get_invalidation_list.rb @@ -0,0 +1,42 @@ +module Fog + module CDN + class AWS + class Real + + require 'fog/cdn/parsers/aws/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 + # + # ==== 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>: + # + # ==== See Also + # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListInvalidation.html + + def get_invalidation_list(distribution_id, options = {}) + request({ + :expects => 200, + :idempotent => true, + :method => 'GET', + :parser => Fog::Parsers::CDN::AWS::GetInvalidationList.new, + :path => "/distribution/#{distribution_id}/invalidation", + :query => options + }) + end + + end + end + end +end diff --git a/lib/fog/cdn/requests/aws/get_streaming_distribution.rb b/lib/fog/cdn/requests/aws/get_streaming_distribution.rb new file mode 100644 index 000000000..bff94035e --- /dev/null +++ b/lib/fog/cdn/requests/aws/get_streaming_distribution.rb @@ -0,0 +1,50 @@ +module Fog + module CDN + class AWS + class Real + + require 'fog/cdn/parsers/aws/streaming_distribution' + + # Get information about a streaming distribution from CloudFront + # + # ==== Parameters + # * 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 + # + # ==== See Also + # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/GetStreamingDistribution.html + + def get_streaming_distribution(distribution_id) + request({ + :expects => 200, + :idempotent => true, + :method => 'GET', + :parser => Fog::Parsers::CDN::AWS::StreamingDistribution.new, + :path => "/streaming-distribution/#{distribution_id}" + }) + end + + end + end + end +end diff --git a/lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb b/lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb new file mode 100644 index 000000000..f6083a176 --- /dev/null +++ b/lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb @@ -0,0 +1,59 @@ +module Fog + module CDN + class AWS + class Real + + require 'fog/cdn/parsers/aws/get_streaming_distribution_list' + + # 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 + # + # ==== 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 + # 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 + # + # ==== See Also + # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/ListStreamingDistributions.html + + def get_streaming_distribution_list(options = {}) + request({ + :expects => 200, + :idempotent => true, + :method => 'GET', + :parser => Fog::Parsers::CDN::AWS::GetStreamingDistributionList.new, + :path => "/streaming-distribution", + :query => options + }) + end + + end + end + end +end diff --git a/lib/fog/cdn/requests/aws/post_streaming_distribution.rb b/lib/fog/cdn/requests/aws/post_streaming_distribution.rb new file mode 100644 index 000000000..8ac09e6fd --- /dev/null +++ b/lib/fog/cdn/requests/aws/post_streaming_distribution.rb @@ -0,0 +1,78 @@ +module Fog + module CDN + class AWS + class Real + + require 'fog/cdn/parsers/aws/streaming_distribution' + + # create a new streaming distribution in CloudFront + # + # ==== Parameters + # * options<~Hash> - config for distribution. Defaults to {}. + # REQUIRED: + # * '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/' + # + # ==== 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 + # + # ==== See Also + # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/CreateStreamingDistribution.html + + def post_streaming_distribution(options = {}) + options['CallerReference'] = Time.now.to_i.to_s + data = '' + data << "" + for key, value in options + case value + when Array + for item in value + data << "<#{key}>#{item}" + end + when Hash + data << "<#{key}>" + for inner_key, inner_value in value + data << "<#{inner_key}>#{inner_value}" + end + data << "" + else + data << "<#{key}>#{value}" + end + end + data << "" + request({ + :body => data, + :expects => 201, + :headers => { 'Content-Type' => 'text/xml' }, + :idempotent => true, + :method => 'POST', + :parser => Fog::Parsers::CDN::AWS::StreamingDistribution.new, + :path => "/streaming-distribution" + }) + end + + end + end + end +end diff --git a/lib/fog/cdn/requests/aws/put_streaming_distribution_config.rb b/lib/fog/cdn/requests/aws/put_streaming_distribution_config.rb new file mode 100644 index 000000000..88deacc3f --- /dev/null +++ b/lib/fog/cdn/requests/aws/put_streaming_distribution_config.rb @@ -0,0 +1,83 @@ +module Fog + module CDN + class AWS + class Real + + require 'fog/cdn/parsers/aws/streaming_distribution' + + # update a streaming distribution in CloudFront + # + # ==== Parameters + # * distribution_id<~String> - Id of distribution to update config for + # * options<~Hash> - config for distribution. Defaults to {}. + # REQUIRED: + # * '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/' + # + # ==== 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 + # + # ==== See Also + # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/PutStreamingDistribution.html + + def put_streaming_distribution_config(distribution_id, etag, options = {}) + data = '' + data << "" + for key, value in options + case value + when Array + for item in value + data << "<#{key}>#{item}" + end + when Hash + data << "<#{key}>" + for inner_key, inner_value in value + data << "<#{inner_key}>#{inner_value}" + end + data << "" + else + data << "<#{key}>#{value}" + end + end + data << "" + request({ + :body => data, + :expects => 200, + :headers => { + 'Content-Type' => 'text/xml', + 'If-Match' => etag + }, + :idempotent => true, + :method => 'PUT', + :parser => Fog::Parsers::CDN::AWS::StreamingDistribution.new, + :path => "/streaming-distribution/#{distribution_id}/config" + }) + end + + end + end + end +end From 5b5bea65531d707c875cde6365bddccfafba5ae7 Mon Sep 17 00:00:00 2001 From: Christopher Oliver Date: Mon, 25 Jul 2011 16:03:41 -0400 Subject: [PATCH 10/11] [aws|compute] describe security groups parser was not taking into account ipPermissionsEgress and therefore returning unexpected results when the account had VPC groups. --- .../parsers/aws/describe_security_groups.rb | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/fog/compute/parsers/aws/describe_security_groups.rb b/lib/fog/compute/parsers/aws/describe_security_groups.rb index 3f95b5628..90992f13f 100644 --- a/lib/fog/compute/parsers/aws/describe_security_groups.rb +++ b/lib/fog/compute/parsers/aws/describe_security_groups.rb @@ -8,8 +8,9 @@ module Fog def reset @group = {} @ip_permission = { 'groups' => [], 'ipRanges' => []} + @ip_permission_egress = { 'groups' => [], 'ipRanges' => []} @ip_range = {} - @security_group = { 'ipPermissions' => [] } + @security_group = { 'ipPermissions' => [], 'ipPermissionsEgress' => [] } @response = { 'securityGroupInfo' => [] } end @@ -20,6 +21,8 @@ module Fog @in_groups = true when 'ipPermissions' @in_ip_permissions = true + when 'ipPermissionsEgress' + @in_ip_permissions_egress = true when 'ipRanges' @in_ip_ranges = true end @@ -30,7 +33,11 @@ module Fog when 'cidrIp' @ip_range[name] = value when 'fromPort', 'toPort' - @ip_permission[name] = value.to_i + if @in_ip_permissions_egress + @ip_permission_egress[name] = value.to_i + else + @ip_permission[name] = value.to_i + end when 'groups' @in_groups = false when 'groupDescription', 'ownerId' @@ -43,23 +50,40 @@ module Fog end when 'ipPermissions' @in_ip_permissions = false + when 'ipPermissionsEgress' + @in_ip_permissions_egress = false when 'ipProtocol' - @ip_permission[name] = value + if @in_ip_permissions_egress + @ip_permission_egress[name] = value + else + @ip_permission[name] = value + end when 'ipRanges' @in_ip_ranges = false when 'item' if @in_groups - @ip_permission['groups'] << @group + if @in_ip_permissions_egress + @ip_permission_egress['group'] << @group + else + @ip_permission['groups'] << @group + end @group = {} elsif @in_ip_ranges - @ip_permission['ipRanges'] << @ip_range + if @in_ip_permissions_egress + @ip_permission_egress['ipRanges'] << @ip_range + else + @ip_permission['ipRanges'] << @ip_range + end @ip_range = {} elsif @in_ip_permissions @security_group['ipPermissions'] << @ip_permission @ip_permission = { 'groups' => [], 'ipRanges' => []} - else + elsif @in_ip_permissions_egress + @security_group['ipPermissionsEgress'] << @ip_permission_egress + @ip_permission_egress = { 'groups' => [], 'ipRanges' => []} + else @response['securityGroupInfo'] << @security_group - @security_group = { 'ipPermissions' => [] } + @security_group = { 'ipPermissions' => [], 'ipPermissionsEgress' => [] } end when 'requestId' @response[name] = value From 36782c8ac546a2d4d20ebffad05b5d83427a488c Mon Sep 17 00:00:00 2001 From: Christopher Oliver Date: Tue, 26 Jul 2011 13:11:44 -0400 Subject: [PATCH 11/11] [aws|compute] Added missing 'platform' attribute to server model and describe instances request. --- lib/fog/compute/models/aws/server.rb | 1 + lib/fog/compute/parsers/aws/describe_instances.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fog/compute/models/aws/server.rb b/lib/fog/compute/models/aws/server.rb index 369658d2e..da9b0dc60 100644 --- a/lib/fog/compute/models/aws/server.rb +++ b/lib/fog/compute/models/aws/server.rb @@ -25,6 +25,7 @@ module Fog attribute :created_at, :aliases => 'launchTime' attribute :monitoring, :squash => 'state' attribute :placement_group, :aliases => 'groupName' + attribute :platform, :aliases => 'platform' attribute :product_codes, :aliases => 'productCodes' attribute :private_dns_name, :aliases => 'privateDnsName' attribute :private_ip_address, :aliases => 'privateIpAddress' diff --git a/lib/fog/compute/parsers/aws/describe_instances.rb b/lib/fog/compute/parsers/aws/describe_instances.rb index af982bb9c..819dc5b89 100644 --- a/lib/fog/compute/parsers/aws/describe_instances.rb +++ b/lib/fog/compute/parsers/aws/describe_instances.rb @@ -30,7 +30,7 @@ module Fog @instance['placement'][name] = value when 'architecture', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceType', 'ipAddress', 'kernelId', - 'keyName', 'privateDnsName', 'privateIpAddress', 'ramdiskId', + 'keyName', 'platform', 'privateDnsName', 'privateIpAddress', 'ramdiskId', 'reason', 'rootDeviceType' @instance[name] = value when 'attachTime'