Exemple #1
0
        private Model.Infrastructure.Service CheckJob(Job job, string zoneId = null)
        {
            if (job == null)
            {
                throw new ArgumentException("Job cannot be null.");
            }

            if (StringUtils.IsEmpty(job.Name))
            {
                throw new ArgumentException("Job name must be specified.");
            }

            Model.Infrastructure.Service service = ZoneUtils.GetService(
                EnvironmentUtils.GetTargetZone(registrationService.CurrentEnvironment, zoneId),
                job.Name + "s",
                ServiceType.FUNCTIONAL);

            if (service == null)
            {
                throw new ArgumentException(
                          $"A FUNCTIONAL service with the name {job.Name}s cannot be found in the current environment");
            }

            return(service);
        }