Im trying to follow up this tutorial:
The plugin is functional. But when Im trying to apply to call it from postman i get a 404
Im not sure how to call to the endpoint, from the example is:
http://localhost:8080/identityiq/plugin/rest/PluginExample/getExample —> 404
When I call http://localhost:8080/identityiq/plugin -->202 with exception in tomcat “NullPoint”
so I can make get the respond I just need to know the endpoint
===
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.AntPathMatcher;
import sailpoint.object.*;
import sailpoint.api.*;
import sailpoint.rest.plugin.BasePluginResource;
import sailpoint.rest.plugin.RequiredRight;
import sailpoint.tools.GeneralException;
/**
*
* Class to manage all rest api calls.
*/
@Path("PluginExample")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RequiredRight("examplePluginRight")
public class ExamplePluginRestManager extends BasePluginResource {
private static final Log log = LogFactory.getLog(ExamplePluginRestManager.class);
private Response response;
public String getPluginName() {
return "Example Plugin";
}
@GET
@Path("getExample")
public Response getExample() throws GeneralException, SQLException {
log.trace("Entering getExample...");
SailPointContext context = SailPointFactory.getCurrentContext();
// QueryOptions qo = new QueryOptions();
// Filter filter = Filter.eq("name", "Adam.Kennedy");
// qo.addFilter(filter);
// int count = context.countObjects(Identity.class, qo);
//
// String responseString = "How many Adams? " + count;
String responseString = "It worked";
response = Response.status(Response.Status.OK).entity(responseString).build();
log.trace("Exiting getExample...");
log.trace("====response with metadata:: ====" + response.getMetadata());
return response;
}
}
When i try the entire endpoint:
http://localhost:8080/identityiq/plugin/rest/PluginExample/getExample
here is the code
PluginExample.zip (30.1 KB)
Thanks in advance