@Test public void getExperimentTemplate() { String body = loadContent(TPL_FILE); experimentTemplateSpec = gson.fromJson(body, ExperimentTemplateSpec.class); Response getEnvResponse = experimentTemplateStoreApi. getExperimentTemplate(experimentTemplateSpec.getName()); ExperimentTemplate experimentTemplate = getExperimentTemplateFromResponse(getEnvResponse); assertEquals(experimentTemplateSpec.getName(), experimentTemplate.getExperimentTemplateSpec().getName()); }
@GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) public Response getExperimentTemplate( @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name) { try { ExperimentTemplate experimentTemplate = experimentTemplateManager.getExperimentTemplate(name); return new JsonResponse.Builder<ExperimentTemplate>(Response.Status.OK) .success(true).result(experimentTemplate).build(); } catch (SubmarineRuntimeException e) { return parseExperimentTemplateServiceException(e); } }
ExperimentTemplateRestApi { @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) public Response getExperimentTemplate( @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name) { try { ExperimentTemplate experimentTemplate = experimentTemplateManager.getExperimentTemplate(name); return new JsonResponse.Builder<ExperimentTemplate>(Response.Status.OK) .success(true).result(experimentTemplate).build(); } catch (SubmarineRuntimeException e) { return parseExperimentTemplateServiceException(e); } } }
ExperimentTemplateRestApi { @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) public Response getExperimentTemplate( @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name) { try { ExperimentTemplate experimentTemplate = experimentTemplateManager.getExperimentTemplate(name); return new JsonResponse.Builder<ExperimentTemplate>(Response.Status.OK) .success(true).result(experimentTemplate).build(); } catch (SubmarineRuntimeException e) { return parseExperimentTemplateServiceException(e); } }  }
ExperimentTemplateRestApi { @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) public Response getExperimentTemplate( @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name) { try { ExperimentTemplate experimentTemplate = experimentTemplateManager.getExperimentTemplate(name); return new JsonResponse.Builder<ExperimentTemplate>(Response.Status.OK) .success(true).result(experimentTemplate).build(); } catch (SubmarineRuntimeException e) { return parseExperimentTemplateServiceException(e); } }  @POST @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON}) @Operation(summary = "Create a experimentTemplate", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) Response createExperimentTemplate(ExperimentTemplateSpec spec); @PATCH @Path("/{id}") @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON}) @Operation(summary = "Update the experimentTemplate with job spec", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response updateExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name,
      ExperimentTemplateSpec spec); @DELETE @Path("/{id}") @Operation(summary = "Delete the experimentTemplate", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response deleteExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name); @GET @Operation(summary = "List of ExperimentTemplates", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) Response listExperimentTemplate(@QueryParam("status") String status); @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response getExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name); }
ExperimentTemplateRestApi { @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) public Response getExperimentTemplate( @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name) { try { ExperimentTemplate experimentTemplate = experimentTemplateManager.getExperimentTemplate(name); return new JsonResponse.Builder<ExperimentTemplate>(Response.Status.OK) .success(true).result(experimentTemplate).build(); } catch (SubmarineRuntimeException e) { return parseExperimentTemplateServiceException(e); } }  @POST @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON}) @Operation(summary = "Create a experimentTemplate", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) Response createExperimentTemplate(ExperimentTemplateSpec spec); @PATCH @Path("/{id}") @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON}) @Operation(summary = "Update the experimentTemplate with job spec", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response updateExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name,
      ExperimentTemplateSpec spec); @DELETE @Path("/{id}") @Operation(summary = "Delete the experimentTemplate", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response deleteExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name); @GET @Operation(summary = "List of ExperimentTemplates", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) Response listExperimentTemplate(@QueryParam("status") String status); @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response getExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name);  }