mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge branch 'master' into rs_lb
This commit is contained in:
commit
8eb7aaeb54
22 changed files with 846 additions and 36 deletions
1
Rakefile
1
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!
|
||||
|
|
277
changelog.txt
277
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
|
||||
=========================================================
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
43
lib/fog/cdn/parsers/aws/get_invalidation_list.rb
Normal file
43
lib/fog/cdn/parsers/aws/get_invalidation_list.rb
Normal file
|
@ -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
|
59
lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb
Normal file
59
lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb
Normal file
|
@ -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
|
59
lib/fog/cdn/parsers/aws/streaming_distribution.rb
Normal file
59
lib/fog/cdn/parsers/aws/streaming_distribution.rb
Normal file
|
@ -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
|
28
lib/fog/cdn/requests/aws/delete_streaming_distribution.rb
Normal file
28
lib/fog/cdn/requests/aws/delete_streaming_distribution.rb
Normal file
|
@ -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
|
42
lib/fog/cdn/requests/aws/get_invalidation_list.rb
Normal file
42
lib/fog/cdn/requests/aws/get_invalidation_list.rb
Normal file
|
@ -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
|
50
lib/fog/cdn/requests/aws/get_streaming_distribution.rb
Normal file
50
lib/fog/cdn/requests/aws/get_streaming_distribution.rb
Normal file
|
@ -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
|
59
lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb
Normal file
59
lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb
Normal file
|
@ -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
|
78
lib/fog/cdn/requests/aws/post_streaming_distribution.rb
Normal file
78
lib/fog/cdn/requests/aws/post_streaming_distribution.rb
Normal file
|
@ -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 = '<?xml version="1.0" encoding="UTF-8"?>'
|
||||
data << "<StreamingDistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"
|
||||
for key, value in options
|
||||
case value
|
||||
when Array
|
||||
for item in value
|
||||
data << "<#{key}>#{item}</#{key}>"
|
||||
end
|
||||
when Hash
|
||||
data << "<#{key}>"
|
||||
for inner_key, inner_value in value
|
||||
data << "<#{inner_key}>#{inner_value}</#{inner_key}>"
|
||||
end
|
||||
data << "</#{key}>"
|
||||
else
|
||||
data << "<#{key}>#{value}</#{key}>"
|
||||
end
|
||||
end
|
||||
data << "</StreamingDistributionConfig>"
|
||||
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
|
|
@ -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 = '<?xml version="1.0" encoding="UTF-8"?>'
|
||||
data << "<StreamingDistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"
|
||||
for key, value in options
|
||||
case value
|
||||
when Array
|
||||
for item in value
|
||||
data << "<#{key}>#{item}</#{key}>"
|
||||
end
|
||||
when Hash
|
||||
data << "<#{key}>"
|
||||
for inner_key, inner_value in value
|
||||
data << "<#{inner_key}>#{inner_value}</#{inner_key}>"
|
||||
end
|
||||
data << "</#{key}>"
|
||||
else
|
||||
data << "<#{key}>#{value}</#{key}>"
|
||||
end
|
||||
end
|
||||
data << "</StreamingDistributionConfig>"
|
||||
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
|
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
@ -65,6 +68,9 @@ module Fog
|
|||
|
||||
|
||||
def initialize(attributes={})
|
||||
merge_attributes({
|
||||
:flavor_id => 105 # '1CPU, 384MB, 80GB HDD'
|
||||
})
|
||||
super
|
||||
end
|
||||
|
||||
|
@ -99,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?
|
||||
|
@ -127,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.
|
||||
|
@ -143,8 +147,8 @@ module Fog
|
|||
end
|
||||
|
||||
options = {
|
||||
:serviceofferingid => serviceofferingid,
|
||||
:templateid => templateid,
|
||||
:serviceofferingid => flavor_id,
|
||||
:templateid => image_id,
|
||||
:name => name,
|
||||
:zoneid => zoneid,
|
||||
:networkids => networkids,
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue