@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction("copy")
- .setDescription("Copy a Quality Gate. Require Administer Quality Gates permission")
+ .setDescription("Copy a Quality Gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setPost(true)
.setSince("4.3")
.setHandler(this);
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction(ACTION_CREATE)
- .setDescription("Create a Quality Gate. Require Administer Quality Gates permission")
+ .setDescription("Create a Quality Gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setSince("4.3")
.setPost(true)
.setHandler(this);
@Override
public void define(WebService.NewController controller) {
WebService.NewAction createCondition = controller.createAction(ACTION_CREATE_CONDITION)
- .setDescription("Add a new condition to a quality gate. Require Administer Quality Gates permission")
+ .setDescription("Add a new condition to a quality gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setPost(true)
.setSince("4.3")
.setHandler(this);
public void define(WebService.NewController controller) {
WebService.NewAction createCondition = controller.createAction("delete_condition")
.setDescription("Delete a condition from a quality gate.<br>" +
- "Requires the 'Administer Quality Gates' permission")
+ "Requires the 'Administer Quality Gates' permission.")
.setPost(true)
.setSince("4.3")
.setHandler(this);
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction("deselect")
- .setDescription("Remove the association of a project from a quality gate. Require Administer Quality Gates permission")
+ .setDescription("Remove the association of a project from a quality gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setPost(true)
.setSince("4.3")
.setHandler(this)
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction("destroy")
- .setDescription("Delete a Quality Gate. Require Administer Quality Gates permission")
+ .setDescription("Delete a Quality Gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setSince("4.3")
.setPost(true)
.setHandler(this);
import org.sonar.api.utils.text.JsonWriter;
import org.sonar.db.qualitygate.QualityGateDto;
import org.sonar.server.qualitygate.QualityGates;
-import org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters;
+
+import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
+import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_NAME;
public class RenameAction implements QualityGatesWsAction {
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction("rename")
- .setDescription("Rename a Quality Gate. Require Administer Quality Gates permission")
+ .setDescription("Rename a Quality Gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setSince("4.3")
.setPost(true)
.setHandler(this);
- action.createParam(QualityGatesWsParameters.PARAM_ID)
+ action.createParam(PARAM_ID)
.setDescription("ID of the quality gate to rename")
.setRequired(true)
.setExampleValue("1");
- action.createParam(QualityGatesWsParameters.PARAM_NAME)
+ action.createParam(PARAM_NAME)
.setDescription("New name of the quality gate")
.setRequired(true)
.setExampleValue("My Quality Gate");
@Override
public void handle(Request request, Response response) {
- long idToRename = QualityGatesWs.parseId(request, QualityGatesWsParameters.PARAM_ID);
- QualityGateDto renamedQualityGate = qualityGates.rename(idToRename, request.mandatoryParam(QualityGatesWsParameters.PARAM_NAME));
+ long idToRename = QualityGatesWs.parseId(request, PARAM_ID);
+ QualityGateDto renamedQualityGate = qualityGates.rename(idToRename, request.mandatoryParam(PARAM_NAME));
JsonWriter writer = response.newJsonWriter();
QualityGatesWs.writeQualityGate(renamedQualityGate, writer).close();
}
.setDescription("Associate a project to a quality gate.<br>" +
"The '%s' or '%s' must be provided.<br>" +
"Project id as a numeric value is deprecated since 6.1. Please use the id similar to '%s'.<br>" +
- "Require Administer Quality Gates permission.",
+ "Requires the 'Administer Quality Gates' permission.",
PARAM_PROJECT_ID, PARAM_PROJECT_KEY,
Uuids.UUID_EXAMPLE_02)
.setPost(true)
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction("set_as_default")
- .setDescription("Set a quality gate as the default quality gate. Require Administer Quality Gates permission")
+ .setDescription("Set a quality gate as the default quality gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setSince("4.3")
.setPost(true)
.setHandler(this);
@Override
public void define(WebService.NewController controller) {
WebService.NewAction action = controller.createAction("unset_default")
- .setDescription("Unset a quality gate as the default quality gate. Require Administer Quality Gates permission")
+ .setDescription("Unset a quality gate as the default quality gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setSince("4.3")
.setPost(true)
.setHandler(this);
@Override
public void define(WebService.NewController controller) {
WebService.NewAction createCondition = controller.createAction(ACTION_UPDATE_CONDITION)
- .setDescription("Update a condition attached to a quality gate. Require Administer Quality Gates permission")
+ .setDescription("Update a condition attached to a quality gate.<br>" +
+ "Requires the 'Administer Quality Gates' permission.")
.setPost(true)
.setSince("4.3")
.setHandler(this);