Remove deprecated (#2800)

* ActionFields.DETAILSTATUS removed and replaces with STATUS (so status is with changed semantic - not active but real status)
* MgmtAction.detailStatus removed and replaced with status (so status is with changed semantic - not active but real status)
* MgmtTargetTagRestApi.assignTargetsPut removed - use POST method
* ActionStatusFields.REPORTEDAT deprecation removed - it is a synonym of CREATEDAT but is part of timestamp/reported aspect while createdat is part of creted at/by
* MgmtDistributionSetRequestBodyPost.os/runtime/application is removed

and

* ActionStatusFields.TIMESTAMPT added

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-11-13 13:39:03 +02:00
committed by GitHub
parent 2c8118bf52
commit 62139055b0
30 changed files with 481 additions and 756 deletions

View File

@@ -18,7 +18,6 @@ import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtActionRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRepresentationMode;
import org.eclipse.hawkbit.mgmt.rest.resource.mapper.MgmtActionMapper;
import org.eclipse.hawkbit.mgmt.rest.resource.util.LogUtility;
import org.eclipse.hawkbit.mgmt.rest.resource.util.PagingUtility;
import org.eclipse.hawkbit.repository.DeploymentManagement;
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
@@ -47,9 +46,6 @@ public class MgmtActionResource implements MgmtActionRestApi {
public ResponseEntity<PagedList<MgmtAction>> getActions(
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam,
final String representationModeParam) {
LogUtility.logDeprecated(rsqlParam != null && rsqlParam.contains("status")
? "Usage of getActions with RSQL that is up to modification: rsql=" + rsqlParam
: "Usage of getActions:result that is up to modification.");
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeActionSortParam(sortParam));
final Slice<Action> actions;
@@ -68,7 +64,6 @@ public class MgmtActionResource implements MgmtActionRestApi {
@Override
public ResponseEntity<MgmtAction> getAction(final Long actionId) {
LogUtility.logDeprecated("Usage of getActions:result that is up to modification.");
final Action action = deploymentManagement.findAction(actionId)
.orElseThrow(() -> new EntityNotFoundException(Action.class, actionId));

View File

@@ -118,7 +118,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
public ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) {
if (rsqlParam != null && rsqlParam.toLowerCase().contains("complete")) {
LogUtility.logDeprecated("Usage of MgmtDistributionSetResource.getActions with 'complete': 'complete' distribution set search field may be removed.");
LogUtility.logDeprecated("Usage of MgmtDistributionSetResource.getActions with 'complete': 'complete' distribution set search field is limited and may be removed.");
}
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeDistributionSetSortParam(sortParam));
final Page<? extends DistributionSet> findDsPage;

View File

@@ -24,7 +24,6 @@ import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi;
import org.eclipse.hawkbit.mgmt.rest.resource.mapper.MgmtTagMapper;
import org.eclipse.hawkbit.mgmt.rest.resource.mapper.MgmtTargetMapper;
import org.eclipse.hawkbit.mgmt.rest.resource.util.LogUtility;
import org.eclipse.hawkbit.mgmt.rest.resource.util.PagingUtility;
import org.eclipse.hawkbit.repository.TargetManagement;
import org.eclipse.hawkbit.repository.TargetTagManagement;
@@ -158,13 +157,6 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi {
return ResponseEntity.ok().build();
}
@Override
public ResponseEntity<Void> assignTargetsPut(
final Long targetTagId, final List<String> controllerIds, final OnNotFoundPolicy onNotFoundPolicy) {
LogUtility.logDeprecated("Deprecated usage of assignTargetsPut. Use assignTargetsPut (POST) instead.");
return assignTargets(targetTagId, controllerIds, onNotFoundPolicy);
}
@Override
@AuditLog(entity = "TargetTag", type = AuditLog.Type.UPDATE, description = "Unassign Target From Target Tag")
public ResponseEntity<Void> unassignTarget(final Long targetTagId, final String controllerId) {

View File

@@ -59,15 +59,6 @@ public class MgmtDistributionSetMapper {
final String defaultDsKey, final Map<String, DistributionSetType> dsTypeKeyToDsType) {
return sets.stream().<DistributionSetManagement.Create> map(dsRest -> {
final Set<Long> modules = new HashSet<>();
if (dsRest.getOs() != null) {
modules.add(dsRest.getOs().getId());
}
if (dsRest.getApplication() != null) {
modules.add(dsRest.getApplication().getId());
}
if (dsRest.getRuntime() != null) {
modules.add(dsRest.getRuntime().getId());
}
if (dsRest.getModules() != null) {
dsRest.getModules().forEach(module -> modules.add(module.getId()));
}

View File

@@ -239,11 +239,8 @@ public final class MgmtTargetMapper {
action.getWeight().ifPresent(result::setWeight);
result.setForceType(MgmtRestModelMapper.convertActionType(action.getActionType()));
result.setStatus(action.isActive() ? MgmtAction.ACTION_PENDING : MgmtAction.ACTION_FINISHED);
result.setActive(action.isActive());
result.setDetailStatus(action.getStatus().toString().toLowerCase());
result.setStatus(action.getStatus().toString().toLowerCase());
action.getLastActionStatusCode().ifPresent(result::setLastStatusCode);
final Rollout rollout = action.getRollout();
@@ -365,7 +362,7 @@ public final class MgmtTargetMapper {
result.setMessages(messages);
result.setReportedAt(actionStatus.getCreatedAt());
result.setTimestamp(actionStatus.getOccurredAt());
result.setTimestamp(actionStatus.getTimestamp());
result.setId(actionStatus.getId());
result.setType(MgmtActionStatus.Type.forValue(actionStatus.getStatus().name()));
actionStatus.getCode().ifPresent(result::setCode);