@Test public void testConfigureAnalysis() throws Exception { initNetwork(); String questionName = "q1"; String analysisName = "analysis"; String analysisJsonString = String.format("{\"%s\":{\"question\":\"questionContent\"}}", questionName); File analysisFile = _networksFolder.newFile("analysis"); FileUtils.writeStringToFile(analysisFile, analysisJsonString, StandardCharsets.UTF_8); _service.configureAnalysis( CoordConsts.DEFAULT_API_KEY, BatfishVersion.getVersionStatic(), _networkName, "new", analysisName, new FileInputStream(analysisFile), "", null); AnalysisId analysisId = idm().getAnalysisId(analysisName, _networkId).get(); assertTrue(idm().hasQuestionId(questionName, _networkId, analysisId)); String questionsToDelete = String.format("[%s]", questionName); _service.configureAnalysis( CoordConsts.DEFAULT_API_KEY, BatfishVersion.getVersionStatic(), _networkName, "", analysisName, null, questionsToDelete, null); assertFalse(idm().hasQuestionId(questionName, _networkId, analysisId)); JSONArray result = _service.configureAnalysis( CoordConsts.DEFAULT_API_KEY, BatfishVersion.getVersionStatic(), _networkName, "", "analysis", null, questionsToDelete, null); assertThat(result.getString(0), equalTo(CoordConsts.SVC_KEY_FAILURE)); }
@POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public JSONArray configureAnalysis( @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr, @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName, @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream, @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions, @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested) { try { _logger.infof( "WMS:configureAnalysis %s %s %s %s %s\n", apiKey, networkName, newAnalysisStr, analysisName, delQuestions); checkStringParam(apiKey, "API key"); checkStringParam(clientVersion, "Client version"); checkStringParam(networkName, "Network name"); checkStringParam(analysisName, "Analysis name"); checkApiKeyValidity(apiKey); checkNetworkAccessibility(apiKey, networkName); Map<String, String> questionsToAdd = new HashMap<>(); if (addQuestionsStream != null) { Map<String, Object> streamValue; try { streamValue = BatfishObjectMapper.mapper() .readValue(addQuestionsStream, new TypeReference<Map<String, Object>>() {}); for (Entry<String, Object> entry : streamValue.entrySet()) { String textValue = BatfishObjectMapper.writeString(entry.getValue()); questionsToAdd.put(entry.getKey(), textValue); } } catch (IOException e) { throw new BatfishException("Failed to read question JSON from input stream", e); } } boolean newAnalysis = !Strings.isNullOrEmpty(newAnalysisStr); List<String> questionsToDelete = new ArrayList<>(); if (!Strings.isNullOrEmpty(delQuestions)) { JSONArray delQuestionsArray = new JSONArray(delQuestions); for (int i = 0; i < delQuestionsArray.length(); i++) { questionsToDelete.add(delQuestionsArray.getString(i)); } } Main.getWorkMgr() .configureAnalysis( networkName, newAnalysis, analysisName, questionsToAdd, questionsToDelete, suggested); return successResponse(new JSONObject().put("result", "successfully configured analysis")); } catch (IllegalArgumentException | AccessControlException | IOException e) { _logger.errorf("WMS:configureAnalysis exception: %s\n", e.getMessage()); return failureResponse(e.getMessage()); } catch (Exception e) { String stackTrace = Throwables.getStackTraceAsString(e); _logger.errorf( "WMS:configureAnalysis exception for apikey:%s in network:%s; exception:%s", apiKey, networkName, stackTrace); return failureResponse(e.getMessage()); } }
WorkMgrService { @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public JSONArray configureAnalysis( @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr, @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName, @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream, @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions, @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested) { try { _logger.infof( "WMS:configureAnalysis %s %s %s %s %s\n", apiKey, networkName, newAnalysisStr, analysisName, delQuestions); checkStringParam(apiKey, "API key"); checkStringParam(clientVersion, "Client version"); checkStringParam(networkName, "Network name"); checkStringParam(analysisName, "Analysis name"); checkApiKeyValidity(apiKey); checkNetworkAccessibility(apiKey, networkName); Map<String, String> questionsToAdd = new HashMap<>(); if (addQuestionsStream != null) { Map<String, Object> streamValue; try { streamValue = BatfishObjectMapper.mapper() .readValue(addQuestionsStream, new TypeReference<Map<String, Object>>() {}); for (Entry<String, Object> entry : streamValue.entrySet()) { String textValue = BatfishObjectMapper.writeString(entry.getValue()); questionsToAdd.put(entry.getKey(), textValue); } } catch (IOException e) { throw new BatfishException("Failed to read question JSON from input stream", e); } } boolean newAnalysis = !Strings.isNullOrEmpty(newAnalysisStr); List<String> questionsToDelete = new ArrayList<>(); if (!Strings.isNullOrEmpty(delQuestions)) { JSONArray delQuestionsArray = new JSONArray(delQuestions); for (int i = 0; i < delQuestionsArray.length(); i++) { questionsToDelete.add(delQuestionsArray.getString(i)); } } Main.getWorkMgr() .configureAnalysis( networkName, newAnalysis, analysisName, questionsToAdd, questionsToDelete, suggested); return successResponse(new JSONObject().put("result", "successfully configured analysis")); } catch (IllegalArgumentException | AccessControlException | IOException e) { _logger.errorf("WMS:configureAnalysis exception: %s\n", e.getMessage()); return failureResponse(e.getMessage()); } catch (Exception e) { String stackTrace = Throwables.getStackTraceAsString(e); _logger.errorf( "WMS:configureAnalysis exception for apikey:%s in network:%s; exception:%s", apiKey, networkName, stackTrace); return failureResponse(e.getMessage()); } } }
WorkMgrService { @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public JSONArray configureAnalysis( @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr, @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName, @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream, @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions, @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested) { try { _logger.infof( "WMS:configureAnalysis %s %s %s %s %s\n", apiKey, networkName, newAnalysisStr, analysisName, delQuestions); checkStringParam(apiKey, "API key"); checkStringParam(clientVersion, "Client version"); checkStringParam(networkName, "Network name"); checkStringParam(analysisName, "Analysis name"); checkApiKeyValidity(apiKey); checkNetworkAccessibility(apiKey, networkName); Map<String, String> questionsToAdd = new HashMap<>(); if (addQuestionsStream != null) { Map<String, Object> streamValue; try { streamValue = BatfishObjectMapper.mapper() .readValue(addQuestionsStream, new TypeReference<Map<String, Object>>() {}); for (Entry<String, Object> entry : streamValue.entrySet()) { String textValue = BatfishObjectMapper.writeString(entry.getValue()); questionsToAdd.put(entry.getKey(), textValue); } } catch (IOException e) { throw new BatfishException("Failed to read question JSON from input stream", e); } } boolean newAnalysis = !Strings.isNullOrEmpty(newAnalysisStr); List<String> questionsToDelete = new ArrayList<>(); if (!Strings.isNullOrEmpty(delQuestions)) { JSONArray delQuestionsArray = new JSONArray(delQuestions); for (int i = 0; i < delQuestionsArray.length(); i++) { questionsToDelete.add(delQuestionsArray.getString(i)); } } Main.getWorkMgr() .configureAnalysis( networkName, newAnalysis, analysisName, questionsToAdd, questionsToDelete, suggested); return successResponse(new JSONObject().put("result", "successfully configured analysis")); } catch (IllegalArgumentException | AccessControlException | IOException e) { _logger.errorf("WMS:configureAnalysis exception: %s\n", e.getMessage()); return failureResponse(e.getMessage()); } catch (Exception e) { String stackTrace = Throwables.getStackTraceAsString(e); _logger.errorf( "WMS:configureAnalysis exception for apikey:%s in network:%s; exception:%s", apiKey, networkName, stackTrace); return failureResponse(e.getMessage()); } }  }
WorkMgrService { @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public JSONArray configureAnalysis( @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr, @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName, @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream, @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions, @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested) { try { _logger.infof( "WMS:configureAnalysis %s %s %s %s %s\n", apiKey, networkName, newAnalysisStr, analysisName, delQuestions); checkStringParam(apiKey, "API key"); checkStringParam(clientVersion, "Client version"); checkStringParam(networkName, "Network name"); checkStringParam(analysisName, "Analysis name"); checkApiKeyValidity(apiKey); checkNetworkAccessibility(apiKey, networkName); Map<String, String> questionsToAdd = new HashMap<>(); if (addQuestionsStream != null) { Map<String, Object> streamValue; try { streamValue = BatfishObjectMapper.mapper() .readValue(addQuestionsStream, new TypeReference<Map<String, Object>>() {}); for (Entry<String, Object> entry : streamValue.entrySet()) { String textValue = BatfishObjectMapper.writeString(entry.getValue()); questionsToAdd.put(entry.getKey(), textValue); } } catch (IOException e) { throw new BatfishException("Failed to read question JSON from input stream", e); } } boolean newAnalysis = !Strings.isNullOrEmpty(newAnalysisStr); List<String> questionsToDelete = new ArrayList<>(); if (!Strings.isNullOrEmpty(delQuestions)) { JSONArray delQuestionsArray = new JSONArray(delQuestions); for (int i = 0; i < delQuestionsArray.length(); i++) { questionsToDelete.add(delQuestionsArray.getString(i)); } } Main.getWorkMgr() .configureAnalysis( networkName, newAnalysis, analysisName, questionsToAdd, questionsToDelete, suggested); return successResponse(new JSONObject().put("result", "successfully configured analysis")); } catch (IllegalArgumentException | AccessControlException | IOException e) { _logger.errorf("WMS:configureAnalysis exception: %s\n", e.getMessage()); return failureResponse(e.getMessage()); } catch (Exception e) { String stackTrace = Throwables.getStackTraceAsString(e); _logger.errorf( "WMS:configureAnalysis exception for apikey:%s in network:%s; exception:%s", apiKey, networkName, stackTrace); return failureResponse(e.getMessage()); } }  @POST @Path(CoordConsts.SVC_RSC_AUTO_COMPLETE) @Produces(MediaType.APPLICATION_JSON) JSONArray autoComplete(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      /* Optional: not needed for some completions */
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_COMPLETION_TYPE) String completionType,
      @FormDataParam(CoordConsts.SVC_KEY_QUERY) String query,
      /* Optional */
      @FormDataParam(CoordConsts.SVC_KEY_MAX_SUGGESTIONS) String maxSuggestions); @POST @Path(CoordConsts.SVC_RSC_CHECK_API_KEY) @Produces(MediaType.APPLICATION_JSON) JSONArray checkApiKey(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion); @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) JSONArray configureAnalysis(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream,
      @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested); @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_QUESTION_TEMPLATE) @Produces(MediaType.APPLICATION_JSON) JSONArray configureQuestionTemplate(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION) String questionTemplate,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_EXCEPTIONS) String exceptions,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_ASSERTION) String assertion); @POST @Path(CoordConsts.SVC_RSC_DEL_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray delAnalysis(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName); @POST @Path(CoordConsts.SVC_RSC_DEL_NETWORK) @Produces(MediaType.APPLICATION_JSON) JSONArray delNetwork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName); @POST @Path(CoordConsts.SVC_RSC_DEL_QUESTION) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray delQuestion(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName); @POST @Path(CoordConsts.SVC_RSC_DEL_SNAPSHOT) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray delSnapshot(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWER) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswer(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWERS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswers(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWERS_METRICS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswersMetrics(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_QUESTIONS)
          String analysisQuestionsStr /* optional */,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWERS_ROWS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswersRows(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_ANSWERS_OPTIONS) String answersRowsOptionsStr,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswer(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER_ROWS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswerRows(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_ANSWERS_OPTIONS) String answerRowsOptionsStr,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER_ROWS2) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswerRows2(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_ANSWERS_OPTIONS) String answerRowsOptionsStr,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER_METRICS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswerMetrics(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysis,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String question,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr); @POST @Path(CoordConsts.SVC_RSC_GET_NETWORK) @Produces(MediaType.APPLICATION_JSON) Response getNetwork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName); @GET @Produces(MediaType.APPLICATION_JSON) JSONArray getInfo(); @POST @Path(CoordConsts.SVC_RSC_GET_QUESTION_TEMPLATES) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray getQuestionTemplates(@FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey); @GET @Path(CoordConsts.SVC_RSC_GETSTATUS) @Produces(MediaType.APPLICATION_JSON) JSONArray getStatus(); @POST @Path(CoordConsts.SVC_RSC_GET_WORKSTATUS) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray getWorkStatus(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_WORKID) String workId); @POST @Path(CoordConsts.SVC_RSC_INIT_NETWORK) @Produces(MediaType.APPLICATION_JSON) JSONArray initNetwork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_PREFIX) String networkPrefix); @POST @Path(CoordConsts.SVC_RSC_KILL_WORK) @Produces(MediaType.APPLICATION_JSON) JSONArray killWork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_WORKID) String workId); @POST @Path(CoordConsts.SVC_RSC_LIST_ANALYSES) @Produces(MediaType.APPLICATION_JSON) JSONArray listAnalyses(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_TYPE) AnalysisType analysisType); @POST @Path(CoordConsts.SVC_RSC_LIST_NETWORKS) @Produces(MediaType.APPLICATION_JSON) JSONArray listNetworks(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion); @POST @Path(CoordConsts.SVC_RSC_LIST_INCOMPLETE_WORK) @Produces(MediaType.APPLICATION_JSON) JSONArray listIncompleteWork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName, /* optional */
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_WORK_TYPE) WorkType workType /* optional */); @POST @Path(CoordConsts.SVC_RSC_LIST_QUESTIONS) @Produces(MediaType.APPLICATION_JSON) JSONArray listQuestions(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_VERBOSE) boolean verbose); @POST @Path(CoordConsts.SVC_RSC_QUEUE_WORK) @Produces(MediaType.APPLICATION_JSON) JSONArray queueWork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr); @GET @Path("test") @Produces(MediaType.TEXT_PLAIN) String test(); @POST @Path(CoordConsts.SVC_RSC_UPLOAD_QUESTION) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) JSONArray uploadQuestion(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String qName,
      @FormDataParam(CoordConsts.SVC_KEY_FILE) String questionJson); @POST @Path(CoordConsts.SVC_RSC_UPLOAD_SNAPSHOT) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) JSONArray uploadSnapshot(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_ZIPFILE) InputStream fileStream,
      @FormDataParam(CoordConsts.SVC_KEY_AUTO_ANALYZE_TESTRIG) String autoAnalyzeTestrigStr,
      @FormDataParam(CoordConsts.SVC_KEY_AUTO_ANALYZE) String autoAnalyzeStr); }
WorkMgrService { @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public JSONArray configureAnalysis( @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr, @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName, @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream, @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions, @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested) { try { _logger.infof( "WMS:configureAnalysis %s %s %s %s %s\n", apiKey, networkName, newAnalysisStr, analysisName, delQuestions); checkStringParam(apiKey, "API key"); checkStringParam(clientVersion, "Client version"); checkStringParam(networkName, "Network name"); checkStringParam(analysisName, "Analysis name"); checkApiKeyValidity(apiKey); checkNetworkAccessibility(apiKey, networkName); Map<String, String> questionsToAdd = new HashMap<>(); if (addQuestionsStream != null) { Map<String, Object> streamValue; try { streamValue = BatfishObjectMapper.mapper() .readValue(addQuestionsStream, new TypeReference<Map<String, Object>>() {}); for (Entry<String, Object> entry : streamValue.entrySet()) { String textValue = BatfishObjectMapper.writeString(entry.getValue()); questionsToAdd.put(entry.getKey(), textValue); } } catch (IOException e) { throw new BatfishException("Failed to read question JSON from input stream", e); } } boolean newAnalysis = !Strings.isNullOrEmpty(newAnalysisStr); List<String> questionsToDelete = new ArrayList<>(); if (!Strings.isNullOrEmpty(delQuestions)) { JSONArray delQuestionsArray = new JSONArray(delQuestions); for (int i = 0; i < delQuestionsArray.length(); i++) { questionsToDelete.add(delQuestionsArray.getString(i)); } } Main.getWorkMgr() .configureAnalysis( networkName, newAnalysis, analysisName, questionsToAdd, questionsToDelete, suggested); return successResponse(new JSONObject().put("result", "successfully configured analysis")); } catch (IllegalArgumentException | AccessControlException | IOException e) { _logger.errorf("WMS:configureAnalysis exception: %s\n", e.getMessage()); return failureResponse(e.getMessage()); } catch (Exception e) { String stackTrace = Throwables.getStackTraceAsString(e); _logger.errorf( "WMS:configureAnalysis exception for apikey:%s in network:%s; exception:%s", apiKey, networkName, stackTrace); return failureResponse(e.getMessage()); } }  @POST @Path(CoordConsts.SVC_RSC_AUTO_COMPLETE) @Produces(MediaType.APPLICATION_JSON) JSONArray autoComplete(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      /* Optional: not needed for some completions */
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_COMPLETION_TYPE) String completionType,
      @FormDataParam(CoordConsts.SVC_KEY_QUERY) String query,
      /* Optional */
      @FormDataParam(CoordConsts.SVC_KEY_MAX_SUGGESTIONS) String maxSuggestions); @POST @Path(CoordConsts.SVC_RSC_CHECK_API_KEY) @Produces(MediaType.APPLICATION_JSON) JSONArray checkApiKey(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion); @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) JSONArray configureAnalysis(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_NEW_ANALYSIS) String newAnalysisStr,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_FILE) InputStream addQuestionsStream,
      @FormDataParam(CoordConsts.SVC_KEY_DEL_ANALYSIS_QUESTIONS) String delQuestions,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_SUGGESTED) Boolean suggested); @POST @Path(CoordConsts.SVC_RSC_CONFIGURE_QUESTION_TEMPLATE) @Produces(MediaType.APPLICATION_JSON) JSONArray configureQuestionTemplate(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION) String questionTemplate,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_EXCEPTIONS) String exceptions,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_ASSERTION) String assertion); @POST @Path(CoordConsts.SVC_RSC_DEL_ANALYSIS) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray delAnalysis(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName); @POST @Path(CoordConsts.SVC_RSC_DEL_NETWORK) @Produces(MediaType.APPLICATION_JSON) JSONArray delNetwork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName); @POST @Path(CoordConsts.SVC_RSC_DEL_QUESTION) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray delQuestion(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName); @POST @Path(CoordConsts.SVC_RSC_DEL_SNAPSHOT) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray delSnapshot(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWER) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswer(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWERS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswers(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWERS_METRICS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswersMetrics(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_QUESTIONS)
          String analysisQuestionsStr /* optional */,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANALYSIS_ANSWERS_ROWS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnalysisAnswersRows(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_ANSWERS_OPTIONS) String answersRowsOptionsStr,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswer(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshot,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER_ROWS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswerRows(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_ANSWERS_OPTIONS) String answerRowsOptionsStr,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER_ROWS2) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswerRows2(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String questionName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysisName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_ANSWERS_OPTIONS) String answerRowsOptionsStr,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr /* optional */); @POST @Path(CoordConsts.SVC_RSC_GET_ANSWER_METRICS) @Produces(MediaType.APPLICATION_JSON) JSONArray getAnswerMetrics(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_REFERENCE_SNAPSHOT_NAME) String referenceSnapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_NAME) String analysis,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String question,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr); @POST @Path(CoordConsts.SVC_RSC_GET_NETWORK) @Produces(MediaType.APPLICATION_JSON) Response getNetwork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName); @GET @Produces(MediaType.APPLICATION_JSON) JSONArray getInfo(); @POST @Path(CoordConsts.SVC_RSC_GET_QUESTION_TEMPLATES) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray getQuestionTemplates(@FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey); @GET @Path(CoordConsts.SVC_RSC_GETSTATUS) @Produces(MediaType.APPLICATION_JSON) JSONArray getStatus(); @POST @Path(CoordConsts.SVC_RSC_GET_WORKSTATUS) @Produces(MediaType.APPLICATION_JSON) @Deprecated JSONArray getWorkStatus(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_WORKID) String workId); @POST @Path(CoordConsts.SVC_RSC_INIT_NETWORK) @Produces(MediaType.APPLICATION_JSON) JSONArray initNetwork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_PREFIX) String networkPrefix); @POST @Path(CoordConsts.SVC_RSC_KILL_WORK) @Produces(MediaType.APPLICATION_JSON) JSONArray killWork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_WORKID) String workId); @POST @Path(CoordConsts.SVC_RSC_LIST_ANALYSES) @Produces(MediaType.APPLICATION_JSON) JSONArray listAnalyses(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_ANALYSIS_TYPE) AnalysisType analysisType); @POST @Path(CoordConsts.SVC_RSC_LIST_NETWORKS) @Produces(MediaType.APPLICATION_JSON) JSONArray listNetworks(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion); @POST @Path(CoordConsts.SVC_RSC_LIST_INCOMPLETE_WORK) @Produces(MediaType.APPLICATION_JSON) JSONArray listIncompleteWork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName, /* optional */
      @Nullable @FormDataParam(CoordConsts.SVC_KEY_WORK_TYPE) WorkType workType /* optional */); @POST @Path(CoordConsts.SVC_RSC_LIST_QUESTIONS) @Produces(MediaType.APPLICATION_JSON) JSONArray listQuestions(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_VERBOSE) boolean verbose); @POST @Path(CoordConsts.SVC_RSC_QUEUE_WORK) @Produces(MediaType.APPLICATION_JSON) JSONArray queueWork(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_WORKITEM) String workItemStr); @GET @Path("test") @Produces(MediaType.TEXT_PLAIN) String test(); @POST @Path(CoordConsts.SVC_RSC_UPLOAD_QUESTION) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) JSONArray uploadQuestion(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_QUESTION_NAME) String qName,
      @FormDataParam(CoordConsts.SVC_KEY_FILE) String questionJson); @POST @Path(CoordConsts.SVC_RSC_UPLOAD_SNAPSHOT) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) JSONArray uploadSnapshot(
      @FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey,
      @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion,
      @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName,
      @FormDataParam(CoordConsts.SVC_KEY_SNAPSHOT_NAME) String snapshotName,
      @FormDataParam(CoordConsts.SVC_KEY_ZIPFILE) InputStream fileStream,
      @FormDataParam(CoordConsts.SVC_KEY_AUTO_ANALYZE_TESTRIG) String autoAnalyzeTestrigStr,
      @FormDataParam(CoordConsts.SVC_KEY_AUTO_ANALYZE) String autoAnalyzeStr);  }