コード例 #1
0
        public void CreateOrUpdateServerSideDefinition(MeterDefinitionServerBased definition)
        {
            // get the entity
            var entity = AzureTableMeterDefinitionServerBased.FromModel(definition);

            // merge
            InsertOrMerge(entity, "MeterDefinitionServerBased");
        }
コード例 #2
0
        public ActionResult Add()
        {
            // create the model
            var meterDefinition = new MeterDefinitionServerBased()
            {
                MeterId                     = Guid.NewGuid().ToString(),
                MeterType                   = client.Models.nMeterTypes.Heartbeat,
                MeterServerCheckType        = "HTTP",
                MeterServerCheckInformation = String.Empty
            };

            return(View("Add", meterDefinition));
        }
コード例 #3
0
        public ActionResult Add(MeterDefinitionServerBased model)
        {
            // instantiate the meter manager
            var meterManagerEx = initializeMeterManager();

            // store the meterdefinition to the settings
            meterManagerEx.CreateOrUpdateServerSideDefinition(model);

            // trigger the webjib
            AzureWebJobShutdownService.Peek();

            // Render the meters
            return(RedirectToAction("Index"));
        }
コード例 #4
0
 public static AzureTableMeterDefinitionServerBased FromModel(MeterDefinitionServerBased model)
 {
     return(new AzureTableMeterDefinitionServerBased(model.MeterId, model.MeterServerCheckType)
     {
         MeterId = model.MeterId,
         MeterName = model.MeterName,
         MeterCategory = model.MeterCategory,
         MeterDisplayOrder = model.MeterDisplayOrder,
         MeterType = Convert.ToDouble(Convert.ToInt32(model.MeterType)),
         MeterValue = Convert.ToDouble(model.MeterValue),
         MeterServerCheckType = model.MeterServerCheckType,
         MeterServerCheckInterval = model.MeterServerCheckInterval,
         MeterServerCheckInformation = model.MeterServerCheckInformation
     });
 }
コード例 #5
0
 public void CreateOrUpdateServerSideDefinition(MeterDefinitionServerBased definition)
 {
     MeterManagerRepository.CreateOrUpdateServerSideDefinition(definition);
 }