mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws] rename ec2/s3 to compute/storage
This commit is contained in:
parent
a5411d8cf9
commit
58577e17bf
119 changed files with 687 additions and 643 deletions
|
@ -4,10 +4,12 @@ module Fog
|
|||
extend Fog::Provider
|
||||
|
||||
service_path 'fog/aws'
|
||||
service 'compute'
|
||||
service 'ec2'
|
||||
service 'elb'
|
||||
service 's3'
|
||||
service 'simpledb'
|
||||
service 'storage'
|
||||
|
||||
def self.indexed_param(key, values, offset = 0)
|
||||
params = {}
|
||||
|
|
|
@ -10,35 +10,47 @@ module AWS
|
|||
def [](service)
|
||||
@@connections ||= Hash.new do |hash, key|
|
||||
hash[key] = case key
|
||||
when :compute
|
||||
Fog::AWS::Compute.new
|
||||
when :ec2
|
||||
Fog::AWS::EC2.new
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] AWS[:ec2] is deprecated, use AWS[:compute] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::AWS::Compute.new
|
||||
when :elb
|
||||
Fog::AWS::ELB.new
|
||||
when :simpledb
|
||||
Fog::AWS::SimpleDB.new
|
||||
when :s3
|
||||
Fog::AWS::S3.new
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] AWS[:s3] is deprecated, use AWS[:storage] instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::AWS::Storage.new
|
||||
when :storage
|
||||
Fog::AWS::Storage.new
|
||||
end
|
||||
end
|
||||
@@connections[service]
|
||||
end
|
||||
|
||||
def services
|
||||
[:ec2, :elb, :simpledb, :s3]
|
||||
[:compute, :elb, :simpledb, :storage]
|
||||
end
|
||||
|
||||
for collection in Fog::AWS::EC2.collections
|
||||
for collection in Fog::AWS::Compute.collections
|
||||
module_eval <<-EOS, __FILE__, __LINE__
|
||||
def #{collection}
|
||||
self[:ec2].#{collection}
|
||||
self[:compute].#{collection}
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
||||
for collection in Fog::AWS::S3.collections
|
||||
for collection in Fog::AWS::Storage.collections
|
||||
module_eval <<-EOS, __FILE__, __LINE__
|
||||
def #{collection}
|
||||
self[:s3].#{collection}
|
||||
self[:storage].#{collection}
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
|
221
lib/fog/aws/compute.rb
Normal file
221
lib/fog/aws/compute.rb
Normal file
|
@ -0,0 +1,221 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class Compute < Fog::Service
|
||||
|
||||
requires :aws_access_key_id, :aws_secret_access_key
|
||||
|
||||
model_path 'fog/aws/models/compute'
|
||||
model :address
|
||||
collection :addresses
|
||||
model :flavor
|
||||
collection :flavors
|
||||
model :image
|
||||
collection :images
|
||||
model :key_pair
|
||||
collection :key_pairs
|
||||
model :security_group
|
||||
collection :security_groups
|
||||
model :server
|
||||
collection :servers
|
||||
model :snapshot
|
||||
collection :snapshots
|
||||
model :volume
|
||||
collection :volumes
|
||||
|
||||
require 'fog/aws/parsers/ec2/basic'
|
||||
|
||||
request_path 'fog/aws/requests/compute'
|
||||
request :allocate_address
|
||||
request :associate_address
|
||||
request :attach_volume
|
||||
request :authorize_security_group_ingress
|
||||
request :create_key_pair
|
||||
request :create_security_group
|
||||
request :create_snapshot
|
||||
request :create_image
|
||||
request :create_volume
|
||||
request :delete_key_pair
|
||||
request :delete_security_group
|
||||
request :delete_snapshot
|
||||
request :delete_volume
|
||||
request :deregister_image
|
||||
request :describe_addresses
|
||||
request :describe_availability_zones
|
||||
request :describe_images
|
||||
request :describe_instances
|
||||
request :describe_reserved_instances
|
||||
request :describe_key_pairs
|
||||
request :describe_regions
|
||||
request :describe_security_groups
|
||||
request :describe_snapshots
|
||||
request :describe_volumes
|
||||
request :detach_volume
|
||||
request :disassociate_address
|
||||
request :get_console_output
|
||||
request :modify_image_attributes
|
||||
request :modify_snapshot_attribute
|
||||
request :reboot_instances
|
||||
request :release_address
|
||||
request :register_image
|
||||
request :revoke_security_group_ingress
|
||||
request :run_instances
|
||||
request :terminate_instances
|
||||
request :start_instances
|
||||
request :stop_instances
|
||||
|
||||
class Mock
|
||||
include Collections
|
||||
|
||||
def self.data
|
||||
@data ||= Hash.new do |hash, key|
|
||||
owner_id = Fog::AWS::Mock.owner_id
|
||||
hash[key] = {
|
||||
:deleted_at => {},
|
||||
:addresses => {},
|
||||
:instances => {},
|
||||
:key_pairs => {},
|
||||
:limits => { :addresses => 5 },
|
||||
:owner_id => owner_id,
|
||||
:security_groups => {
|
||||
'default' => {
|
||||
'groupDescription' => 'default group',
|
||||
'groupName' => 'default',
|
||||
'ipPermissions' => [
|
||||
{
|
||||
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
||||
'fromPort' => -1,
|
||||
'toPort' => -1,
|
||||
'ipProtocol' => 'icmp',
|
||||
'ipRanges' => []
|
||||
},
|
||||
{
|
||||
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
||||
'fromPort' => 0,
|
||||
'toPort' => 65535,
|
||||
'ipProtocol' => 'tcp',
|
||||
'ipRanges' => []
|
||||
},
|
||||
{
|
||||
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
||||
'fromPort' => 0,
|
||||
'toPort' => 65535,
|
||||
'ipProtocol' => 'udp',
|
||||
'ipRanges' => []
|
||||
}
|
||||
],
|
||||
'ownerId' => owner_id
|
||||
}
|
||||
},
|
||||
:snapshots => {},
|
||||
:volumes => {}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def self.reset_data(keys=data.keys)
|
||||
for key in [*keys]
|
||||
data.delete(key)
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@data = self.class.data[@aws_access_key_id]
|
||||
@owner_id = @data[:owner_id]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Real
|
||||
include Collections
|
||||
|
||||
# Initialize connection to EC2
|
||||
#
|
||||
# ==== Notes
|
||||
# options parameter must include values for :aws_access_key_id and
|
||||
# :aws_secret_access_key in order to create a connection
|
||||
#
|
||||
# ==== Examples
|
||||
# sdb = SimpleDB.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
#
|
||||
# ==== Parameters
|
||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
||||
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1']
|
||||
#
|
||||
# ==== Returns
|
||||
# * EC2 object with connection to aws.
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
||||
options[:region] ||= 'us-east-1'
|
||||
@host = options[:host] || case options[:region]
|
||||
when 'ap-southeast-1'
|
||||
'ec2.ap-southeast-1.amazonaws.com'
|
||||
when 'eu-west-1'
|
||||
'ec2.eu-west-1.amazonaws.com'
|
||||
when 'us-east-1'
|
||||
'ec2.us-east-1.amazonaws.com'
|
||||
when 'us-west-1'
|
||||
'ec2.us-west-1.amazonaws.com'
|
||||
else
|
||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
||||
end
|
||||
@port = options[:port] || 443
|
||||
@scheme = options[:scheme] || 'https'
|
||||
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
||||
end
|
||||
|
||||
def reload
|
||||
@connection.reset
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request(params)
|
||||
idempotent = params.delete(:idempotent)
|
||||
parser = params.delete(:parser)
|
||||
|
||||
body = AWS.signed_params(
|
||||
params,
|
||||
{
|
||||
:aws_access_key_id => @aws_access_key_id,
|
||||
:hmac => @hmac,
|
||||
:host => @host,
|
||||
:version => '2009-11-30'
|
||||
}
|
||||
)
|
||||
|
||||
begin
|
||||
response = @connection.request({
|
||||
:body => body,
|
||||
:expects => 200,
|
||||
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
||||
:idempotent => idempotent,
|
||||
:host => @host,
|
||||
:method => 'POST',
|
||||
:parser => parser
|
||||
})
|
||||
rescue Excon::Errors::Error => error
|
||||
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
||||
raise case match[1].split('.').last
|
||||
when 'NotFound'
|
||||
Fog::AWS::EC2::NotFound.slurp(error, match[2])
|
||||
else
|
||||
Fog::AWS::EC2::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
||||
end
|
||||
else
|
||||
raise error
|
||||
end
|
||||
end
|
||||
|
||||
response
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,221 +1,15 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2 < Fog::Service
|
||||
|
||||
requires :aws_access_key_id, :aws_secret_access_key
|
||||
|
||||
model_path 'fog/aws/models/ec2'
|
||||
model :address
|
||||
collection :addresses
|
||||
model :flavor
|
||||
collection :flavors
|
||||
model :image
|
||||
collection :images
|
||||
model :key_pair
|
||||
collection :key_pairs
|
||||
model :security_group
|
||||
collection :security_groups
|
||||
model :server
|
||||
collection :servers
|
||||
model :snapshot
|
||||
collection :snapshots
|
||||
model :volume
|
||||
collection :volumes
|
||||
|
||||
require 'fog/aws/parsers/ec2/basic'
|
||||
|
||||
request_path 'fog/aws/requests/ec2'
|
||||
request :allocate_address
|
||||
request :associate_address
|
||||
request :attach_volume
|
||||
request :authorize_security_group_ingress
|
||||
request :create_key_pair
|
||||
request :create_security_group
|
||||
request :create_snapshot
|
||||
request :create_image
|
||||
request :create_volume
|
||||
request :delete_key_pair
|
||||
request :delete_security_group
|
||||
request :delete_snapshot
|
||||
request :delete_volume
|
||||
request :deregister_image
|
||||
request :describe_addresses
|
||||
request :describe_availability_zones
|
||||
request :describe_images
|
||||
request :describe_instances
|
||||
request :describe_reserved_instances
|
||||
request :describe_key_pairs
|
||||
request :describe_regions
|
||||
request :describe_security_groups
|
||||
request :describe_snapshots
|
||||
request :describe_volumes
|
||||
request :detach_volume
|
||||
request :disassociate_address
|
||||
request :get_console_output
|
||||
request :modify_image_attributes
|
||||
request :modify_snapshot_attribute
|
||||
request :reboot_instances
|
||||
request :release_address
|
||||
request :register_image
|
||||
request :revoke_security_group_ingress
|
||||
request :run_instances
|
||||
request :terminate_instances
|
||||
request :start_instances
|
||||
request :stop_instances
|
||||
|
||||
class Mock
|
||||
include Collections
|
||||
|
||||
def self.data
|
||||
@data ||= Hash.new do |hash, key|
|
||||
owner_id = Fog::AWS::Mock.owner_id
|
||||
hash[key] = {
|
||||
:deleted_at => {},
|
||||
:addresses => {},
|
||||
:instances => {},
|
||||
:key_pairs => {},
|
||||
:limits => { :addresses => 5 },
|
||||
:owner_id => owner_id,
|
||||
:security_groups => {
|
||||
'default' => {
|
||||
'groupDescription' => 'default group',
|
||||
'groupName' => 'default',
|
||||
'ipPermissions' => [
|
||||
{
|
||||
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
||||
'fromPort' => -1,
|
||||
'toPort' => -1,
|
||||
'ipProtocol' => 'icmp',
|
||||
'ipRanges' => []
|
||||
},
|
||||
{
|
||||
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
||||
'fromPort' => 0,
|
||||
'toPort' => 65535,
|
||||
'ipProtocol' => 'tcp',
|
||||
'ipRanges' => []
|
||||
},
|
||||
{
|
||||
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
||||
'fromPort' => 0,
|
||||
'toPort' => 65535,
|
||||
'ipProtocol' => 'udp',
|
||||
'ipRanges' => []
|
||||
}
|
||||
],
|
||||
'ownerId' => owner_id
|
||||
}
|
||||
},
|
||||
:snapshots => {},
|
||||
:volumes => {}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def self.reset_data(keys=data.keys)
|
||||
for key in [*keys]
|
||||
data.delete(key)
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@data = self.class.data[@aws_access_key_id]
|
||||
@owner_id = @data[:owner_id]
|
||||
end
|
||||
class EC2
|
||||
|
||||
def self.new(attributes = {})
|
||||
location = caller.first
|
||||
warning = "[yellow][WARN] Fog::AWS::EC2#new is deprecated, use Fog::AWS::Compute#new instead[/]"
|
||||
warning << " [light_black](" << location << ")[/] "
|
||||
Formatador.display_line(warning)
|
||||
Fog::AWS::Compute.new(attributes)
|
||||
end
|
||||
|
||||
class Real
|
||||
include Collections
|
||||
|
||||
# Initialize connection to EC2
|
||||
#
|
||||
# ==== Notes
|
||||
# options parameter must include values for :aws_access_key_id and
|
||||
# :aws_secret_access_key in order to create a connection
|
||||
#
|
||||
# ==== Examples
|
||||
# sdb = SimpleDB.new(
|
||||
# :aws_access_key_id => your_aws_access_key_id,
|
||||
# :aws_secret_access_key => your_aws_secret_access_key
|
||||
# )
|
||||
#
|
||||
# ==== Parameters
|
||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
||||
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1']
|
||||
#
|
||||
# ==== Returns
|
||||
# * EC2 object with connection to aws.
|
||||
def initialize(options={})
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
||||
options[:region] ||= 'us-east-1'
|
||||
@host = options[:host] || case options[:region]
|
||||
when 'ap-southeast-1'
|
||||
'ec2.ap-southeast-1.amazonaws.com'
|
||||
when 'eu-west-1'
|
||||
'ec2.eu-west-1.amazonaws.com'
|
||||
when 'us-east-1'
|
||||
'ec2.us-east-1.amazonaws.com'
|
||||
when 'us-west-1'
|
||||
'ec2.us-west-1.amazonaws.com'
|
||||
else
|
||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
||||
end
|
||||
@port = options[:port] || 443
|
||||
@scheme = options[:scheme] || 'https'
|
||||
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
|
||||
end
|
||||
|
||||
def reload
|
||||
@connection.reset
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request(params)
|
||||
idempotent = params.delete(:idempotent)
|
||||
parser = params.delete(:parser)
|
||||
|
||||
body = AWS.signed_params(
|
||||
params,
|
||||
{
|
||||
:aws_access_key_id => @aws_access_key_id,
|
||||
:hmac => @hmac,
|
||||
:host => @host,
|
||||
:version => '2009-11-30'
|
||||
}
|
||||
)
|
||||
|
||||
begin
|
||||
response = @connection.request({
|
||||
:body => body,
|
||||
:expects => 200,
|
||||
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
||||
:idempotent => idempotent,
|
||||
:host => @host,
|
||||
:method => 'POST',
|
||||
:parser => parser
|
||||
})
|
||||
rescue Excon::Errors::Error => error
|
||||
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
||||
raise case match[1].split('.').last
|
||||
when 'NotFound'
|
||||
Fog::AWS::EC2::NotFound.slurp(error, match[2])
|
||||
else
|
||||
Fog::AWS::EC2::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
||||
end
|
||||
else
|
||||
raise error
|
||||
end
|
||||
end
|
||||
|
||||
response
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Address < Fog::Model
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/address'
|
||||
require 'fog/aws/models/compute/address'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Addresses < Fog::Collection
|
||||
|
||||
attribute :public_ip
|
||||
attribute :server
|
||||
|
||||
model Fog::AWS::EC2::Address
|
||||
model Fog::AWS::Compute::Address
|
||||
|
||||
def initialize(attributes)
|
||||
@public_ip ||= []
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Flavor < Fog::Model
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/flavor'
|
||||
require 'fog/aws/models/compute/flavor'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Flavors < Fog::Collection
|
||||
|
||||
model Fog::AWS::EC2::Flavor
|
||||
model Fog::AWS::Compute::Flavor
|
||||
|
||||
def all
|
||||
data = [
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Image < Fog::Model
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/image'
|
||||
require 'fog/aws/models/compute/image'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Images < Fog::Collection
|
||||
|
||||
attribute :image_id
|
||||
|
||||
model Fog::AWS::EC2::Image
|
||||
model Fog::AWS::Compute::Image
|
||||
|
||||
def initialize(attributes)
|
||||
@image_id ||= []
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class KeyPair < Fog::Model
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/key_pair'
|
||||
require 'fog/aws/models/compute/key_pair'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class KeyPairs < Fog::Collection
|
||||
|
||||
attribute :key_name
|
||||
|
||||
model Fog::AWS::EC2::KeyPair
|
||||
model Fog::AWS::Compute::KeyPair
|
||||
|
||||
def initialize(attributes)
|
||||
@key_name ||= []
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class SecurityGroup < Fog::Model
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/security_group'
|
||||
require 'fog/aws/models/compute/security_group'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class SecurityGroups < Fog::Collection
|
||||
|
||||
attribute :group_name
|
||||
|
||||
model Fog::AWS::EC2::SecurityGroup
|
||||
model Fog::AWS::Compute::SecurityGroup
|
||||
|
||||
def initialize(attributes)
|
||||
@group_name ||= []
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Server < Fog::Model
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/server'
|
||||
require 'fog/aws/models/compute/server'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Servers < Fog::Collection
|
||||
|
||||
attribute :server_id
|
||||
|
||||
model Fog::AWS::EC2::Server
|
||||
model Fog::AWS::Compute::Server
|
||||
|
||||
def initialize(attributes)
|
||||
@server_id ||= []
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Snapshot < Fog::Model
|
||||
extend Fog::Deprecation
|
|
@ -1,9 +1,9 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/snapshot'
|
||||
require 'fog/aws/models/compute/snapshot'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Snapshots < Fog::Collection
|
||||
|
||||
|
@ -12,7 +12,7 @@ module Fog
|
|||
attribute :snapshot_id
|
||||
attribute :volume
|
||||
|
||||
model Fog::AWS::EC2::Snapshot
|
||||
model Fog::AWS::Compute::Snapshot
|
||||
|
||||
def initialize(attributes)
|
||||
@snapshot_id ||= []
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Volume < Fog::Model
|
||||
extend Fog::Deprecation
|
|
@ -1,16 +1,16 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/ec2/volume'
|
||||
require 'fog/aws/models/compute/volume'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
|
||||
class Volumes < Fog::Collection
|
||||
|
||||
attribute :volume_id
|
||||
attribute :server
|
||||
|
||||
model Fog::AWS::EC2::Volume
|
||||
model Fog::AWS::Compute::Volume
|
||||
|
||||
def initialize(attributes)
|
||||
@volume_id ||= []
|
|
@ -1,13 +1,13 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/s3/directory'
|
||||
require 'fog/aws/models/storage/directory'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
|
||||
class Directories < Fog::Collection
|
||||
|
||||
model Fog::AWS::S3::Directory
|
||||
model Fog::AWS::Storage::Directory
|
||||
|
||||
def all
|
||||
data = connection.get_service.body['Buckets']
|
|
@ -1,9 +1,9 @@
|
|||
require 'fog/model'
|
||||
require 'fog/aws/models/s3/files'
|
||||
require 'fog/aws/models/storage/files'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
|
||||
class Directory < Fog::Model
|
||||
extend Fog::Deprecation
|
||||
|
@ -34,7 +34,7 @@ module Fog
|
|||
|
||||
def files
|
||||
@files ||= begin
|
||||
Fog::AWS::S3::Files.new(
|
||||
Fog::AWS::Storage::Files.new(
|
||||
:directory => self,
|
||||
:connection => connection
|
||||
)
|
|
@ -2,7 +2,7 @@ require 'fog/model'
|
|||
|
||||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
|
||||
class File < Fog::Model
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
require 'fog/collection'
|
||||
require 'fog/aws/models/s3/file'
|
||||
require 'fog/aws/models/storage/file'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
|
||||
class Files < Fog::Collection
|
||||
|
||||
|
@ -14,7 +14,7 @@ module Fog
|
|||
attribute :max_keys, :aliases => ['MaxKeys', 'max-keys']
|
||||
attribute :prefix, :aliases => 'Prefix'
|
||||
|
||||
model Fog::AWS::S3::File
|
||||
model Fog::AWS::Storage::File
|
||||
|
||||
def all(options = {})
|
||||
requires :directory
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class AllocateAddress < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class AttachVolume < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class Basic < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class CreateImage < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class CreateKeyPair < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class CreateSnapshot < Fog::Parsers::Base
|
||||
|
||||
|
@ -23,4 +23,4 @@ module Fog
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class CreateVolume < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DeregisterImage < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeAddresses < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeAvailabilityZones < Fog::Parsers::Base
|
||||
|
||||
|
@ -27,4 +27,4 @@ module Fog
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeImages < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeInstances < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeKeyPairs < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeRegions < Fog::Parsers::Base
|
||||
|
||||
|
@ -27,4 +27,4 @@ module Fog
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeReservedInstances < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeSecurityGroups < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeSnapshots < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DescribeVolumes < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class DetachVolume < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class GetConsoleOutput < Fog::Parsers::Base
|
||||
|
||||
|
@ -29,4 +29,4 @@ module Fog
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class RegisterImage < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class RunInstances < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class StartStopInstances < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module EC2
|
||||
module Compute
|
||||
|
||||
class TerminateInstances < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class AccessControlList < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class CopyObject < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class GetBucket < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class GetBucketLocation < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class AccessControlList < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class GetBucketObjectVersions < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class GetBucketVersioning < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class GetRequestPayment < Fog::Parsers::Base
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module S3
|
||||
module Storage
|
||||
|
||||
class GetService < Fog::Parsers::Base
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/allocate_address'
|
||||
require 'fog/aws/parsers/compute/allocate_address'
|
||||
|
||||
# Acquire an elastic IP address.
|
||||
#
|
||||
|
@ -15,7 +15,7 @@ module Fog
|
|||
def allocate_address
|
||||
request(
|
||||
'Action' => 'AllocateAddress',
|
||||
:parser => Fog::Parsers::AWS::EC2::AllocateAddress.new
|
||||
:parser => Fog::Parsers::AWS::Compute::AllocateAddress.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Associate an elastic IP address with an instance
|
||||
|
@ -20,7 +20,7 @@ module Fog
|
|||
'InstanceId' => instance_id,
|
||||
'PublicIp' => public_ip,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/attach_volume'
|
||||
require 'fog/aws/parsers/compute/attach_volume'
|
||||
|
||||
# Attach an Amazon EBS volume with a running instance, exposing as specified device
|
||||
#
|
||||
|
@ -28,7 +28,7 @@ module Fog
|
|||
'InstanceId' => instance_id,
|
||||
'Device' => device,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::AttachVolume.new
|
||||
:parser => Fog::Parsers::AWS::Compute::AttachVolume.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Add permissions to a security group
|
||||
|
@ -26,7 +26,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'AuthorizeSecurityGroupIngress',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/create_image'
|
||||
require 'fog/aws/parsers/compute/create_image'
|
||||
|
||||
# Create a bootable EBS volume AMI
|
||||
#
|
||||
|
@ -25,7 +25,7 @@ module Fog
|
|||
'Name' => name,
|
||||
'Description' => description,
|
||||
'NoReboot' => no_reboot.to_s,
|
||||
:parser => Fog::Parsers::AWS::EC2::CreateImage.new
|
||||
:parser => Fog::Parsers::AWS::Compute::CreateImage.new
|
||||
)
|
||||
end
|
||||
end
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/create_key_pair'
|
||||
require 'fog/aws/parsers/compute/create_key_pair'
|
||||
|
||||
# Create a new key pair
|
||||
#
|
||||
|
@ -21,7 +21,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'CreateKeyPair',
|
||||
'KeyName' => key_name,
|
||||
:parser => Fog::Parsers::AWS::EC2::CreateKeyPair.new
|
||||
:parser => Fog::Parsers::AWS::Compute::CreateKeyPair.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Create a new security group
|
||||
|
@ -19,7 +19,7 @@ module Fog
|
|||
'Action' => 'CreateSecurityGroup',
|
||||
'GroupName' => name,
|
||||
'GroupDescription' => CGI.escape(description),
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/create_snapshot'
|
||||
require 'fog/aws/parsers/compute/create_snapshot'
|
||||
|
||||
# Create a snapshot of an EBS volume and store it in S3
|
||||
#
|
||||
|
@ -24,7 +24,7 @@ module Fog
|
|||
'Action' => 'CreateSnapshot',
|
||||
'Description' => description,
|
||||
'VolumeId' => volume_id,
|
||||
:parser => Fog::Parsers::AWS::EC2::CreateSnapshot.new
|
||||
:parser => Fog::Parsers::AWS::Compute::CreateSnapshot.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/create_volume'
|
||||
require 'fog/aws/parsers/compute/create_volume'
|
||||
|
||||
# Create an EBS volume
|
||||
#
|
||||
|
@ -27,7 +27,7 @@ module Fog
|
|||
'AvailabilityZone' => availability_zone,
|
||||
'Size' => size,
|
||||
'SnapshotId' => snapshot_id,
|
||||
:parser => Fog::Parsers::AWS::EC2::CreateVolume.new
|
||||
:parser => Fog::Parsers::AWS::Compute::CreateVolume.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Delete a key pair that you own
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
'Action' => 'DeleteKeyPair',
|
||||
'KeyName' => key_name,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Delete a security group that you own
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
'Action' => 'DeleteSecurityGroup',
|
||||
'GroupName' => name,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Delete a snapshot of an EBS volume that you own
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
'Action' => 'DeleteSnapshot',
|
||||
'SnapshotId' => snapshot_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Delete an EBS volume
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
'Action' => 'DeleteVolume',
|
||||
'VolumeId' => volume_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/deregister_image'
|
||||
require 'fog/aws/parsers/compute/deregister_image'
|
||||
|
||||
# deregister an image
|
||||
#
|
||||
|
@ -19,7 +19,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'DeregisterImage',
|
||||
'ImageId' => image_id,
|
||||
:parser => Fog::Parsers::AWS::EC2::DeregisterImage.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DeregisterImage.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_addresses'
|
||||
require 'fog/aws/parsers/compute/describe_addresses'
|
||||
|
||||
# Describe all or specified IP addresses.
|
||||
#
|
||||
|
@ -22,7 +22,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeAddresses',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeAddresses.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeAddresses.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_availability_zones'
|
||||
require 'fog/aws/parsers/compute/describe_availability_zones'
|
||||
|
||||
# Describe all or specified availability zones
|
||||
#
|
||||
|
@ -23,7 +23,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeAvailabilityZones',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeAvailabilityZones.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeAvailabilityZones.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_images'
|
||||
require 'fog/aws/parsers/compute/describe_images'
|
||||
|
||||
# Describe all or specified images.
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeImages',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeImages.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeImages.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_instances'
|
||||
require 'fog/aws/parsers/compute/describe_instances'
|
||||
|
||||
# Describe all or specified instances
|
||||
#
|
||||
|
@ -55,7 +55,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeInstances.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_key_pairs'
|
||||
require 'fog/aws/parsers/compute/describe_key_pairs'
|
||||
|
||||
# Describe all or specified key pairs
|
||||
#
|
||||
|
@ -22,7 +22,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeKeyPairs',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeKeyPairs.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeKeyPairs.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_regions'
|
||||
require 'fog/aws/parsers/compute/describe_regions'
|
||||
|
||||
# Describe all or specified regions
|
||||
#
|
||||
|
@ -22,7 +22,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeRegions',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeRegions.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeRegions.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_reserved_instances'
|
||||
require 'fog/aws/parsers/compute/describe_reserved_instances'
|
||||
|
||||
# Describe all or specified reserved instances
|
||||
#
|
||||
|
@ -30,7 +30,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeReservedInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeReservedInstances.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeReservedInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_security_groups'
|
||||
require 'fog/aws/parsers/compute/describe_security_groups'
|
||||
|
||||
# Describe all or specified security groups
|
||||
#
|
||||
|
@ -32,7 +32,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeSecurityGroups',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeSecurityGroups.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeSecurityGroups.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_snapshots'
|
||||
require 'fog/aws/parsers/compute/describe_snapshots'
|
||||
|
||||
# Describe all or specified snapshots
|
||||
#
|
||||
|
@ -29,7 +29,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeSnapshots',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeSnapshots.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeSnapshots.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/describe_volumes'
|
||||
require 'fog/aws/parsers/compute/describe_volumes'
|
||||
|
||||
# Describe all or specified volumes.
|
||||
#
|
||||
|
@ -31,7 +31,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DescribeVolumes',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeVolumes.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DescribeVolumes.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/detach_volume'
|
||||
require 'fog/aws/parsers/compute/detach_volume'
|
||||
|
||||
# Detach an Amazon EBS volume from a running instance
|
||||
#
|
||||
|
@ -28,7 +28,7 @@ module Fog
|
|||
'Action' => 'DetachVolume',
|
||||
'VolumeId' => volume_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DetachVolume.new
|
||||
:parser => Fog::Parsers::AWS::Compute::DetachVolume.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Disassociate an elastic IP address from its instance (if any)
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
'Action' => 'DisassociateAddress',
|
||||
'PublicIp' => public_ip,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/get_console_output'
|
||||
require 'fog/aws/parsers/compute/get_console_output'
|
||||
|
||||
# Retrieve console output for specified instance
|
||||
#
|
||||
|
@ -22,7 +22,7 @@ module Fog
|
|||
'Action' => 'GetConsoleOutput',
|
||||
'InstanceId' => instance_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::GetConsoleOutput.new
|
||||
:parser => Fog::Parsers::AWS::Compute::GetConsoleOutput.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Modify image attributes
|
||||
|
@ -21,7 +21,7 @@ module Fog
|
|||
'ImageId' => image_id,
|
||||
'OperationType' => operation_type,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Modify snapshot attributes
|
||||
|
@ -20,7 +20,7 @@ module Fog
|
|||
'SnapshotId' => snapshot_id,
|
||||
'OperationType' => operation_type,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Reboot specified instances
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'RebootInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/register_image'
|
||||
require 'fog/aws/parsers/compute/register_image'
|
||||
|
||||
# register an image
|
||||
#
|
||||
|
@ -36,7 +36,7 @@ module Fog
|
|||
'Action' => 'RegisterImage',
|
||||
'Name' => name,
|
||||
'Description' => description,
|
||||
:parser => Fog::Parsers::AWS::EC2::RegisterImage.new
|
||||
:parser => Fog::Parsers::AWS::Compute::RegisterImage.new
|
||||
}
|
||||
|
||||
# This determines if we are doing a snapshot or a S3 backed AMI.
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Release an elastic IP address.
|
||||
|
@ -15,7 +15,7 @@ module Fog
|
|||
'Action' => 'ReleaseAddress',
|
||||
'PublicIp' => public_ip,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Remove permissions from a security group
|
||||
|
@ -26,7 +26,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'RevokeSecurityGroupIngress',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
:parser => Fog::Parsers::AWS::Compute::Basic.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/run_instances'
|
||||
require 'fog/aws/parsers/compute/run_instances'
|
||||
|
||||
# Launch specified instances
|
||||
#
|
||||
|
@ -97,7 +97,7 @@ module Fog
|
|||
'ImageId' => image_id,
|
||||
'MinCount' => min_count,
|
||||
'MaxCount' => max_count,
|
||||
:parser => Fog::Parsers::AWS::EC2::RunInstances.new
|
||||
:parser => Fog::Parsers::AWS::Compute::RunInstances.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/start_stop_instances'
|
||||
require 'fog/aws/parsers/compute/start_stop_instances'
|
||||
|
||||
# Start specified instance
|
||||
#
|
||||
|
@ -20,7 +20,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'StartInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::StartStopInstances.new
|
||||
:parser => Fog::Parsers::AWS::Compute::StartStopInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/start_stop_instances'
|
||||
require 'fog/aws/parsers/compute/start_stop_instances'
|
||||
|
||||
# Stop specified instance
|
||||
#
|
||||
|
@ -20,7 +20,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'StopInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::StartStopInstances.new
|
||||
:parser => Fog::Parsers::AWS::Compute::StartStopInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class EC2
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/ec2/terminate_instances'
|
||||
require 'fog/aws/parsers/compute/terminate_instances'
|
||||
|
||||
# Terminate specified instances
|
||||
#
|
||||
|
@ -27,7 +27,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'TerminateInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::TerminateInstances.new
|
||||
:parser => Fog::Parsers::AWS::Compute::TerminateInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/s3/copy_object'
|
||||
require 'fog/aws/parsers/storage/copy_object'
|
||||
|
||||
# Copy an object from one S3 bucket to another
|
||||
#
|
||||
|
@ -32,7 +32,7 @@ module Fog
|
|||
:headers => headers,
|
||||
:host => "#{target_bucket_name}.#{@host}",
|
||||
:method => 'PUT',
|
||||
:parser => Fog::Parsers::AWS::S3::CopyObject.new,
|
||||
:parser => Fog::Parsers::AWS::Storage::CopyObject.new,
|
||||
:path => CGI.escape(target_object_name)
|
||||
})
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
class Real
|
||||
|
||||
# Delete an S3 bucket
|
|
@ -1,6 +1,6 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
class Real
|
||||
|
||||
# Delete an object from S3
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/s3/get_bucket'
|
||||
require 'fog/aws/parsers/storage/get_bucket'
|
||||
|
||||
# List information about objects in an S3 bucket
|
||||
#
|
||||
|
@ -46,7 +46,7 @@ module Fog
|
|||
:host => "#{bucket_name}.#{@host}",
|
||||
:idempotent => true,
|
||||
:method => 'GET',
|
||||
:parser => Fog::Parsers::AWS::S3::GetBucket.new,
|
||||
:parser => Fog::Parsers::AWS::Storage::GetBucket.new,
|
||||
:query => options
|
||||
})
|
||||
end
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/s3/access_control_list'
|
||||
require 'fog/aws/parsers/storage/access_control_list'
|
||||
|
||||
# Get access control list for an S3 bucket
|
||||
#
|
||||
|
@ -36,7 +36,7 @@ module Fog
|
|||
:host => "#{bucket_name}.#{@host}",
|
||||
:idempotent => true,
|
||||
:method => 'GET',
|
||||
:parser => Fog::Parsers::AWS::S3::AccessControlList.new,
|
||||
:parser => Fog::Parsers::AWS::Storage::AccessControlList.new,
|
||||
:query => {'acl' => nil}
|
||||
})
|
||||
end
|
|
@ -1,9 +1,9 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class S3
|
||||
class Storage
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/s3/get_bucket_location'
|
||||
require 'fog/aws/parsers/storage/get_bucket_location'
|
||||
|
||||
# Get location constraint for an S3 bucket
|
||||
#
|
||||
|
@ -21,7 +21,7 @@ module Fog
|
|||
:host => "#{bucket_name}.#{@host}",
|
||||
:idempotent => true,
|
||||
:method => 'GET',
|
||||
:parser => Fog::Parsers::AWS::S3::GetBucketLocation.new,
|
||||
:parser => Fog::Parsers::AWS::Storage::GetBucketLocation.new,
|
||||
:query => {'location' => nil}
|
||||
})
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue