Search in sources :

Example 1 with NewAction

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

the class AuthorsAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction action = controller.createAction(ACTION_AUTHORS).setSince("5.1").setDescription("Search SCM accounts which match a given query").setResponseExample(Resources.getResource(this.getClass(), "authors-example.json")).setHandler(this);
    action.createParam(Param.TEXT_QUERY).setDescription("A pattern to match SCM accounts against").setExampleValue("luke");
    action.createParam(Param.PAGE_SIZE).setDescription("The size of the list to return").setExampleValue("25").setDefaultValue("10");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 2 with NewAction

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

the class ComponentTagsAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction action = controller.createAction(ACTION_COMPONENT_TAGS).setHandler(this).setSince("5.1").setInternal(true).setDescription("List tags for the issues under a given component (including issues on the descendants of the component)").setResponseExample(Resources.getResource(getClass(), "component-tags-example.json"));
    action.createParam(PARAM_COMPONENT_UUID).setDescription("A component UUID").setRequired(true).setExampleValue("7d8749e8-3070-4903-9188-bdd82933bb92");
    action.createParam(PARAM_CREATED_AFTER).setDescription("To retrieve tags on issues created after the given date (inclusive). Format: date or datetime ISO formats").setExampleValue("2013-05-01 (or 2013-05-01T13:00:00+0100)");
    action.createParam(PAGE_SIZE).setDescription("The maximum size of the list to return").setExampleValue("25").setDefaultValue("10");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 3 with NewAction

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

the class ListAction method define.

void define(WebService.NewController controller) {
    NewAction action = controller.createAction("list").setDescription("List supported programming languages").setSince("5.1").setHandler(this).setResponseExample(Resources.getResource(getClass(), "example-list.json"));
    action.createParam(Param.TEXT_QUERY).setDescription("A pattern to match language keys/names against").setExampleValue("java");
    action.createParam("ps").setDescription("The size of the list to return, 0 for all languages").setExampleValue("25").setDefaultValue("0");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 4 with NewAction

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

the class AddProjectAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction action = controller.createAction(ACTION_ADD_PROJECT).setSince("5.2").setDescription("Associate a project with a quality profile.").setHandler(this);
    projectAssociationParameters.addParameters(action);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 5 with NewAction

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

the class BackupAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction backup = controller.createAction("backup").setSince("5.2").setDescription("Backup a quality profile in XML form. The exported profile can be restored through api/qualityprofiles/restore.").setResponseExample(getClass().getResource("backup-example.xml")).setHandler(this);
    QProfileRef.defineParams(backup, languages);
}
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