Deprecate PUT target tag multi-assignment (#2468)

* Deprecate PUT /rest/v1/targettags/{targetTagId}/assigned -> use new POST method with same endpoint and params
* Remove deprecated DS tag mulit-assigned PUT method /rest/v1/distributionsettags/{distributionsetTagId}/assigned -> use already existing POST method with same endpoint and params

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Avgustin Marinov
2025-06-18 15:13:25 +03:00
committed by GitHub
parent 147f6b1443
commit 651bd7df98
6 changed files with 30 additions and 29 deletions

View File

@@ -391,17 +391,6 @@ public interface MgmtDistributionSetTagRestApi {
@PathVariable("distributionsetTagId") Long distributionsetTagId,
@RequestBody List<Long> distributionsetIds);
/**
* @deprecated since 0.8.0, use {@link #assignDistributionSet(Long, Long)} (POST) instead.
*/
@Deprecated(forRemoval = true, since = "0.8.0")
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING,
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE },
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> assignDistributionSetsPut(
@PathVariable("distributionsetTagId") Long distributionsetTagId,
@RequestBody List<Long> distributionsetIds);
/**
* Handles the DELETE request to unassign one distribution set from the given tag id.
*

View File

@@ -322,14 +322,26 @@ public interface MgmtTargetTagRestApi {
@ApiResponse(responseCode = "429", description = "Too many requests. The server will refuse further attempts " +
"and the client has to wait another second.")
})
@PutMapping(
@PostMapping(
value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING,
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> assignTargets(
@PathVariable("targetTagId") Long targetTagId,
@RequestParam(value = "onNotFoundPolicy", required = false, defaultValue = "FAIL") OnNotFoundPolicy onNotFoundPolicy,
@Schema(description = "List of controller ids to be assigned", example = "[\"controllerId1\", \"controllerId2\"]")
@RequestBody List<String> controllerIds);
@RequestBody List<String> controllerIds,
@RequestParam(value = "onNotFoundPolicy", required = false, defaultValue = "FAIL") OnNotFoundPolicy onNotFoundPolicy);
/**
* @deprecated since 0.9.0, use {@link #assignTargets(Long, List, OnNotFoundPolicy)} (POST) instead.
*/
@Deprecated(forRemoval = true, since = "0.9.0")
@PutMapping(
value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING,
consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> assignTargetsPut(
@PathVariable("targetTagId") Long targetTagId,
@RequestBody List<String> controllerIds,
@RequestParam(value = "onNotFoundPolicy", required = false, defaultValue = "FAIL") OnNotFoundPolicy onNotFoundPolicy);
/**
* Handles the DELETE request to unassign one target from the given tag id.