private AventusTelemetry Get(MediaServicesAccountConfig accountConfig, string id)
        {
            var chid = string.Format("nb:chid:UUID:{0}", id);
            AventusTelemetry telemetry = null;

            var context = accountConfig.GetContext();
            var channel = context.Channels.Where(ch => ch.Id == chid).FirstOrDefault();

            if (channel == null)
            {
                throw new HttpResponseException(System.Net.HttpStatusCode.NotFound);
            }

            if (channel.EncodingType != ChannelEncodingType.None)
            {
                var aventusHelper = new AventusHelper(accountConfig);
                telemetry = aventusHelper.GetTelemetryInfo(channel);
            }
            return(telemetry);
        }
Exemplo n.º 2
0
        private IActionResult Get(MediaServicesAccountConfig accountConfig, string id)
        {
            var chid = string.Format("nb:chid:UUID:{0}", id);
            AventusTelemetry telemetry = null;

            var context = accountConfig.GetContext();
            var channel = context.Channels.Where(ch => ch.Id == chid).FirstOrDefault();

            if (channel == null)
            {
                return(NotFound());
            }

            if (channel.EncodingType != ChannelEncodingType.None)
            {
                var aventusHelper = new AventusHelper(accountConfig);
                telemetry = aventusHelper.GetTelemetryInfo(channel);
            }
            return(Ok(telemetry));
        }