private static void doSampleInsert(string insertMutateQuery, ILogger log, int offsetMinutes) { CommonGraphQLFunctions myGQL = new CommonGraphQLFunctions(log); string result = myGQL.PostGraphQLQuery(myGQL.InjectUTCDateTime(insertMutateQuery, offsetMinutes)); log.LogInformation(result); }
public bool CheckTIQForMembraneIssue() { CommonGraphQLFunctions myGQL = new CommonGraphQLFunctions(_log); ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(myGQL.ValidateCertificate); //Ask ThinkIQ for data about the RO Skid Side A membrane LogToEnvironmentDebug("Getting Membrane Data from ThinkIQ..."); string result = myGQL.PostGraphQLQuery(myGQL.InjectUTCDateTime(attributeQuery)); LogToEnvironmentDebug(result); //Evaluate the response to see if the membrane issue exists if (ParseOutMembraneIssue(result)) { //If the membrane issue DOES exist, toggle it back off (so the Workflow doesn't run again next time) // then return true so the Workflow will run LogToEnvironmentDebug("Canceling Membrane Issue in ThinkIQ..."); myGQL.PostGraphQLQuery(myGQL.InjectUTCDateTime(mutateQuery)); return(true); } else { //If the membrane issue does NOT exist, we have nothing to do // return false so the Workflow will not run return(false); } }
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { log.LogInformation("C# HTTP trigger function processed a request to ForceMembraneIssue."); CommonGraphQLFunctions myGQL = new CommonGraphQLFunctions(log); string result = myGQL.PostGraphQLQuery(myGQL.InjectUTCDateTime(forceMutateQuery)); return((ActionResult) new OkObjectResult(result)); }