Ejemplo n.º 1
0
        public ActionResult RunInstance(Instance instance)
        {
            try
            {
                ApRunInstancesRequest request = new ApRunInstancesRequest(Credentials);
                request.ImageId = instance.ImageId;
                request.InstanceType = instance.Type;
                request.NoOfInstances = 1;
                ApRunInstancesResponse response = EndPoints.ApDashboardService.RunInstances(request);
                Reservation reservation = response.Reservation;

                if ((reservation != null) && ((reservation.Instances == null) || (reservation.Instances.Count < 1)))
                    return View("Reservation", reservation);
                else
                    return RedirectToAction("Instances");
            }
            catch (Exception e)
            {
                return ShowError(e);
            }
        }
Ejemplo n.º 2
0
 //
 // GET: /applicationgrid/runinstance/{imageId}
 public ActionResult RunInstance(string imageId)
 {
     try
     {
         Instance instance = new Instance();
         instance.ImageId = imageId;
         ViewData["ImageName"] = FindImageName(DescribeImages(), instance.ImageId);
         return View(instance);
     }
     catch (Exception e)
     {
         return ShowError(e);
     }
 }