| 
									
										
										
										
											2015-07-02 19:17:25 +03:00
										 |  |  | puts '!!! WARNING: Some EC2 methods are stubbed' | 
					
						
							| 
									
										
										
										
											2014-11-28 16:12:51 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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', | 
					
						
							| 
									
										
										
										
											2015-07-02 19:17:25 +03:00
										 |  |  |       "cores" => 2, | 
					
						
							| 
									
										
										
										
											2014-11-28 16:12:51 +03:00
										 |  |  |       "ram" => 256, | 
					
						
							| 
									
										
										
										
											2015-07-02 19:17:25 +03:00
										 |  |  |       "disk" => 1000, | 
					
						
							|  |  |  |       "name" => 'name' | 
					
						
							| 
									
										
										
										
											2014-11-28 16:12:51 +03:00
										 |  |  |     }] | 
					
						
							|  |  |  |   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 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-14 16:51:40 +03:00
										 |  |  |   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 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-28 16:12:51 +03:00
										 |  |  | end |