use of org.sonar.api.server.ws.Change in project sonarqube by SonarSource.
the class TreeAction method define.
@Override
public void define(WebService.NewController context) {
WebService.NewAction action = context.createAction(ACTION_TREE).setDescription(format("Navigate through components based on the chosen strategy. The %s or the %s parameter must be provided.<br>" + "Requires the following permission: 'Browse' on the specified project.<br>" + "When limiting search with the %s parameter, directories are not returned.", PARAM_COMPONENT_ID, PARAM_COMPONENT, Param.TEXT_QUERY)).setSince("5.4").setResponseExample(getClass().getResource("tree-example.json")).setChangelog(new Change("6.4", "The field 'id' is deprecated in the response")).setHandler(this).addPagingParams(100, MAX_SIZE);
action.createParam(PARAM_COMPONENT_ID).setDescription("Base component id. The search is based on this component.").setDeprecatedKey("baseComponentId", "6.4").setDeprecatedSince("6.4").setExampleValue(UUID_EXAMPLE_02);
action.createParam(PARAM_COMPONENT).setDescription("Base component key. The search is based on this component.").setDeprecatedKey("baseComponentKey", "6.4").setExampleValue(KEY_PROJECT_EXAMPLE_001);
action.createSortParams(SORTS, NAME_SORT, true).setDescription("Comma-separated list of sort fields").setExampleValue(NAME_SORT + ", " + PATH_SORT);
action.createParam(Param.TEXT_QUERY).setDescription(format("Limit search to: <ul>" + "<li>component names that contain the supplied string</li>" + "<li>component keys that are exactly the same as the supplied string</li>" + "</ul>" + "Must have at least %d characters", QUERY_MINIMUM_LENGTH)).setExampleValue("FILE_NAM");
createQualifiersParameter(action, newQualifierParameterContext(i18n, resourceTypes));
action.createParam(PARAM_STRATEGY).setDescription("Strategy to search for base component descendants:" + "<ul>" + "<li>children: return the children components of the base component. Grandchildren components are not returned</li>" + "<li>all: return all the descendants components of the base component. Grandchildren are returned.</li>" + "<li>leaves: return all the descendant components (files, in general) which don't have other children. They are the leaves of the component tree.</li>" + "</ul>").setPossibleValues(STRATEGIES.keySet()).setDefaultValue(ALL_STRATEGY);
}
use of org.sonar.api.server.ws.Change in project sonarqube by SonarSource.
the class IndexAction method define.
@Override
public void define(WebService.NewController context) {
WebService.NewAction action = context.createAction(ACTION_INDEX).setDescription("This web service is deprecated, please use api/components/search instead").setSince("2.10").setDeprecatedSince("6.3").setHandler(this).setResponseExample(Resources.getResource(this.getClass(), "index-example.json"));
action.setChangelog(new Change("6.3", "The parameters 'desc', 'views', 'libs' and 'versions' have no effect."));
action.createParam(PARAM_PROJECT).setDescription("key or ID of the project").setDeprecatedKey("key", "6.4").setExampleValue(KEY_PROJECT_EXAMPLE_001);
action.createParam(PARAM_SEARCH).setDescription("Substring of project name, case insensitive. Ignored if the parameter key is set").setExampleValue("Sonar");
action.createParam(PARAM_SUB_PROJECTS).setDescription("Load sub-projects. Ignored if the parameter key is set").setDefaultValue("false").setBooleanPossibleValues();
action.createParam(PARAM_FORMAT).setDescription("Only json response format is available").setPossibleValues("json");
addRemovedParameter("desc", action);
addRemovedParameter("views", action);
addRemovedParameter("libs", action);
addRemovedParameter("versions", action);
}
use of org.sonar.api.server.ws.Change in project sonarqube by SonarSource.
the class SearchAction method define.
@Override
public void define(WebService.NewController context) {
WebService.NewAction action = context.createAction(ACTION_SEARCH).setSince("6.3").setDescription("Search for projects or views.<br>" + "Requires 'System Administrator' permission").setInternal(true).addPagingParams(100, MAX_PAGE_SIZE).addSearchQuery("sona", "component names", "component keys").setResponseExample(getClass().getResource("search-example.json")).setHandler(this);
action.setChangelog(new Change("6.4", "The 'uuid' field is deprecated in the response"));
action.createParam(PARAM_QUALIFIERS).setDescription("Comma-separated list of component qualifiers. Filter the results with the specified qualifiers").setPossibleValues(PROJECT, VIEW).setDefaultValue(PROJECT);
support.addOrganizationParam(action);
}
use of org.sonar.api.server.ws.Change in project sonarqube by SonarSource.
the class UpdateKeyAction method doDefine.
public WebService.NewAction doDefine(WebService.NewController context) {
WebService.NewAction action = context.createAction(ACTION_UPDATE_KEY).setDescription("Update a project or module key and all its sub-components keys.<br>" + "Either '%s' or '%s' must be provided, not both.<br> " + "Requires one of the following permissions: " + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "</ul>", PARAM_FROM, PARAM_PROJECT_ID).setSince("6.1").setPost(true).setHandler(this);
action.setChangelog(new Change("6.4", "Move from api/components/update_key to api/projects/update_key"));
action.createParam(PARAM_PROJECT_ID).setDescription("Project or module id").setDeprecatedKey("id", "6.4").setDeprecatedSince("6.4").setExampleValue(UUID_EXAMPLE_01);
action.createParam(PARAM_FROM).setDescription("Project or module key").setDeprecatedKey("key", "6.4").setExampleValue("my_old_project");
action.createParam(PARAM_TO).setDescription("New component key").setRequired(true).setDeprecatedKey("newKey", "6.4").setExampleValue("my_new_project");
return action;
}
use of org.sonar.api.server.ws.Change in project sonarqube by SonarSource.
the class BulkUpdateKeyAction method doDefine.
public WebService.NewAction doDefine(WebService.NewController context) {
WebService.NewAction action = context.createAction(ACTION_BULK_UPDATE_KEY).setDescription("Bulk update a project or module key and all its sub-components keys. " + "The bulk update allows to replace a part of the current key by another string on the current project and all its sub-modules.<br>" + "It's possible to simulate the bulk update by setting the parameter '%s' at true. No key is updated with a dry run.<br>" + "Ex: to rename a project with key 'my_project' to 'my_new_project' and all its sub-components keys, call the WS with parameters:" + "<ul>" + " <li>%s: my_project</li>" + " <li>%s: my_</li>" + " <li>%s: my_new_</li>" + "</ul>" + "Either '%s' or '%s' must be provided, not both.<br> " + "Requires one of the following permissions: " + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "</ul>", PARAM_DRY_RUN, PARAM_PROJECT, PARAM_FROM, PARAM_TO, PARAM_PROJECT_ID, PARAM_PROJECT).setSince("6.1").setPost(true).setResponseExample(getClass().getResource("bulk_update_key-example.json")).setHandler(this);
action.setChangelog(new Change("6.4", "Moved from api/components/bulk_update_key to api/projects/bulk_update_key"));
action.createParam(PARAM_PROJECT_ID).setDescription("Project or module ID").setDeprecatedKey("id", "6.4").setDeprecatedSince("6.4").setExampleValue(UUID_EXAMPLE_01);
action.createParam(PARAM_PROJECT).setDescription("Project or module key").setDeprecatedKey("key", "6.4").setExampleValue("my_old_project");
action.createParam(PARAM_FROM).setDescription("String to match in components keys").setRequired(true).setExampleValue("_old");
action.createParam(PARAM_TO).setDescription("String replacement in components keys").setRequired(true).setExampleValue("_new");
action.createParam(PARAM_DRY_RUN).setDescription("Simulate bulk update. No component key is updated.").setBooleanPossibleValues().setDefaultValue(false);
return action;
}
Aggregations