Skip to content

Commit

Permalink
feat: Add health check endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-ang committed May 17, 2023
1 parent f47ef55 commit 2b0f00d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main/java/it/gov/pagopa/reporting/Info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package it.gov.pagopa.reporting;

import com.microsoft.azure.functions.*;
import com.microsoft.azure.functions.annotation.AuthorizationLevel;
import com.microsoft.azure.functions.annotation.FunctionName;
import com.microsoft.azure.functions.annotation.HttpTrigger;

import java.util.Optional;
import java.util.logging.Level;


/**
* Azure Functions with Azure Http trigger.
*/
public class Info {

/**
* This function will be invoked when a Http Trigger occurs
* @return
*/
@FunctionName("Info")
public HttpResponseMessage run (
@HttpTrigger(name = "InfoTrigger",
methods = {HttpMethod.GET},
route = "info",
authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<String>> request,
final ExecutionContext context) {

context.getLogger().log(Level.INFO, "Invoked health check HTTP trigger for pagopa-gpd-reporting-batchß.");
return request.createResponseBuilder(HttpStatus.OK)
.header("Content-Type", "application/json")
.build();
}
}

0 comments on commit 2b0f00d

Please sign in to comment.