Ejemplo n.º 1
0
        private static void Reserve(AssetInventoryContext entities, string hostName, string platformUsage, DateTime lastUpdated, string sessionId, DataEnvironment environment)
        {
            FrameworkClient vmReservation = Select(entities, hostName);

            vmReservation.UsageState    = EnumUtil.GetDescription(VMUsageState.Reserved);
            vmReservation.PlatformUsage = platformUsage;
            vmReservation.LastUpdated   = lastUpdated;
            vmReservation.SessionId     = sessionId;
            vmReservation.Environment   = environment.ToString();
        }
Ejemplo n.º 2
0
        private static void SetEnvironment(string hostName, DataEnvironment environment, AssetInventoryContext entities)
        {
            FrameworkClient machine = Select(entities, hostName);

            if (machine != null)
            {
                machine.Environment = environment.ToString();
            }
            else
            {
                TraceFactory.Logger.Error("{0} not found in database".FormatWith(hostName));
            }
        }