Search in sources :

Example 31 with NewAction

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

the class DeactivateAction method define.

@Override
public void define(WebService.NewController controller) {
    NewAction action = controller.createAction("deactivate").setDescription("Deactivate a user. Requires Administer System permission").setSince("3.7").setPost(true).setResponseExample(getClass().getResource("example-deactivate.json")).setHandler(this);
    action.createParam("login").setDescription("User login").setRequired(true).setExampleValue("myuser");
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 32 with NewAction

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

the class RemoveUserAction method define.

@Override
public void define(NewController context) {
    NewAction action = context.createAction("remove_user").setDescription(format("Remove a user from a group.<br />" + "'%s' or '%s' must be provided.<br>" + "Requires the following permission: 'Administer System'.", PARAM_GROUP_ID, PARAM_GROUP_NAME)).setHandler(this).setPost(true).setSince("5.2");
    defineGroupWsParameters(action);
    defineLoginWsParameter(action);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 33 with NewAction

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

the class UsersAction method define.

@Override
public void define(NewController context) {
    NewAction action = context.createAction("users").setDescription("Search for users with membership information with respect to a group.<br>" + "Requires the following permission: 'Administer System'.").setHandler(this).setSince("5.2").setResponseExample(getClass().getResource("users-example.json")).addSelectionModeParam().addSearchQuery("freddy", "names", "logins").addPagingParams(25);
    defineGroupWsParameters(action);
}
Also used : NewAction(org.sonar.api.server.ws.WebService.NewAction)

Example 34 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 35 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)

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