.setSince("6.4"); .setDescription("If set to true, return only the quality profiles marked as default for each language") .setDefaultValue(false) .setBooleanPossibleValues(); .setDescription("Project key") .setDeprecatedKey("projectKey", "6.5") .setExampleValue(KEY_PROJECT_EXAMPLE_001); .setDescription("Language key. If provided, only profiles for the given language are returned.") .setPossibleValues(LanguageParamUtils.getOrderedLanguageKeys(languages)); .setDescription("Quality profile name") .setDeprecatedKey("profileName", "6.6") .setExampleValue("SonarQube Way");
@Override public void define(NewController controller) { NewAction action = controller.createAction("projects") .setSince("5.2") .setHandler(this) .setDescription("List projects with their association status regarding a quality profile") .setResponseExample(getClass().getResource("projects-example.json")); action.setChangelog( new Change("7.2", "'more' response field is deprecated"), new Change("6.5", "'id' response field is deprecated"), new Change("6.0", "'uuid' response field is deprecated and replaced by 'id'"), new Change("6.0", "'key' response field has been added to return the project key")); action.createParam(PARAM_KEY) .setDescription("Quality profile key") .setRequired(true) .setExampleValue(UUID_EXAMPLE_01); action.addSelectionModeParam(); action.createSearchQuery("sonar", "projects") .setDeprecatedKey("query", "6.5"); action.createPageParam() .setDeprecatedKey("page", "6.5"); action.createPageSize(100, MAX_PAGE_SIZE); }
.setDescription("Quality profile key") .setSince("6.5") .setDeprecatedSince("6.6") .setExampleValue(UUID_EXAMPLE_01); .setDescription("Quality profile name to export. If left empty, the default profile for the language is exported.") .setDeprecatedKey("name", "6.6") .setExampleValue("My Sonar way"); .setDescription("Quality profile language") .setExampleValue(LanguageParamUtils.getExampleValue(languages)) .setPossibleValues(LanguageParamUtils.getOrderedLanguageKeys(languages)); .setSince("6.4"); if (!exporterKeys.isEmpty()) { action.createParam(PARAM_EXPORTER_KEY) .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");
.setDescription("Comma-separated list of project keys") .setDeprecatedKey("keys", "6.4") .setExampleValue(String.join(",", KEY_PROJECT_EXAMPLE_001, KEY_PROJECT_EXAMPLE_002)); .setDescription("Comma-separated list of project ids. Only the 1'000 first ids are used. Others are silently ignored.") .setDeprecatedKey("ids", "6.4") .setDeprecatedSince("6.4") .setExampleValue(String.join(",", UUID_EXAMPLE_01, UUID_EXAMPLE_02)); .setDescription("Limit to: <ul>" + "<li>component names that contain the supplied string</li>" + "<li>component keys that contain the supplied string</li>" + "</ul>") .setExampleValue("sonar"); .setDescription("Comma-separated list of component qualifiers. Filter the results with the specified qualifiers") .setPossibleValues(PROJECT, VIEW, APP) .setDefaultValue(PROJECT); .setDescription("Filter the projects that should be visible to everyone (%s), or only specific user/groups (%s).<br/>" + "If no visibility is specified, the default project visibility of the organization will be used.", Visibility.PUBLIC.getLabel(), Visibility.PRIVATE.getLabel()) .setRequired(false) .setInternal(true) .setSince("6.4") .setPossibleValues(Visibility.getLabels()); .setDescription("Filter the projects for which last analysis is older than the given date (exclusive).<br> " + "Either a date (server timezone) or datetime can be provided.")
.setRequired(true) .setMinimumLength(LOGIN_MIN_LENGTH) .setMaximumLength(LOGIN_MAX_LENGTH) .setDescription("User login") .setExampleValue("myuser"); .setDescription("User password. Only mandatory when creating local user, otherwise it should not be set") .setExampleValue("mypassword"); .setRequired(true) .setMaximumLength(NAME_MAX_LENGTH) .setDescription("User name") .setExampleValue("My Name"); .setMaximumLength(EMAIL_MAX_LENGTH) .setDescription("User email") .setExampleValue("myname@email.com"); .setDescription("Comma-separated list of SCM accounts. This parameter is deprecated, please use '%s' instead", PARAM_SCM_ACCOUNT) .setDeprecatedKey(PARAM_SCM_ACCOUNTS_DEPRECATED, "6.0") .setDeprecatedSince("6.1") .setExampleValue("myscmaccount1,myscmaccount2"); .setDescription("List of SCM accounts. To set several values, the parameter must be called once for each value.") .setExampleValue("scmAccount=firstValue&scmAccount=secondValue&scmAccount=thirdValue"); .setDescription("Specify if the user should be authenticated from SonarQube server or from an external authentication system. " + "Password should not be set when local is set to false.") .setSince("6.3")
.setDescription("Limit search to: <ul>" + "<li>project names that contain the supplied string</li>" + "<li>project keys that are exactly the same as the supplied string</li>" + "</ul>") .setExampleValue("apac"); .setDefaultValue(Qualifiers.PROJECT) .setDeprecatedKey(PARAM_QUALIFIER, "6.6"); .setDescription("Comma-separated list of project keys") .setSince("6.6") .setMaxValuesAllowed(DatabaseUtils.PARTITION_SIZE_FOR_ORACLE) .setExampleValue(String.join(",", KEY_PROJECT_EXAMPLE_001, KEY_PROJECT_EXAMPLE_002)); .setDescription("Filter the projects that should be visible to everyone (%s), or only specific user/groups (%s).<br/>" + "If no visibility is specified, the default project visibility of the organization will be used.", Visibility.PUBLIC.getLabel(), Visibility.PRIVATE.getLabel()) .setRequired(false) .setInternal(true) .setSince("6.6") .setPossibleValues(Visibility.getLabels()); .setDescription("Filter the projects for which last analysis is older than the given date (exclusive).<br> " + "Either a date (server timezone) or datetime can be provided.") .setSince("6.6") .setExampleValue("2017-10-19 or 2017-10-19T13:00:00+0200"); .setDescription("Filter the projects that are provisioned")
.setRequired(true) .setDescription("File key") .setExampleValue("my_project:/src/foo/Bar.php"); .setDescription("First line to return. Starts at 1") .setExampleValue("10") .setDefaultValue("1"); .setDescription("Last line to return (inclusive)") .setExampleValue("20"); .setDescription("Group lines by SCM commit if value is false, else display commits for each line, even if two " + "consecutive lines relate to the same commit.") .setBooleanPossibleValues() .setDefaultValue("false");
.setRequired(true) .setDescription("Project or module key") .setExampleValue(KEY_PROJECT_EXAMPLE_001); .setDescription("Profile name") .setExampleValue("SonarQube Way"); .setDescription("Issues mode or not") .setDefaultValue(false) .setBooleanPossibleValues(); .setSince("6.6") .setDescription("Branch key") .setExampleValue(KEY_BRANCH_EXAMPLE_001); .setSince("7.1") .setDescription("Pull request id") .setExampleValue(KEY_PULL_REQUEST_EXAMPLE_001);
.setRequired(true) .setMaximumLength(LOGIN_MAX_LENGTH) .setDescription("User login") .setExampleValue("myuser"); .setMaximumLength(NAME_MAX_LENGTH) .setDescription("User name") .setExampleValue("My Name"); .setMaximumLength(EMAIL_MAX_LENGTH) .setDescription("User email") .setExampleValue("myname@email.com"); .setDescription("This parameter is deprecated, please use '%s' instead", PARAM_SCM_ACCOUNT) .setDeprecatedKey(PARAM_SCM_ACCOUNTS_DEPRECATED, "6.0") .setDeprecatedSince("6.1") .setExampleValue("myscmaccount1,myscmaccount2"); .setDescription("SCM accounts. To set several values, the parameter must be called once for each value.") .setExampleValue("scmAccount=firstValue&scmAccount=secondValue&scmAccount=thirdValue");
.setDescription("Rule key") .setRequired(true) .setExampleValue("javascript:EmptyBlock"); .setDescription("Show rule's activations for all profiles (\"active rules\")") .setBooleanPossibleValues() .setDefaultValue(false); .setDescription("Organization key") .setRequired(false) .setInternal(true) .setExampleValue("my-org") .setSince("6.4");
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("show") .setDescription("Get duplications. Require Browse permission on file's project") .setSince("4.4") .setHandler(this) .setResponseExample(getClass().getResource("show-example.json")); action.setChangelog( new Change("6.5", "The fields 'uuid', 'projectUuid', 'subProjectUuid' are deprecated in the response.")); action .createParam(PARAM_KEY) .setDescription("File key") .setExampleValue("my_project:/src/foo/Bar.php"); action .createParam(PARAM_UUID) .setDeprecatedSince("6.5") .setDescription("File ID. If provided, 'key' must not be provided.") .setExampleValue("584a89f2-8037-4f7b-b82c-8b45d2d63fb2"); action .createParam(PARAM_BRANCH) .setDescription("Branch key") .setInternal(true) .setExampleValue(KEY_BRANCH_EXAMPLE_001); action .createParam(PARAM_PULL_REQUEST) .setDescription("Pull request id") .setInternal(true) .setSince("7.1") .setExampleValue(KEY_PULL_REQUEST_EXAMPLE_001); }
.setDescription("Quality Profile key. Can be obtained through <code>api/qualityprofiles/search</code>") .setDeprecatedKey("profile_key", "6.5") .setRequired(true) .setExampleValue(UUID_EXAMPLE_01); .setDescription("Rule key") .setDeprecatedKey("rule_key", "6.5") .setRequired(true) .setExampleValue("squid:AvoidCycles"); .setDescription(format("Severity. Ignored if parameter %s is true.", PARAM_RESET)) .setPossibleValues(Severity.ALL); .setDescription(format("Parameters as semi-colon list of <code>key=value</code>. Ignored if parameter %s is true.", PARAM_RESET)) .setExampleValue("params=key1=v1;key2=v2"); .setDescription("Reset severity and parameters of activated rule. Set the values defined on parent profile or from rule default values.") .setBooleanPossibleValues();
.setDescription("Component ID") .setDeprecatedSince("6.4") .setDeprecatedKey("uuid", "6.4") .setExampleValue(UUID_EXAMPLE_01); .setDescription("Component key") .setExampleValue(KEY_PROJECT_EXAMPLE_001) .setSince("6.4"); .setDescription("Branch key") .setSince("6.6") .setInternal(true) .setExampleValue(KEY_BRANCH_EXAMPLE_001); .setDescription("Pull request id") .setSince("7.1") .setInternal(true) .setExampleValue(KEY_PULL_REQUEST_EXAMPLE_001);
@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); }
@Override public void define(NewController context) { NewAction inheritance = context.createAction("change_parent") .setSince("5.2") .setPost(true) .setDescription("Change a quality profile's parent.<br>" + "Requires one of the following permissions:" + "<ul>" + " <li>'Administer Quality Profiles'</li>" + " <li>Edit right on the specified quality profile</li>" + "</ul>") .setHandler(this); QProfileWsSupport.createOrganizationParam(inheritance) .setSince("6.4"); QProfileReference.defineParams(inheritance, languages); inheritance.createParam(PARAM_PARENT_KEY) .setDescription("New parent profile key.<br> " + "If no profile is provided, the inheritance link with current parent profile (if any) is broken, which deactivates all rules " + "which come from the parent and are not overridden.") .setDeprecatedSince("6.6") .setExampleValue(UUID_EXAMPLE_02); inheritance.createParam(QualityProfileWsParameters.PARAM_PARENT_QUALITY_PROFILE) .setDescription("Quality profile name. If this parameter is set, '%s' must not be set and '%s' must be set to disambiguate.", PARAM_PARENT_KEY, PARAM_LANGUAGE) .setExampleValue("Sonar way"); }
@Override public void define(WebService.NewController controller) { NewAction action = controller.createAction(ACTION_REMOVE_PROJECT) .setSince("5.2") .setDescription("Remove a project's association with a quality profile.<br> " + "Requires one of the following permissions:" + "<ul>" + " <li>'Administer Quality Profiles'</li>" + " <li>Edit right on the specified quality profile</li>" + " <li>Administer right on the specified project</li>" + "</ul>") .setPost(true) .setHandler(this); QProfileReference.defineParams(action, languages); QProfileWsSupport.createOrganizationParam(action).setSince("6.4"); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setDeprecatedKey("projectKey", "6.5") .setExampleValue(KEY_PROJECT_EXAMPLE_001); action.createParam(PARAM_PROJECT_UUID) .setDescription("Project ID. Either this parameter, or '%s' must be set.", PARAM_PROJECT) .setDeprecatedSince("6.5") .setExampleValue(UUID_EXAMPLE_09); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("deselect") .setDescription("Remove the association of a project from a quality gate.<br>" + "Requires one of the following permissions:" + "<ul>" + "<li>'Administer Quality Gates'</li>" + "<li>'Administer' rights on the project</li>" + "</ul>") .setPost(true) .setSince("4.3") .setHandler(this) .setChangelog(new Change("6.6", "The parameter 'gateId' was removed")); action.createParam(PARAM_PROJECT_ID) .setDescription("Project id") .setDeprecatedSince("6.1") .setExampleValue(Uuids.UUID_EXAMPLE_01); action.createParam(PARAM_PROJECT_KEY) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001) .setSince("6.1"); wsSupport.createOrganizationParam(action); }
@Override public void define(WebService.NewController controller) { NewAction action = controller.createAction(ACTION_ADD_PROJECT) .setSince("5.2") .setDescription("Associate a project with a quality profile.<br> " + "Requires one of the following permissions:" + "<ul>" + " <li>'Administer Quality Profiles'</li>" + " <li>Edit right on the specified quality profile</li>" + " <li>Administer right on the specified project</li>" + "</ul>") .setPost(true) .setHandler(this); QProfileReference.defineParams(action, languages); QProfileWsSupport.createOrganizationParam(action) .setSince("6.4"); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setDeprecatedKey("projectKey", "6.5") .setExampleValue(KEY_PROJECT_EXAMPLE_001); action.createParam(PARAM_PROJECT_UUID) .setDescription("Project ID. Either this parameter or '%s' must be set.", PARAM_PROJECT) .setDeprecatedSince("6.5") .setExampleValue(UUID_EXAMPLE_08); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction(ACTION_ASSIGN) .setDescription("Assign/Unassign an issue. Requires authentication and Browse permission on project") .setSince("3.6") .setChangelog( new Change("6.5", "the database ids of the components are removed from the response"), new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead.")) .setHandler(this) .setResponseExample(Resources.getResource(this.getClass(), "assign-example.json")) .setPost(true); action.createParam(PARAM_ISSUE) .setDescription("Issue key") .setRequired(true) .setExampleValue(Uuids.UUID_EXAMPLE_01); action.createParam(PARAM_ASSIGNEE) .setDescription("Login of the assignee. When not set, it will unassign the issue. Use '%s' to assign to current user", ASSIGN_TO_ME_VALUE) .setExampleValue("admin"); action.createParam(DEPRECATED_PARAM_ME) .setDescription("(deprecated) Assign the issue to the logged-in user. Replaced by the parameter assignee=_me") .setDeprecatedSince("5.2") .setBooleanPossibleValues(); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("search") .setDescription("Get a list of active users. <br/>" + "Administer System permission is required to show the 'groups' field.<br/>" + "Field 'tokensCount' is only accessible to System Administrator and logged in user.<br/>" + "When accessed anonymously, only logins and names are returned.") .setSince("3.6") .setChangelog( new Change("7.4", "External identity is only returned to system administrators"), new Change("6.4", "Paging response fields moved to a Paging object"), new Change("6.4", "Avatar has been added to the response"), new Change("6.4", "Email is only returned when user has Administer System permission")) .setHandler(this) .setResponseExample(getClass().getResource("search-example.json")); action.createFieldsParam(UserJsonWriter.FIELDS) .setDeprecatedSince("5.4"); action.addPagingParams(50, MAX_LIMIT); action.createParam(TEXT_QUERY) .setMinimumLength(2) .setDescription("Filter on login, name and email"); }