@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setDescription("List global permissions. <br />" + "Requires the following permission: 'Administer System'") .setResponseExample(getClass().getResource("search_global_permissions-example.json")) .setSince("5.2") .setDeprecatedSince("6.5") .setHandler(this); WsParameters.createOrganizationParameter(action).setSince("6.2"); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("installed_plugins") .setDescription("Get the list of all the plugins installed on the SonarQube instance") .setSince("2.10") .setDeprecatedSince("6.3") .setInternal(true) .setResponseExample(getClass().getResource("installed_plugins-example.json")) .setHandler(this); action.createParam("format") .setDescription("Only json response format is available") .setPossibleValues("json"); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setSince("5.2") .setDeprecatedSince("7.4") .setInternal(true) .setHandler(this) .setResponseExample(Resources.getResource(getClass(), "example-metrics.json")) .setDescription("List all custom metrics for which no custom measure already exists on a given project.<br /> " + "The project id or project key must be provided.<br />" + "Requires 'Administer System' permission or 'Administer' permission on the project."); action.createParam(PARAM_PROJECT_ID) .setDescription("Project id") .setExampleValue("ce4c03d6-430f-40a9-b777-ad877c00aa4d"); action.createParam(PARAM_PROJECT_KEY) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001); }
@Override public void define(Context context) { NewController newController = context.createController("api/metric") .setDescription("Metrics") .setSince("3.2"); newController.createAction("show") .setDescription("Show metric") .setSince("4.2") .setResponseExample(getClass().getResource("WebServiceTest/response-example.txt")) .setHandler(this::show); newController.createAction("create") .setDescription("Create metric") .setSince("4.1") .setDeprecatedSince("5.3") .setPost(true) .setInternal(true) .setResponseExample(getClass().getResource("WebServiceTest/response-example.txt")) .setChangelog( new Change("6.4", "Last event"), new Change("6.0", "Old event"), new Change("4.5.6", "Very old event")) .setHandler(this::create); newController.done(); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("search_project_permissions") .setDescription("List project permissions. A project can be a technical project, a view or a developer.<br />" + "Requires one of the following permissions:" + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "</ul>") .setResponseExample(getClass().getResource("search_project_permissions-example.json")) .setSince("5.2") .setDeprecatedSince("6.5") .addPagingParams(25) .setHandler(this); action.createParam(Param.TEXT_QUERY) .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"); createProjectParameters(action); createRootQualifierParameter(action, newQualifierParameterContext(i18n, resourceTypes)) .setSince("5.3"); }
@Override public void define(Context context) { NewController controller = context.createController("api/tests") .setSince("4.4") .setDescription("Removed in 7.6"); controller.createAction("covered_files") .setDescription("This web API is no longer supported") .setSince("4.4") .setDeprecatedSince("5.6") .setChangelog(new Change("7.6", "This action has been removed")) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()) .setHandler(RemovedWebServiceHandler.INSTANCE); controller .createAction("list") .setDescription("This web API is no longer supported") .setSince("5.2") .setDeprecatedSince("5.6") .setChangelog(new Change("7.6", "This action has been removed")) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()) .setHandler(RemovedWebServiceHandler.INSTANCE); controller.done(); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION); action.setChangelog(new Change("6.4", "The 'uuid' field is deprecated in the response")); action .setDescription("List ghost projects.<br> " + "With the current architecture, it's no more possible to have invisible ghost projects. Therefore, the web service is deprecated.<br> " + "Requires 'Administer System' permission.") .setResponseExample(Resources.getResource(getClass(), "ghosts-example.json")) .setSince("5.2") .setDeprecatedSince("6.6") .addPagingParams(100, MAX_LIMIT) .addFieldsParam(POSSIBLE_FIELDS) .addSearchQuery("sonar", "names", "keys") .setHandler(this); action.createParam(PARAM_ORGANIZATION) .setDescription("Organization key") .setRequired(false) .setInternal(true) .setSince("6.3"); }
@Override public void define(Context context) { NewController controller = context.createController(CONTROLLER_QUALITY_GATES) .setSince("4.3") .setDescription("Manage quality gates, including conditions and project association."); for (QualityGatesWsAction action : actions) { action.define(controller); } // unset_default is no more authorized controller.createAction("unset_default") .setDescription("This webservice is no more available : a default quality gate is mandatory.") .setSince("4.3") .setDeprecatedSince("7.0") .setPost(true) .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()) .setChangelog( new Change("7.0", "Unset a quality gate is no more authorized") ); controller.done(); }
@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(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setPost(true) .setDescription("Update a custom measure. Value and/or description must be provided<br />" + "Requires 'Administer System' permission or 'Administer' permission on the project.") .setHandler(this) .setSince("5.2") .setDeprecatedSince("7.4"); action.createParam(PARAM_ID) .setRequired(true) .setDescription("id") .setExampleValue("42"); action.createParam(PARAM_VALUE) .setExampleValue("true") .setDescription(measureValueDescription()); action.createParam(PARAM_DESCRIPTION) .setExampleValue("Team size growing."); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("index") .setDescription("This web service is deprecated, please use api/settings/values instead.") .setDeprecatedSince("6.3") .setResponseExample(getClass().getResource("index-example.json")) .setSince("2.6") .setHandler(this); action.createParam(PARAM_ID) .setDescription("Setting key") .setExampleValue("sonar.test.inclusions"); action.createParam(PARAM_COMPONENT) .setDescription("Component key or database id") .setExampleValue(KEY_PROJECT_EXAMPLE_001); action.createParam(PARAM_FORMAT) .setDescription("Only json response format is available") .setPossibleValues("json"); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setDescription("List custom measures. The project id or project key must be provided.<br />" + "Requires 'Administer System' permission or 'Administer' permission on the project.") .setSince("5.2") .setDeprecatedSince("7.4") .addFieldsParam(CustomMeasureJsonWriter.OPTIONAL_FIELDS) .addPagingParams(100, MAX_LIMIT) .setResponseExample(getClass().getResource("example-search.json")) .setHandler(this); action.createParam(PARAM_PROJECT_ID) .setDescription("Project id") .setExampleValue("ce4c03d6-430f-40a9-b777-ad877c00aa4d"); action.createParam(PARAM_PROJECT_KEY) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001); }
private static void defineIndexAction(NewController controller) { controller.createAction("index") .setDescription("The web service is removed and you're invited to use the alternatives: " + "<ul>" + "<li>if you need one component without measures: api/components/show</li>" + "<li>if you need one component with measures: api/measures/component</li>" + "<li>if you need several components without measures: api/components/tree</li>" + "<li>if you need several components with measures: api/measures/component_tree</li>" + "</ul>") .setSince("2.10") .setDeprecatedSince("5.4") .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); }
@Override public void define(Context context) { NewController controller = context.createController("api/favourites") .setDescription("Removed since 6.3, please use api/favorites instead") .setSince("2.6"); controller.createAction("index") .setDescription("The web service is removed and you're invited to use api/favorites instead") .setSince("2.6") .setDeprecatedSince("6.3") .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); controller.done(); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setPost(true) .setHandler(this) .setSince("5.2") .setDeprecatedSince("7.4") .setDescription("Delete a custom measure.<br /> Requires 'Administer System' permission or 'Administer' permission on the project."); action.createParam(PARAM_ID) .setDescription("Id") .setExampleValue("24") .setRequired(true); }
private static void defineListAction(NewController controller) { controller.createAction("list") .setDescription("Get a list of profiles.<br/>" + "The web service is removed and you're invited to use api/qualityprofiles/search instead") .setSince("3.3") .setDeprecatedSince("5.2") .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); } }
private static void defineIndexAction(NewController controller) { controller.createAction("index") .setDescription("The web service is removed and you're invited to use api/measures/search_history instead") .setSince("2.10") .setDeprecatedSince("6.3") .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); }
private static void defineIndexAction(NewController controller) { controller.createAction("index") .setDescription("Get a profile.<br/>" + "The web service is removed and you're invited to use api/qualityprofiles/search instead") .setSince("3.3") .setDeprecatedSince("5.2") .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); }
@Override public void define(WebService.NewController controller) { controller.createAction("restore_built_in") .setDescription("This web service has no effect since 6.4. It's no more possible to restore built-in quality profiles because they are automatically " + "updated and read only. Returns HTTP code 410.") .setSince("4.4") .setDeprecatedSince("6.4") .setPost(true) .setHandler(this); }
private static void defineIndexAction(NewController controller) { controller.createAction("index") .setDescription("This web service is removed") .setSince("2.6") .setDeprecatedSince("6.3") .setHandler(RemovedWebServiceHandler.INSTANCE) .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); }