Search in sources :

Example 1 with GET

use of in project che by eclipse.

the class WorkspaceService method getByKey.

@ApiOperation(value = "Get the workspace by the composite key", notes = "Composite key can be just workspace ID or in the " + "namespace:workspace_name form, where namespace is optional (e.g :workspace_name is valid key too." + "namespace/workspace_name form, where namespace can contain '/' character.")
@ApiResponses({ @ApiResponse(code = 200, message = "The response contains requested workspace entity"), @ApiResponse(code = 404, message = "The workspace with specified id does not exist"), @ApiResponse(code = 403, message = "The user is not workspace owner"), @ApiResponse(code = 500, message = "Internal server error occurred") })
public WorkspaceDto getByKey(@ApiParam(value = "Composite key", examples = @Example({ @ExampleProperty("workspace12345678"), @ExampleProperty("namespace/workspace_name"), @ExampleProperty("namespace_part_1/namespace_part_2/workspace_name") })) @PathParam("key") String key) throws NotFoundException, ServerException, ForbiddenException, BadRequestException {
    final WorkspaceImpl workspace = workspaceManager.getWorkspace(key);
    return linksInjector.injectLinks(asDto(workspace), getServiceContext());
Also used : WorkspaceImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl) Path( Produces( GET( ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 2 with GET

use of in project che by eclipse.

the class RecipeService method getRecipeScript.

public Response getRecipeScript(@PathParam("id") String id) throws ApiException, UnsupportedEncodingException {
    // Do not remove!
    // Docker can not use dockerfile in some cases without content-length header.
    final ManagedRecipe recipe = recipeDao.getById(id);
    byte[] script = recipe.getScript().getBytes("UTF-8");
    return Response.ok(script, MediaType.TEXT_PLAIN).header(HttpHeaders.CONTENT_LENGTH, script.length).build();
Also used : ManagedRecipe(org.eclipse.che.api.machine.shared.ManagedRecipe) Path( GET(

Example 3 with GET

use of in project druid by druid-io.

the class WorkerResource method isEnabled.

public Response isEnabled() {
    try {
        final Worker theWorker = curatorCoordinator.getWorker();
        final boolean enabled = !theWorker.getVersion().equalsIgnoreCase(DISABLED_VERSION);
        return Response.ok(ImmutableMap.of(theWorker.getHost(), enabled)).build();
    } catch (Exception e) {
        return Response.serverError().build();
Also used : Worker(io.druid.indexing.worker.Worker) IOException( Path( ResourceFilters(com.sun.jersey.spi.container.ResourceFilters) Produces( GET(

Example 4 with GET

use of in project che by eclipse.

the class DebuggerService method getDebugSession.

public DebugSessionDto getDebugSession(@PathParam("id") String sessionId) throws DebuggerException {
    DebuggerInfo debuggerInfo = debuggerManager.getDebugger(sessionId).getInfo();
    DebugSessionDto debugSessionDto = newDto(DebugSessionDto.class);
    return debugSessionDto;
Also used : DebuggerInfo(org.eclipse.che.api.debug.shared.model.DebuggerInfo) DebugSessionDto(org.eclipse.che.api.debug.shared.dto.DebugSessionDto) Path( VariablePath(org.eclipse.che.api.debug.shared.model.VariablePath) Produces( GET(

Example 5 with GET

use of in project che by eclipse.

the class TestingService method run.

     * Execute the Java test cases and return the test result.
     * <pre>
     *     Required request parameters.
     *     <em>projectPath</em> : Relative path to the project directory.
     *     <em>testFramework</em> : Name of the test framework where the tests should be run on. This should match with
     *                     the name returned by {@link TestRunner#getName()} implementation.
     * </pre>
     * @param uriInfo
     *            JAX-RS implementation of UrlInfo with set of query parameters.
     * @return the test result of test case
     * @throws Exception
     *             when the test runner failed to execute test cases.
@ApiOperation(value = "Execute Java tests and return results", notes = "The GET parameters are passed to the test framework implementation.")
@ApiResponses({ @ApiResponse(code = 200, message = "OK"), @ApiResponse(code = 500, message = "Server error") })
public TestResult run(@Context UriInfo uriInfo) throws Exception {
    Map<String, String> queryParameters = getMap(uriInfo.getQueryParameters());
    String projectPath = queryParameters.get("projectPath");
    String absoluteProjectPath = ResourcesPlugin.getPathToWorkspace() + projectPath;
    queryParameters.put("absoluteProjectPath", absoluteProjectPath);
    String testFramework = queryParameters.get("testFramework");
    TestRunner runner = frameworkRegistry.getTestRunner(testFramework);
    if (runner == null) {
        throw new Exception("No test frameworks found: " + testFramework);
    TestResult result = frameworkRegistry.getTestRunner(testFramework).execute(queryParameters);
    return result;
Also used : TestRunner(org.eclipse.che.api.testing.server.framework.TestRunner) TestResult(org.eclipse.che.api.testing.shared.TestResult) Path( Produces( GET( ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)


GET ( Path ( Produces ( ApiOperation (io.swagger.annotations.ApiOperation)709 ApiResponses (io.swagger.annotations.ApiResponses)558 ArrayList (java.util.ArrayList)468 IOException ( Response ( WebApplicationException ( Consumes ( HashMap (java.util.HashMap)242 List (java.util.List)231 URI ( Map (java.util.Map)202 CheckPermission ( Timed (com.codahale.metrics.annotation.Timed)195 TimedResource (org.killbill.commons.metrics.TimedResource)121 TenantContext (org.killbill.billing.util.callcontext.TenantContext)117 MediaType ( ApiResponse (io.swagger.annotations.ApiResponse)111