mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge branch 'master' of github.com:fog/fog into file_docs
This commit is contained in:
commit
ae1970edaf
27 changed files with 81 additions and 215 deletions
|
@ -45,7 +45,7 @@ Gem::Specification.new do |s|
|
|||
s.add_dependency('formatador', '~>0.2.0')
|
||||
s.add_dependency('multi_json', '~>1.0')
|
||||
s.add_dependency('mime-types')
|
||||
s.add_dependency('net-scp', '~>1.0.4')
|
||||
s.add_dependency('net-scp', '~>1.1')
|
||||
s.add_dependency('net-ssh', '>=2.1.3')
|
||||
s.add_dependency('nokogiri', '~>1.5.0')
|
||||
s.add_dependency('ruby-hmac')
|
||||
|
|
|
@ -21,6 +21,7 @@ module Fog
|
|||
attribute :availability_zone_group, :aliases => 'availabilityZoneGroup'
|
||||
attribute :product_description, :aliases => 'productDescription'
|
||||
|
||||
attribute :ebs_optimized, :aliases => 'LaunchSpecification.EbsOptimized'
|
||||
attribute :groups, :aliases => 'LaunchSpecification.SecurityGroup'
|
||||
attribute :key_name, :aliases => 'LaunchSpecification.KeyName'
|
||||
attribute :availability_zone, :aliases => 'LaunchSpecification.Placement.AvailabilityZone'
|
||||
|
@ -95,6 +96,7 @@ module Fog
|
|||
'LaunchSpecification.Monitoring.Enabled' => monitoring,
|
||||
'LaunchSpecification.Placement.AvailabilityZone' => availability_zone,
|
||||
'LaunchSpecification.SecurityGroup' => groups,
|
||||
'LaunchSpecification.EbsOptimized' => ebs_optimized,
|
||||
'LaunchSpecification.UserData' => user_data,
|
||||
'LaunchSpecification.SubnetId' => subnet_id,
|
||||
'LaunchSpecification.IamInstanceProfile.Arn' => @iam_instance_profile_arn,
|
||||
|
|
|
@ -52,6 +52,8 @@ module Fog
|
|||
end
|
||||
when 'imageId', 'instanceType', 'keyname', 'subnetId'
|
||||
@spot_instance_request['launchSpecification'][name] = value
|
||||
when 'ebsOptimized'
|
||||
@spot_instance_request['launchSpecification'][name] = value == 'true'
|
||||
when 'enabled'
|
||||
@spot_instance_request['launchSpecification']['monitoring'] = (value == 'true')
|
||||
when 'requestId'
|
||||
|
|
|
@ -29,6 +29,7 @@ module Fog
|
|||
# * 'LaunchSpecification.SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances, not supported in VPC
|
||||
# * 'LaunchSpecification.SecurityGroupId'<~Array> or <~String> - Id of security group(s) for instances, use this or LaunchSpecification.SecurityGroup
|
||||
# * 'LaunchSpecification.UserData'<~String> - Additional data to provide to booting instances
|
||||
# * 'LaunchSpecification.EbsOptimized'<~Boolean> - Whether the instance is optimized for EBS I/O
|
||||
# * 'Type'<~String> - spot instance request type in ['one-time', 'persistent']
|
||||
# * 'ValidFrom'<~Time> - start date for request
|
||||
# * 'ValidUntil'<~Time> - end date for request
|
||||
|
|
|
@ -41,6 +41,8 @@ module Fog
|
|||
data = service.power_off(self.id).body
|
||||
wait_for { off? }
|
||||
end
|
||||
#Failsafe .. Always check if we are ready
|
||||
wait_for { ready? }
|
||||
service.delete_vapp(self.id)
|
||||
true
|
||||
end
|
||||
|
@ -60,13 +62,13 @@ module Fog
|
|||
def delete_internet_services
|
||||
#Find the internet service
|
||||
|
||||
while (service = internet_services.pop) do
|
||||
while (inet_service = internet_services.pop) do
|
||||
|
||||
nodes = service.nodeservices.all(service.Id)
|
||||
nodes = service.nodeservices.all(inet_service.Id)
|
||||
#Delete all the associated nodes
|
||||
nodes.select { |item| item.destroy }
|
||||
#Clear out the services
|
||||
service.destroy(delete_public_ip = !(internet_services.size > 0))
|
||||
inet_service.destroy(delete_public_ip = !(internet_services.size > 0))
|
||||
end
|
||||
true
|
||||
end
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
module Fog
|
||||
module Terremark
|
||||
module Shared
|
||||
module Parser
|
||||
|
||||
remove_method :parse
|
||||
def parse(data)
|
||||
case data['type']
|
||||
when 'application/vnd.vmware.vcloud.vApp+xml'
|
||||
servers.new(data.merge!(:service => self))
|
||||
else
|
||||
data
|
||||
end
|
||||
class TerremarkParser < Fog::Parsers::Base
|
||||
|
||||
def extract_attributes(attributes_xml)
|
||||
attributes = {}
|
||||
until attributes_xml.empty?
|
||||
if attributes_xml.first.is_a?(Array)
|
||||
until attributes_xml.first.empty?
|
||||
attribute = attributes_xml.first.shift
|
||||
attributes[attribute.localname] = attribute.value
|
||||
end
|
||||
|
||||
else
|
||||
attribute = attributes_xml.shift
|
||||
attributes[attribute.localname] = attribute.value
|
||||
end
|
||||
end
|
||||
attributes
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetCatalog < Fog::Parsers::Base
|
||||
class GetCatalog < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = { 'CatalogItems' => [] }
|
||||
|
@ -13,26 +13,12 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'CatalogItem'
|
||||
catalog_item = {}
|
||||
attributes.each do |attrib|
|
||||
i = 0
|
||||
while i < attrib.size
|
||||
catalog_item[attrib[i]] = attrib[i+1]
|
||||
i += 2
|
||||
end
|
||||
catalog_item["id"] = catalog_item["href"].split('/').last
|
||||
end
|
||||
catalog_item = extract_attributes(attributes)
|
||||
catalog_item["id"] = catalog_item["href"].split('/').last
|
||||
@response['CatalogItems'] << catalog_item
|
||||
|
||||
when 'Catalog'
|
||||
catalog = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
catalog[attribute.first] = attribute.last
|
||||
else
|
||||
catalog[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
catalog = extract_attributes(attributes)
|
||||
@response['name'] = catalog['name']
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetCatalogItem < Fog::Parsers::Base
|
||||
class GetCatalogItem < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = { 'Entity' => {}, 'Properties' => {} }
|
||||
|
@ -13,22 +13,12 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Entity'
|
||||
until attributes.empty?
|
||||
@response['Entity'][attributes.shift] = attributes.shift
|
||||
end
|
||||
@response['Entity'] = extract_attributes(attributes)
|
||||
when 'CatalogItem'
|
||||
catalog_item = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
catalog_item[attribute.first] = attribute.last
|
||||
else
|
||||
catalog_item[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
catalog_item = extract_attributes(attributes)
|
||||
@response['name'] = catalog_item['name']
|
||||
when 'Property'
|
||||
@property_key = attributes.last
|
||||
@property_key = attributes.value
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetInternetServices < Fog::Parsers::Base
|
||||
class GetInternetServices < TerremarkParser
|
||||
|
||||
def reset
|
||||
@in_public_ip_address = false
|
||||
|
|
|
@ -4,8 +4,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetKeysList < Fog::Parsers::Base
|
||||
|
||||
class GetKeysList < TerremarkParser
|
||||
def reset
|
||||
@response = { 'Keys' => [] }
|
||||
@key = {}
|
||||
|
@ -15,25 +14,12 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Id', 'Href', 'Name', 'IsDefault','FingerPrint'
|
||||
data = {}
|
||||
until attributes.empty?
|
||||
data[attributes.shift] = attributes.shift
|
||||
end
|
||||
data = extract_attributes(attributes)
|
||||
@key[name] = data
|
||||
when 'Key'
|
||||
until attributes.empty?
|
||||
@key[attributes.shift] = attributes.shift
|
||||
end
|
||||
@key = extract_attributes(attributes)
|
||||
when 'Keys'
|
||||
keys_list = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
keys_list[attribute.first] = attribute.last
|
||||
else
|
||||
keys_list[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
keys_list = extract_attributes(attributes)
|
||||
@response['href'] = keys_list['href']
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetNetworkIps< Fog::Parsers::Base
|
||||
class GetNetworkIps< TerremarkParser
|
||||
|
||||
def reset
|
||||
@ip_address = {}
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetNodeServices < Fog::Parsers::Base
|
||||
class GetNodeServices < TerremarkParser
|
||||
|
||||
def reset
|
||||
@node_service = {}
|
||||
|
|
|
@ -3,7 +3,8 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetOrganization < Fog::Parsers::Base
|
||||
class GetOrganization < TerremarkParser
|
||||
# include Fog::Terremark::Shared::Parser
|
||||
|
||||
def reset
|
||||
@response = { 'Links' => [] }
|
||||
|
@ -13,7 +14,7 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Link'
|
||||
link = {}
|
||||
link = extract_attributes(attributes)
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
|
@ -24,7 +25,7 @@ module Fog
|
|||
end
|
||||
@response['Links'] << link
|
||||
when 'Org'
|
||||
org = {}
|
||||
org = extract_attributes(attributes)
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
|
|
|
@ -3,7 +3,8 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetOrganizations < Fog::Parsers::Base
|
||||
class GetOrganizations < TerremarkParser
|
||||
# include Fog::Terremark::Shared::Parser
|
||||
|
||||
def reset
|
||||
@response = { 'OrgList' => [] }
|
||||
|
@ -12,7 +13,7 @@ module Fog
|
|||
def start_element(name, attributes)
|
||||
super
|
||||
if name == 'Org'
|
||||
organization = {}
|
||||
organization = extract_attributes(attributes)
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetPublicIps< Fog::Parsers::Base
|
||||
class GetPublicIps< TerremarkParser
|
||||
|
||||
def reset
|
||||
@ip_address = {}
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetTasksList < Fog::Parsers::Base
|
||||
class GetTasksList < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = { 'Tasks' => [] }
|
||||
|
@ -14,25 +14,12 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Owner', 'Result'
|
||||
data = {}
|
||||
until attributes.empty?
|
||||
data[attributes.shift] = attributes.shift
|
||||
end
|
||||
data = extract_templates(attributes)
|
||||
@task[name] = data
|
||||
when 'Task'
|
||||
until attributes.empty?
|
||||
@task[attributes.shift] = attributes.shift
|
||||
end
|
||||
@task = extract_templates(attributes)
|
||||
when 'TasksList'
|
||||
tasks_list = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
tasks_list[attribute.first] = attribute.last
|
||||
else
|
||||
tasks_list[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
tasks_list = extract_templates(attributes)
|
||||
@response['href'] = tasks_list['href']
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetVappTemplate < Fog::Parsers::Base
|
||||
class GetVappTemplate < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = { 'Links' => [] }
|
||||
|
@ -13,21 +13,10 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Link'
|
||||
link = {}
|
||||
until attributes.empty?
|
||||
link[attributes.shift] = attributes.shift
|
||||
end
|
||||
link = extract_attributes(attributes)
|
||||
@response['Links'] << link
|
||||
when 'VAppTemplate'
|
||||
vapp_template = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
vapp_template[attribute.first] = attribute.last
|
||||
else
|
||||
vapp_template[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
vapp_template = extract_attributes(attributes)
|
||||
@response['name'] = vapp_template['name']
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class GetVdc < Fog::Parsers::Base
|
||||
class GetVdc < TerremarkParser
|
||||
|
||||
def reset
|
||||
@in_storage_capacity = false
|
||||
|
@ -11,7 +11,7 @@ module Fog
|
|||
@in_memory = false
|
||||
@in_instantiated_vms_quota = false
|
||||
@in_deployed_vms_quota = false
|
||||
@response = {
|
||||
@response = {
|
||||
'links' => [],
|
||||
'AvailableNetworks' => [],
|
||||
'ComputeCapacity' => {
|
||||
|
@ -35,52 +35,20 @@ module Fog
|
|||
when 'InstantiatedVmsQuota'
|
||||
@in_instantiated_vms_quota = true
|
||||
when 'Link'
|
||||
link = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
link[attribute.first] = attribute.last
|
||||
else
|
||||
link[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
link = extract_attributes(attributes)
|
||||
@response['links'] << link
|
||||
when 'Memory'
|
||||
@in_memory = true
|
||||
when 'Network'
|
||||
network = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
network[attribute.first] = attribute.last
|
||||
else
|
||||
network[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
network = extract_attributes(attributes)
|
||||
@response['AvailableNetworks'] << network
|
||||
when 'ResourceEntity'
|
||||
resource_entity = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
resource_entity[attribute.first] = attribute.last
|
||||
else
|
||||
resource_entity[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
resource_entity = extract_attributes(attributes)
|
||||
@response['ResourceEntities'] << resource_entity
|
||||
when 'StorageCapacity'
|
||||
@in_storage_capacity = true
|
||||
when 'Vdc'
|
||||
vdc = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
vdc[attribute.first] = attribute.last
|
||||
else
|
||||
vdc[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
vdc = extract_attributes(attributes)
|
||||
@response['href'] = vdc['href']
|
||||
@response['name'] = vdc['name']
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class InstantiateVappTemplate < Fog::Parsers::Base
|
||||
class InstantiateVappTemplate < TerremarkParser
|
||||
|
||||
def reset
|
||||
@property_key
|
||||
|
@ -14,21 +14,10 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Link'
|
||||
link = {}
|
||||
until attributes.empty?
|
||||
link[attributes.shift] = attributes.shift
|
||||
end
|
||||
link = extract_attributes(attributes)
|
||||
@response['Links'] << link
|
||||
when 'VApp'
|
||||
vapp_template = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
vapp_template[attribute.first] = attribute.last
|
||||
else
|
||||
vapp_template[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
vapp_template = extract_attributes(attributes)
|
||||
@response.merge!(vapp_template.reject {|key, value| !['href', 'name', 'size', 'status', 'type'].include?(key)})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class InternetService < Fog::Parsers::Base
|
||||
class InternetService < TerremarkParser
|
||||
|
||||
def reset
|
||||
@in_public_ip_address = false
|
||||
|
@ -14,10 +14,7 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Href'
|
||||
data = {}
|
||||
until attributes.empty?
|
||||
data[attributes.shift] = attributes.shift
|
||||
end
|
||||
data = extract_attributes(attributes)
|
||||
if @in_public_ip_address
|
||||
@response['PublicIpAddress'][name] = data
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Network < Fog::Parsers::Base
|
||||
class Network < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = {
|
||||
|
@ -15,12 +15,7 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when "Network"
|
||||
until attributes.empty?
|
||||
val = attributes.shift
|
||||
if val.is_a?(String)
|
||||
@response[val] = attributes.shift
|
||||
end
|
||||
end
|
||||
@response = extract_attributes(attributes)
|
||||
if @response.has_key?("name")
|
||||
@response["subnet"] = @response["name"]
|
||||
end
|
||||
|
@ -28,10 +23,7 @@ module Fog
|
|||
@response["id"] = @response["href"].split("/").last
|
||||
end
|
||||
when "Link"
|
||||
link = {}
|
||||
until attributes.empty?
|
||||
link[attributes.shift] = attributes.shift
|
||||
end
|
||||
link = extract_attributes(attributes)
|
||||
@response["links"] << link
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class NodeService < Fog::Parsers::Base
|
||||
class NodeService < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = {}
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class PublicIp < Fog::Parsers::Base
|
||||
class PublicIp < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = {}
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Task < Fog::Parsers::Base
|
||||
class Task < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = {}
|
||||
|
@ -13,21 +13,10 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Owner', 'Result', 'Link', 'Error'
|
||||
data = {}
|
||||
until attributes.empty?
|
||||
data[attributes.shift] = attributes.shift
|
||||
end
|
||||
data = extract_attributes(attributes)
|
||||
@response[name] = data
|
||||
when 'Task'
|
||||
task = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
task[attribute.first] = attribute.last
|
||||
else
|
||||
task[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
task = extract_attributes(attributes)
|
||||
@response.merge!(task.reject {|key,value| !['endTime', 'href', 'startTime', 'status', 'type'].include?(key)})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
module Terremark
|
||||
module Shared
|
||||
|
||||
class Vapp < Fog::Parsers::Base
|
||||
class Vapp < TerremarkParser
|
||||
|
||||
def reset
|
||||
@response = { 'Links' => [], 'VirtualHardware' => {}, 'OperatingSystem' => {} }
|
||||
|
@ -15,23 +15,12 @@ module Fog
|
|||
super
|
||||
case name
|
||||
when 'Link'
|
||||
link = {}
|
||||
until attributes.empty?
|
||||
link[attributes.shift] = attributes.shift
|
||||
end
|
||||
link = extract_attributes(attributes)
|
||||
@response['Links'] << link
|
||||
when 'OperatingSystemSection'
|
||||
@in_operating_system = true
|
||||
when 'VApp'
|
||||
vapp = {}
|
||||
until attributes.empty?
|
||||
if attributes.first.is_a?(Array)
|
||||
attribute = attributes.shift
|
||||
vapp[attribute.first] = attribute.last
|
||||
else
|
||||
vapp[attributes.shift] = attributes.shift
|
||||
end
|
||||
end
|
||||
vapp = extract_attributes(attributes)
|
||||
@response.merge!(vapp.reject {|key,value| !['href', 'name', 'size', 'status', 'type'].include?(key)})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,6 +12,7 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do
|
|||
'imageId' => String,
|
||||
'instanceType' => String,
|
||||
'monitoring' => Fog::Boolean,
|
||||
'ebsOptimized' => Fog::Boolean,
|
||||
'subnetId' => Fog::Nullable::String,
|
||||
'iamInstanceProfile' => Fog::Nullable::Hash,
|
||||
},
|
||||
|
@ -38,13 +39,13 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do
|
|||
pending if Fog.mocking?
|
||||
|
||||
tests("#request_spot_instances('ami-3202f25b', 't1.micro', '0.001')").formats(@spot_instance_requests_format) do
|
||||
data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001').body
|
||||
data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001',{'LaunchSpecification.EbsOptimized' => false}).body
|
||||
@spot_instance_request_id = data['spotInstanceRequestSet'].first['spotInstanceRequestId']
|
||||
data
|
||||
end
|
||||
|
||||
tests("#describe_spot_instance_requests").formats(@spot_instance_requests_format) do
|
||||
Fog::Compute[:aws].describe_spot_instance_requests.body
|
||||
Fog::Compute[:aws].describe_spot_instance_requests('spot-instance-request-id' => [@spot_instance_request_id]).body
|
||||
end
|
||||
|
||||
tests("#cancel_spot_instance_requests('#{@spot_instance_request_id}')").formats(@cancel_spot_instance_request_format) do
|
||||
|
|
|
@ -110,13 +110,6 @@ Shindo.tests('Fog::Rackspace::Storage | file', ['rackspace']) do
|
|||
@instance.save
|
||||
object_meta_attributes['X-Object-Meta-Foo-Bar']
|
||||
end
|
||||
|
||||
@instance.metadata['foo-bar'] = 'baz'
|
||||
@instance.metadata[:'foo_bar'] = 'bref'
|
||||
tests("should only support one value per metadata key").returns('bref') do
|
||||
@instance.save
|
||||
object_meta_attributes['X-Object-Meta-Foo-Bar']
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue