예제 #1
0
        public static async Task <IActionResult> DataQcResults(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("GetDataQcResults: Starting.");
            string jsonResult = "OK";

            try
            {
                string           storageAccount = Common.Helpers.Common.GetStorageKey(req);
                string           source         = Common.Helpers.Common.GetQueryString(req, "name");
                DataQC           qc             = new DataQC(storageAccount);
                DataQCParameters qcParms        = new DataQCParameters();
                qcParms.DataConnector = source;
                List <QcResult> qcResults = new List <QcResult>();
                qcResults = await qc.GetQCRules(qcParms);

                jsonResult = JsonConvert.SerializeObject(qcResults, Formatting.Indented);
            }
            catch (Exception ex)
            {
                log.LogError($"GetDataQcResults: Error getting QCResults: {ex}");
                return(new BadRequestObjectResult($"Error getting QCResults: {ex}"));
            }

            log.LogInformation("GetDataQcResults: Complete.");
            return(new OkObjectResult(jsonResult));
        }
예제 #2
0
        public static async Task <List <QcResult> > InitDataQC([ActivityTrigger] DataOpParameters pipe, ILogger log)
        {
            log.LogInformation($"InitDataQC: Starting");
            DataQC           qc      = new DataQC(pipe.StorageAccount);
            DataQCParameters qcParms = JObject.Parse(pipe.JsonParameters).ToObject <DataQCParameters>();
            List <QcResult>  qcList  = await qc.GetQCRules(qcParms);

            log.LogInformation($"InitDataQC: Number of QC rules are {qcList.Count}");
            await qc.ClearQCFlags(qcParms.DataConnector);

            log.LogInformation($"InitDataQC: Complete");
            return(qcList);
        }