use of co.cask.cdap.api.service.http.ServiceHttpEndpoint in project cdap by caskdata.
the class GetServiceEndpointsCommand method perform.
@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
ServiceId serviceId = new ServiceId(parseProgramId(arguments, ElementType.SERVICE));
List<ServiceHttpEndpoint> endpoints = serviceClient.getEndpoints(serviceId);
Table table = Table.builder().setHeader("method", "path").setRows(endpoints, new RowMaker<ServiceHttpEndpoint>() {
@Override
public List<?> makeRow(ServiceHttpEndpoint endpoint) {
return Lists.newArrayList(endpoint.getMethod(), endpoint.getPath());
}
}).build();
cliConfig.getTableRenderer().render(cliConfig, output, table);
}
use of co.cask.cdap.api.service.http.ServiceHttpEndpoint in project cdap by caskdata.
the class ServiceClientTestRun method testGetEndpoints.
@Test
public void testGetEndpoints() throws Exception {
List<ServiceHttpEndpoint> endpoints = serviceClient.getEndpoints(service);
assertEquals(1, endpoints.size());
ServiceHttpEndpoint endpoint = endpoints.get(0);
assertEquals("GET", endpoint.getMethod());
assertEquals("/ping", endpoint.getPath());
}
Aggregations