use of co.cask.cdap.proto.id.ServiceId in project cdap by caskdata.
the class ServiceClientTestRun method stopService.
/**
* Stop the ArgService of the AppReturnsArgs app
*/
private void stopService(ApplicationId app) throws Exception {
ServiceId service = app.service(AppReturnsArgs.SERVICE);
programClient.stop(service);
assertProgramStopped(programClient, service);
}
use of co.cask.cdap.proto.id.ServiceId in project cdap by caskdata.
the class ServiceClientTestRun method startService.
/**
* Start the ArgService of the AppReturnsArgs app
*/
private void startService(ApplicationId app, Map<String, String> propMap) throws Exception {
ServiceId service = app.service(AppReturnsArgs.SERVICE);
programClient.start(service, false, propMap);
assertProgramRunning(programClient, service);
}
use of co.cask.cdap.proto.id.ServiceId in project cdap by caskdata.
the class HttpEndpointPrefixCompleter method complete.
@Override
public int complete(String buffer, int cursor, List<CharSequence> candidates) {
Map<String, String> arguments = ArgumentParser.getArguments(buffer, PATTERN);
ProgramIdArgument programIdArgument = ArgumentParser.parseProgramId(arguments.get(SERVICE_ID));
if (programIdArgument != null) {
ServiceId service;
if (arguments.get(APP_VERSION) == null) {
service = cliConfig.getCurrentNamespace().app(programIdArgument.getAppId()).service(programIdArgument.getProgramId());
} else {
service = cliConfig.getCurrentNamespace().app(programIdArgument.getAppId(), arguments.get(APP_VERSION)).service(programIdArgument.getProgramId());
}
completer.setEndpoints(getEndpoints(service, arguments.get(METHOD)));
} else {
completer.setEndpoints(Collections.<String>emptyList());
}
return super.complete(buffer, cursor, candidates);
}
use of co.cask.cdap.proto.id.ServiceId in project cdap by caskdata.
the class HttpMethodPrefixCompleter method complete.
@Override
public int complete(String buffer, int cursor, List<CharSequence> candidates) {
Map<String, String> arguments = ArgumentParser.getArguments(buffer, PATTERN);
ProgramIdArgument programIdArgument = ArgumentParser.parseProgramId(arguments.get(SERVICE_ID));
if (programIdArgument != null) {
ServiceId service;
if (arguments.get(APP_VERSION) == null) {
service = cliConfig.getCurrentNamespace().app(programIdArgument.getAppId()).service(programIdArgument.getProgramId());
} else {
service = cliConfig.getCurrentNamespace().app(programIdArgument.getAppId(), arguments.get(APP_VERSION)).service(programIdArgument.getProgramId());
}
completer.setEndpoints(getMethods(service));
} else {
completer.setEndpoints(Collections.<String>emptyList());
}
return super.complete(buffer, cursor, candidates);
}
use of co.cask.cdap.proto.id.ServiceId in project cdap by caskdata.
the class CLIMainTest method testRuntimeArgs.
@Test
public void testRuntimeArgs() throws Exception {
String qualifiedServiceId = String.format("%s.%s", FakeApp.NAME, PrefixedEchoHandler.NAME);
ServiceId service = NamespaceId.DEFAULT.app(FakeApp.NAME).service(PrefixedEchoHandler.NAME);
testServiceRuntimeArgs(qualifiedServiceId, service);
}
Aggregations