Ejemplo n.º 1
0
        public static async Task <IActionResult> DataQcResult(
            [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");
                int              id             = Common.Helpers.Common.GetIntFromWebQuery(req, "id");
                DataQC           qc             = new DataQC(storageAccount);
                DataQCParameters qcParms        = new DataQCParameters();
                qcParms.DataConnector = source;
                List <QcResult> qcResults = new List <QcResult>();
                jsonResult = await qc.GetQCFailures(source, id);
            }
            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));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <string> > GetFailures(string source, int id)
        {
            string result = "[]";

            try
            {
                string tmpConnString = Request.Headers["AzureStorageConnection"];
                DataQC qc            = new DataQC(tmpConnString);
                result = await qc.GetQCFailures(source, id);
            }
            catch (Exception)
            {
                return(BadRequest());
            }
            return(result);
        }