Search in sources :

Example 26 with NewAction

use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.

the class TagsAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction action = controller.createAction("tags").setDescription("List rule tags").setSince("4.4").setHandler(this).setResponseExample(Resources.getResource(getClass(), "example-tags.json"));
    action.createParam(Param.TEXT_QUERY).setDescription("A pattern to match tags against").setExampleValue("misra");
    action.createParam("ps").setDescription("The size of the list to return, 0 for all tags").setExampleValue("25").setDefaultValue("0");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 27 with NewAction

use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.

the class CompareAction method define.

@Override
public void define(NewController context) {
    NewAction compare = context.createAction("compare").setDescription("Compare two quality profiles.").setHandler(this).setInternal(true).setResponseExample(getClass().getResource("example-compare.json")).setSince("5.2");
    compare.createParam(PARAM_LEFT_KEY).setDescription("A profile key.").setExampleValue("java-sonar-way-12345").setRequired(true);
    compare.createParam(PARAM_RIGHT_KEY).setDescription("Another profile key.").setExampleValue("java-sonar-way-with-findbugs-23456").setRequired(true);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 28 with NewAction

use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.

the class DeleteAction method define.

@Override
public void define(NewController controller) {
    NewAction action = controller.createAction("delete").setDescription("Delete a quality profile and all its descendants. The default quality profile cannot be deleted. " + "Require Administer Quality Profiles permission.").setSince("5.2").setPost(true).setHandler(this);
    QProfileRef.defineParams(action, languages);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 29 with NewAction

use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.

the class InheritanceAction method define.

@Override
public void define(NewController context) {
    NewAction inheritance = context.createAction("inheritance").setSince("5.2").setDescription("Show a quality profile's ancestors and children.").setHandler(this).setResponseExample(getClass().getResource("example-inheritance.json"));
    QProfileRef.defineParams(inheritance, languages);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 30 with NewAction

use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.

the class ProjectsAction method define.

@Override
public void define(NewController controller) {
    NewAction projects = controller.createAction("projects").setSince("5.2").setHandler(this).setDescription("List projects with their association status regarding a quality profile.<br/>" + "Since 6.0, 'uuid' response field is deprecated and replaced by 'id'<br/>" + "Since 6.0, 'key' reponse field has been added to return the project key").setResponseExample(getClass().getResource("example-projects.json"));
    projects.createParam(PARAM_KEY).setDescription("A quality profile key.").setRequired(true).setExampleValue("sonar-way-java-12345");
    projects.addSelectionModeParam();
    projects.createParam(PARAM_QUERY).setDescription("If specified, return only projects whose name match the query.");
    projects.createParam(PARAM_PAGE_SIZE).setDescription("Size for the paging to apply.").setDefaultValue(100);
    projects.createParam(PARAM_PAGE).setDescription("Index of the page to display.").setDefaultValue(1);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Aggregations

NewAction (org.sonar.api.server.ws.WebService.NewAction)37 Test (org.junit.Test)6 NewController (org.sonar.api.server.ws.WebService.NewController)6 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Writer (java.io.Writer)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Set (java.util.Set)1 Nullable (javax.annotation.Nullable)1 ProfileExporter (org.sonar.api.profiles.ProfileExporter)1 ProfileImporter (org.sonar.api.profiles.ProfileImporter)1 Languages (org.sonar.api.resources.Languages)1 Request (org.sonar.api.server.ws.Request)1 Response (org.sonar.api.server.ws.Response)1 Stream (org.sonar.api.server.ws.Response.Stream)1 WebService (org.sonar.api.server.ws.WebService)1 Collectors (org.sonar.core.util.stream.Collectors)1