@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_LIST) .setSince("6.6") .setDescription("List the branches of a project.<br/>" + "Requires 'Browse' or 'Execute analysis' rights on the specified project.") .setResponseExample(Resources.getResource(getClass(), "list-example.json")) .setChangelog(new Change("7.2", "Application can be used on this web service")) .setHandler(this); addProjectParam(action); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("info") .setDescription("Get detailed information about system configuration.<br/>" + "Requires 'Administer' permissions.") .setSince("5.1") .setInternal(true) .setResponseExample(getClass().getResource("info-example.json")) .setHandler(this); action.setChangelog( new Change("5.5", "Becomes internal to easily update result") ); }
@Override public void define(NewController context) { context.createAction(ACTION_CURRENT) .setDescription("Get the details of the current authenticated user.") .setSince("5.2") .setInternal(true) .setHandler(this) .setResponseExample(getClass().getResource("current-example.json")) .setChangelog( new Change("6.5", "showOnboardingTutorial is now returned in the response"), new Change("7.1", "'parameter' is replaced by 'component' and 'organization' in the response")); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("issues") .setDescription("Return open issues") .setResponseExample(getClass().getResource("issues-example.proto")) .setSince("5.1") .setChangelog(new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_KEY))) .setInternal(true) .setHandler(this); action .createParam(PARAM_KEY) .setRequired(true) .setDescription("Project, module or file key") .setExampleValue(KEY_PROJECT_EXAMPLE_001); action .createParam(PARAM_BRANCH) .setSince("6.6") .setDescription("Branch key") .setExampleValue(KEY_BRANCH_EXAMPLE_001); }
@Override public void define(WebService.NewController controller) { WebService.NewAction createCondition = controller.createAction(ACTION_UPDATE_CONDITION) .setDescription("Update a condition attached to a quality gate.<br>" + "Requires the 'Administer Quality Gates' permission.") .setPost(true) .setSince("4.3") .setChangelog( new Change("7.6", "Removed optional 'warning' and 'period' parameters"), new Change("7.6", "Made 'error' parameter mandatory"), new Change("7.6", "Reduced the possible values of 'op' parameter to LT and GT")) .setHandler(this); createCondition .createParam(PARAM_ID) .setDescription("Condition ID") .setRequired(true) .setExampleValue("10"); addConditionParams(createCondition); wsSupport.createOrganizationParam(createCondition); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller .createAction("activity_status") .setDescription("Return CE activity related metrics.<br>" + "Requires 'Administer System' permission or 'Administer' rights on the specified project.") .setSince("5.5") .setResponseExample(getClass().getResource("activity_status-example.json")) .setInternal(true) .setHandler(this); action.createParam(PARAM_COMPONENT_ID) .setDescription("Id of the component (project) to filter on") .setExampleValue(Uuids.UUID_EXAMPLE_03); action.createParam(DEPRECATED_PARAM_COMPONENT_KEY) .setDeprecatedSince("6.6") .setDescription("Key of the component (project) to filter on") .setExampleValue(KeyExamples.KEY_PROJECT_EXAMPLE_001); action.setChangelog(new Change("6.6", "New field 'inProgress' in response")); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("installed") .setDescription("Get the list of all the plugins installed on the SonarQube instance, sorted by plugin name.") .setSince("5.2") .setChangelog( new Change("6.6", "The 'filename' field is added"), new Change("6.6", "The 'fileHash' field is added"), new Change("6.6", "The 'sonarLintSupported' field is added"), new Change("6.6", "The 'updatedAt' field is added"), new Change("7.0", "The fields 'compressedHash' and 'compressedFilename' are added")) .setHandler(this) .setResponseExample(Resources.getResource(this.getClass(), "example-installed_plugins.json")); action.createFieldsParam(singleton("category")) .setDescription(format("Comma-separated list of the additional fields to be returned in response. No additional field is returned by default. Possible values are:" + "<ul>" + "<li>%s - category as defined in the Update Center. A connection to the Update Center is needed</li>" + "</lu>", FIELD_CATEGORY)) .setSince("5.6"); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("provisioned"); action .setDescription( "Get the list of provisioned projects.<br> " + "Web service is deprecated. Use api/projects/search instead, with onProvisionedOnly=true.<br> " + "Require 'Create Projects' permission.") .setSince("5.2") .setDeprecatedSince("6.6") .setResponseExample(Resources.getResource(getClass(), "provisioned-example.json")) .setHandler(this) .addPagingParams(100, MAX_LIMIT) .addSearchQuery("sonar", "names", "keys") .addFieldsParam(POSSIBLE_FIELDS); action.setChangelog( new Change("6.4", "The 'uuid' field is deprecated in the response"), new Change("6.4", "Paging response fields is now in a Paging object")); support.addOrganizationParam(action); }
@Override public void define(NewController context) { WebService.NewAction action = context.createAction("search") .setDescription("Search for user groups.<br>" + "Requires the following permission: 'Administer System'.") .setHandler(this) .setResponseExample(getClass().getResource("search-example.json")) .setSince("5.2") .addFieldsParam(ALL_FIELDS) .addPagingParams(100, MAX_LIMIT) .addSearchQuery("sonar-users", "names") .setChangelog(new Change("6.4", "Paging response fields moved to a Paging object"), new Change("6.4", "'default' response field has been added")); action.createParam(PARAM_ORGANIZATION_KEY) .setDescription("Key of organization. If not set then groups are searched in default organization.") .setExampleValue("my-org") .setSince("6.2") .setInternal(true); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("show") .setDescription("Display the details of a quality gate") .setSince("4.3") .setResponseExample(Resources.getResource(this.getClass(), "show-example.json")) .setChangelog( new Change("7.6", "'period' and 'warning' fields of conditions are removed from the response"), new Change("7.0", "'isBuiltIn' field is added to the response"), new Change("7.0", "'actions' field is added in the response")) .setHandler(this); action.createParam(PARAM_ID) .setDescription("ID of the quality gate. Either id or name must be set") .setExampleValue("1"); action.createParam(PARAM_NAME) .setDescription("Name of the quality gate. Either id or name must be set") .setExampleValue("My Quality Gate"); wsSupport.createOrganizationParam(action); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setPost(true) .setDescription("Update an organization.<br/>" + "Require 'Administer System' permission. Organization support must be enabled.") .setInternal(true) .setSince("6.2") .setChangelog(new Change("7.4", "Maximal number of character of name is 300 characters")) .setHandler(this); action.createParam(PARAM_KEY) .setRequired(true) .setDescription("Organization key") .setExampleValue("foo-company"); wsSupport.addOrganizationDetailsParams(action, false); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_CHANGELOG) .setDescription("Display changelog of an issue.<br/>" + "Requires the 'Browse' permission on the project of the specified issue.") .setSince("4.1") .setChangelog( new Change("6.3", "changes on effort is expressed with the raw value in minutes (instead of the duration previously)")) .setHandler(this) .setResponseExample(Resources.getResource(IssuesWs.class, "changelog-example.json")); action.createParam(PARAM_ISSUE) .setDescription("Issue key") .setRequired(true) .setExampleValue(UUID_EXAMPLE_01); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setPost(true) .setDescription("Update the default visibility for new projects.<br/>Requires System Administrator privileges") .setChangelog( new Change("7.3", "This WS used to be located at /api/organizations/update_project_visibility")) .setInternal(true) .setSince("6.4") .setHandler(this); action.createParam(PARAM_PROJECT_VISIBILITY) .setRequired(true) .setDescription("Default visibility for projects") .setPossibleValues(Visibility.getLabels()); }
@Override public void define(WebService.NewController context) { WebService.NewAction projectNavigation = context.createAction(ACTION_NAME) .setDescription("Get information concerning organization navigation for the current user") .setHandler(this) .setInternal(true) .setResponseExample(getClass().getResource("organization-example.json")) .setSince("6.3") .setChangelog(new Change("6.4", "The field 'projectVisibility' is added")); projectNavigation.createParam(PARAM_ORGANIZATION) .setRequired(true) .setDescription("the organization key") .setExampleValue(KEY_ORG_EXAMPLE_001); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("add") .setDescription("Add a component (project, directory, file etc.) as favorite for the authenticated user.<br>" + "Requires authentication and the following permission: 'Browse' on the project of the specified component.") .setSince("6.3") .setChangelog(new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) .setPost(true) .setHandler(this); action.createParam(PARAM_COMPONENT) .setDescription("Component key") .setRequired(true) .setExampleValue(KeyExamples.KEY_FILE_EXAMPLE_001); }
@Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("list") .setDescription("Get a list of quality gates") .setSince("4.3") .setResponseExample(Resources.getResource(this.getClass(), "list-example.json")) .setChangelog( new Change("7.0", "'isDefault' field is added on quality gate"), new Change("7.0", "'default' field on root level is deprecated"), new Change("7.0", "'isBuiltIn' field is added in the response"), new Change("7.0", "'actions' fields are added in the response")) .setHandler(this); wsSupport.createOrganizationParam(action); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("remove") .setDescription("Remove a component (project, directory, file etc.) as favorite for the authenticated user.<br>" + "Requires authentication.") .setSince("6.3") .setChangelog(new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) .setPost(true) .setHandler(this); action.createParam(PARAM_COMPONENT) .setDescription("Component key") .setRequired(true) .setExampleValue(KeyExamples.KEY_PROJECT_EXAMPLE_001); }
@Override public void define(NewController context) { NewAction action = context.createAction("add_user") .setDescription(format("Add a user to 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") .setChangelog(new Change("6.4", "It's no longer possible to add a user to the default group")); defineGroupWsParameters(action); defineLoginWsParameter(action); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("search_my_projects") .setDescription("Return list of projects for which the current user has 'Administer' permission. Maximum 1'000 projects are returned.") .setResponseExample(getClass().getResource("search_my_projects-example.json")) .addPagingParams(100, MAX_SIZE) .setSince("6.0") .setInternal(true) .setHandler(this); action.setChangelog(new Change("6.4", "The 'id' field is deprecated in the response")); }
@Override public void define(WebService.NewController context) { context.createAction(ACTION) .setPost(true) .setDescription("Enable support of organizations.<br />" + "'Administer System' permission is required. The logged-in user will be flagged as root and will be able to manage organizations and other root users.") .setInternal(true) .setPost(true) .setSince("6.3") .setChangelog(new Change("6.4", "Create default 'Members' group")) .setHandler(this); }