use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.
the class SearchAction method define.
@Override
public void define(WebService.NewController controller) {
NewAction action = controller.createAction(ACTION_SEARCH).setSince("5.2").setDescription("List quality profiles.").setHandler(this).setResponseExample(getClass().getResource("search-example.json"));
action.createParam(PARAM_LANGUAGE).setDescription(format("Language key. If provided, only profiles for the given language are returned. " + "It should not be used with '%s', '%s or '%s' at the same time.", PARAM_DEFAULTS, PARAM_PROJECT_KEY, PARAM_PROFILE_NAME)).setPossibleValues(LanguageParamUtils.getLanguageKeys(languages)).setDeprecatedSince("6.4");
action.createParam(PARAM_PROJECT_KEY).setDescription(format("Project or module key. If provided, '%s' and '%s' parameters should not be provided.", PARAM_LANGUAGE, PARAM_DEFAULTS)).setExampleValue("my-project-key");
action.createParam(PARAM_DEFAULTS).setDescription(format("Return the quality profile marked as default for each language. " + "If provided, then the parameters '%s', '%s' must not be set.", PARAM_LANGUAGE, PARAM_PROJECT_KEY)).setDefaultValue(false).setBooleanPossibleValues();
action.createParam(PARAM_PROFILE_NAME).setDescription(format("Profile name. It should be always used with the '%s' or '%s' parameter.", PARAM_PROJECT_KEY, PARAM_DEFAULTS)).setExampleValue("SonarQube Way").setDeprecatedSince("6.4");
}
use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.
the class SetDefaultAction method define.
@Override
public void define(WebService.NewController controller) {
NewAction setDefault = controller.createAction("set_default").setSince("5.2").setDescription("Select the default profile for a given language. Require Administer Quality Profiles permission.").setPost(true).setHandler(this);
setDefault.createParam(PARAM_LANGUAGE).setDescription("The key of a language supported by the platform. If specified, profileName must be set to select the default profile for the selected language.").setExampleValue("js").setPossibleValues(LanguageParamUtils.getLanguageKeys(languages));
setDefault.createParam(PARAM_PROFILE_NAME).setDescription("The name of a quality profile. If specified, language must be set. The matching profile will be used as default for the selected language.").setExampleValue("Sonar way");
setDefault.createParam(PARAM_PROFILE_KEY).setDescription("The key of a quality profile. If specified, language and profileName must not be set. The matching profile will be used as default for its language.").setExampleValue("sonar-way-js-12345");
}
use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.
the class CopyAction method define.
@Override
public void define(WebService.NewController controller) {
NewAction setDefault = controller.createAction("copy").setSince("5.2").setDescription("Copy a quality profile. Require Administer Quality Profiles permission.").setPost(true).setHandler(this);
setDefault.createParam(PARAM_PROFILE_NAME).setDescription("The name for the new quality profile.").setExampleValue("My Sonar way").setRequired(true);
setDefault.createParam(PARAM_PROFILE_KEY).setDescription("The key of a quality profile.").setExampleValue("sonar-way-js-12345").setRequired(true);
}
use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.
the class CreateAction method define.
@Override
public void define(WebService.NewController controller) {
NewAction create = controller.createAction(ACTION_CREATE).setSince("5.2").setDescription("Create a quality profile.<br/>" + "Require Administer Quality Profiles permission.").setPost(true).setResponseExample(getClass().getResource("example-create.json")).setHandler(this);
create.createParam(PARAM_PROFILE_NAME).setDescription("The name for the new quality profile. Since 6.1, this parameter has been renamed from '%s' to '%s'", DEPRECATED_PARAM_PROFILE_NAME, PARAM_PROFILE_NAME).setExampleValue("My Sonar way").setDeprecatedKey(DEPRECATED_PARAM_PROFILE_NAME, "6.3").setRequired(true);
create.createParam(PARAM_LANGUAGE).setDescription("The language for the quality profile.").setExampleValue("js").setPossibleValues(LanguageParamUtils.getLanguageKeys(languages)).setRequired(true);
for (ProfileImporter importer : importers) {
create.createParam(getBackupParamName(importer.getKey())).setDescription(String.format("A configuration file for %s.", importer.getName()));
}
}
use of org.sonar.api.server.ws.WebService.NewAction in project sonarqube by SonarSource.
the class ExportAction method define.
@Override
public void define(WebService.NewController controller) {
NewAction action = controller.createAction("export").setSince("5.2").setDescription("Export a quality profile.").setResponseExample(getClass().getResource("export-example.xml")).setHandler(this);
action.createParam(PARAM_PROFILE_NAME).setDescription("The name of the quality profile to export. If left empty, will export the default profile for the language.").setExampleValue("My Sonar way");
action.createParam(PARAM_LANGUAGE).setDescription("The language for the quality profile.").setExampleValue(LanguageParamUtils.getExampleValue(languages)).setPossibleValues(LanguageParamUtils.getLanguageKeys(languages)).setRequired(true);
Set<String> exporterKeys = Arrays.stream(languages.all()).map(language -> exporters.exportersForLanguage(language.getKey())).flatMap(Collection::stream).map(ProfileExporter::getKey).collect(Collectors.toSet());
if (!exporterKeys.isEmpty()) {
action.createParam(PARAM_FORMAT).setDescription("Output format. If left empty, the same format as api/qualityprofiles/backup is used. " + "Possible values are described by api/qualityprofiles/exporters.").setPossibleValues(exporterKeys).setDeprecatedKey("format", "6.3");
}
}
Aggregations