lib/fog/oraclecloud/requests/compute/create_instance.rb in fog-oraclecloud-0.1.1 vs lib/fog/oraclecloud/requests/compute/create_instance.rb in fog-oraclecloud-0.1.2
- old
+ new
@@ -25,8 +25,29 @@
'Content-Type' => 'application/oracle-compute-v3+json'
}
)
end
end
+
+ class Mock
+ def create_instance (name, shape, imagelist, label, sshkeys)
+ response = Excon::Response.new
+ name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
+
+ self.data[:instances][name] = {
+ 'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}",
+ 'shape' => shape,
+ 'imagelist' => imagelist,
+ 'label' => label,
+ 'sshkeys' => sshkeys,
+ 'state' => 'running'
+ }
+ response.status = 201
+ response.body = {
+ 'instances' => [self.data[:instances][name]]
+ }
+ response
+ end
+ end
end
end
end