fluke/devops-service/tests/stubs/providers/openstack.rb

82 lines
1.4 KiB
Ruby
Raw Normal View History

2015-07-02 19:17:25 +03:00
puts '!!! WARNING: Some Openstack methods are stubbed'
2014-11-27 18:45:35 +03:00
class Provider::Openstack
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',
"v_cpus" => 2,
"ram" => 256,
"disk" => 1000
}]
end
def images filters
[
{
"id" => 'test_image',
"name" => 'test image',
"status" => 'test status'
}
]
end
def networks
networks_detail
end
def networks_detail
[
{
'cidr' => '192.0.2.32/27',
'name' => 'test_network',
'id' => 'test_network_id'
2015-07-06 17:00:45 +03:00
},
{
'cidr' => '192.0.2.32/27',
'name' => 'private',
'id' => 'private_id'
2014-11-27 18:45:35 +03:00
}
]
end
def create_stack(stack)
'4c712026-dcd5-4664-90b8-0915494c1332'
end
def delete_stack(stack)
true
end
def stack_details
{stack_status: 'stubbed'}
end
def stack_resources
['stubbed']
end
2014-11-27 18:45:35 +03:00
end