import org.sonar.server.es.SearchOptions;
import org.sonar.server.organization.DefaultOrganizationProvider;
import org.sonar.server.user.UserSession;
+import org.sonarqube.ws.Common.Paging;
import org.sonarqube.ws.WsComponents.ProvisionedWsResponse;
import org.sonarqube.ws.WsComponents.ProvisionedWsResponse.Component;
.addSearchQuery("sonar", "names", "keys")
.addFieldsParam(POSSIBLE_FIELDS);
- action.setChangelog(new Change("6.4", "The 'uuid' field is deprecated in the response"));
+ 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);
}
int nbOfProjects = dbClient.componentDao().countProvisioned(dbSession, organization.getUuid(), query, QUALIFIERS_FILTER);
ProvisionedWsResponse result = ProvisionedWsResponse.newBuilder()
.addAllProjects(writeProjects(projects, desiredFields))
- .setTotal(nbOfProjects)
- .setP(options.getPage())
- .setPs(options.getLimit())
+ .setPaging(Paging.newBuilder()
+ .setTotal(nbOfProjects)
+ .setPageIndex(options.getPage())
+ .setPageSize(options.getLimit()))
.build();
writeProtobuf(result, request, response);
}
"Require 'Create Projects' permission.");
assertThat(action.since()).isEqualTo("5.2");
assertThat(action.changelog()).extracting(Change::getVersion, Change::getDescription).containsExactlyInAnyOrder(
- tuple("6.4", "The 'uuid' field is deprecated in the response")
+ tuple("6.4", "The 'uuid' field is deprecated in the response"),
+ tuple("6.4", "Paging response fields is now in a Paging object")
);
assertThat(action.params()).hasSize(5);
// WS api/components/provisioned
message ProvisionedWsResponse {
- repeated Component projects = 1;
- optional int64 total = 2;
- optional int32 p = 3;
- optional int64 ps = 4;
+ optional sonarqube.ws.commons.Paging paging = 1;
+ repeated Component projects = 2;
message Component {
optional string uuid = 1;