fluke/devops-service/tests/stubs/providers/ec2.rb
2015-07-14 17:51:40 +04:00

73 lines
1.3 KiB
Ruby

puts '!!! WARNING: Some EC2 methods are stubbed'
class Provider::Ec2
def groups filter=nil
{
'test' => {
'description' => 'Description',
'rules' => [{
"protocol" => "ip_protocol",
"from" => "from_port",
"to" => "to_port",
"cidr" => "cidr"
}]
},
'default' => {
'description' => 'Description',
'rules' => [{
"protocol" => "ip_protocol",
"from" => "from_port",
"to" => "to_port",
"cidr" => "cidr"
}]
}
}
end
def flavors
[{
"id" => 'test_flavor',
"cores" => 2,
"ram" => 256,
"disk" => 1000,
"name" => 'name'
}]
end
def images filters
[
{
"id" => 'test_image_ec2',
"name" => 'test image',
"status" => 'test status'
}
]
end
def networks
networks_detail
end
def networks_detail
[
{
'cidr' => '192.0.2.32/27',
'vpcId' => 'test_network_id',
'subnetId' => 'test_network_id',
'name' => 'test_network_id',
'zone' => 'test_zone'
}
]
end
def create_stack(stack)
'arn:aws:cloudformation:us-east-1:123456789:stack/MyStack/aaf549a0-a413-11df-adb3-5081b3858e83'
end
def delete_stack(stack)
true
end
end