Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend REST API by endpoint to get a specific function definition #1149

Merged
merged 2 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public Collection<FunctionDefinition> getAllFunctions() {
return registeredFunctions.values();
}

public FunctionDefinition getFunction (String functionId) {
return registeredFunctions.get(functionId);
}

public void registerFunction(FunctionDefinition function) {
this.registeredFunctions.put(function.getFunctionId().getId(), function);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public Response getActiveFunctions() {
return ok(FunctionRegistrationService.INSTANCE.getAllFunctions());
}

@GET
@Path("{functionId}")
@Produces(MediaType.APPLICATION_JSON)
public Response getFunction(@PathParam("functionId") String functionId) {
return ok(FunctionRegistrationService.INSTANCE.getFunction(functionId));
}

@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Expand Down