private List <MachineDTO> GetAllMachines(string clusterName) { var cluster = SecurityAccess.Projects .SingleOrDefault(x => x.Name == ProjectName).Applications .SingleOrDefault(x => x.Name == ApplicationName).Clusters .SingleOrDefault(x => x.Name == clusterName); if (clusterName == null) { return(new List <MachineDTO>()); } if (!this.HasAccess(clusterName)) { return(new List <MachineDTO>()); } var pandora = new Pandora(box); var machines = new List <MachineDTO>(); foreach (var machine in box.Machines) { machines.Add(new MachineDTO(machine.Name, cluster, pandora.Open(new PandoraOptions(clusterName, machine.Name, true)).AsDictionary())); } return(machines); }
private List<MachineDTO> GetAllMachines(string clusterName) { var cluster = SecurityAccess.Projects .SingleOrDefault(x => x.Name == ProjectName).Applications .SingleOrDefault(x => x.Name == ApplicationName).Clusters .SingleOrDefault(x => x.Name == clusterName); if (clusterName == null) return new List<MachineDTO>(); if (!this.HasAccess(clusterName)) return new List<MachineDTO>(); var pandora = new Pandora(box); var machines = new List<MachineDTO>(); foreach (var machine in box.Machines) { machines.Add(new MachineDTO(machine.Name, cluster, pandora.Open(new PandoraOptions(clusterName, machine.Name, true)).AsDictionary())); } return machines; }