Search in sources :

Example 21 with NewAction

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

the class SuggestionsAction method define.

@Override
public void define(WebService.NewController context) {
    NewAction action = context.createAction(ACTION_SUGGESTIONS).setDescription("Internal WS for the top-right search engine").setSince("4.2").setInternal(true).setHandler(this).setResponseExample(Resources.getResource(this.getClass(), "components-example-suggestions.json"));
    action.createParam(URL_PARAM_QUERY).setRequired(true).setDescription("Substring of project key (minimum 2 characters)").setExampleValue("sonar");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 22 with NewAction

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

the class SetTagsAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction action = controller.createAction(ACTION_SET_TAGS).setPost(true).setSince("5.1").setDescription("Set tags on an issue. <br/>" + "Requires authentication and Browse permission on project<br/>" + "Since 6.3, the parameter 'key' has been replaced by '%s'", PARAM_ISSUE).setResponseExample(Resources.getResource(this.getClass(), "set_tags-example.json")).setHandler(this);
    action.createParam(PARAM_ISSUE).setDescription("Issue key").setSince("6.3").setDeprecatedKey("key", "6.3").setExampleValue(Uuids.UUID_EXAMPLE_01).setRequired(true);
    action.createParam(PARAM_TAGS).setDescription("Comma-separated list of tags. All tags are removed if parameter is empty or not set.").setExampleValue("security,cwe,misra-c");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 23 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").setHandler(this).setSince("5.1").setDescription("List tags matching a given query").setResponseExample(Resources.getResource(getClass(), "tags-example.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").setExampleValue("25").setDefaultValue("10");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 24 with NewAction

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

the class ChangeParentAction method define.

@Override
public void define(NewController context) {
    NewAction inheritance = context.createAction("change_parent").setSince("5.2").setPost(true).setDescription("Change a quality profile's parent.").setHandler(this);
    QProfileRef.defineParams(inheritance, languages);
    inheritance.createParam(PARAM_PARENT_KEY).setDescription("The key of the new parent profile. If this parameter is set, parentName must not be set. " + "If both are left empty, the inheritance link with current parent profile (if any) is broken, which deactivates all rules " + "which come from the parent and are not overridden. Require Administer Quality Profiles permission.").setExampleValue("sonar-way-java-12345");
    inheritance.createParam(PARAM_PARENT_NAME).setDescription("A quality profile name. If this parameter is set, profileKey must not be set and language must be set to disambiguate.").setExampleValue("Sonar way");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 25 with NewAction

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

the class ChangelogAction method define.

@Override
public void define(NewController context) {
    NewAction wsAction = context.createAction("changelog").setSince("5.2").setDescription("Get the history of changes on a quality profile: rule activation/deactivation, change in parameters/severity. " + "Events are ordered by date in descending order (most recent first).").setHandler(this).setResponseExample(getClass().getResource("example-changelog.json"));
    QProfileRef.defineParams(wsAction, languages);
    wsAction.addPagingParams(50, MAX_LIMIT);
    wsAction.createParam(PARAM_SINCE).setDescription("Start date for the changelog.").setExampleValue("2011-04-25T01:15:42+0100");
    wsAction.createParam(PARAM_TO).setDescription("End date for the changelog.").setExampleValue("2013-07-25T07:35:42+0200");
}
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