Пример #1
0
        public IActionResult AddTimeSeries([FromBody] TimeSeriesMetadataModel timeSeriesModel)
        {
            Task <TimeSeriesMetadata> t = _timeSeriesMetadataService.AddTimeseriesMetadata(timeSeriesModel.Name, timeSeriesModel.Description, UserId);

            _timeSeriesService.AddRandomTimeSeries(t.Result.InfluxId.ToString());
            return(Ok(new TimeSeriesMetadataModel(t.Result)));
        }
Пример #2
0
        public IActionResult UpdateTimeSeriesMetadata([FromRoute] string timeSeriesMetadataId, [FromBody] TimeSeriesMetadataModel model)
        {
            TimeSeriesMetadata timeSeriesMetadata = _timeSeriesMetadataService.GetTimeSeriesMetadata(timeSeriesMetadataId);

            if (timeSeriesMetadata == null || !timeSeriesMetadata.UserId.ToString().Equals(UserId))
            {
                return(NotFound("this user does not have this timeseries"));
            }
            _timeSeriesMetadataService.UpdateTimeSeriesMetadata(timeSeriesMetadataId, model.Name, model.Description).Wait();
            return(Ok("ok"));
        }