Migration to Spring Boot 2.7.10 (#1320)

* Initial commit
* Fix compile breaks
* Fix hibernate config
* Fix hibernate config
* Fix failing tests
* Improve logging
* Improve logging
* Fix Sonar issues
* Remove BusProperties
* Add BusProperties bean back in
* Fix JPA workaround
* Fix CVE-2021-22044
* Fix test failures
* Fix PR review findings
* Fix CVEs
* Remove H2 version downgrade, fix schema migration, enable legacy mode
* Downgrade Vaadin back to 8.14.3
* Fix EventPublisherHolder
* Fix RemoteTenantAwareEvent
* Fixed EventPublisherAutoConfiguration
* New version of spring-hateoas requires links to be expanded (Mgmt API)
* New version of spring-hateoas requires links to be expanded (Mgmt API)
* Fix PR review findings
* Fix PR review findings
* Fix PR review findings
* Update README.md
* MariaDB Java Client downgrade to maintain compatibility with AWS Aurora
* Temporarily disable RSQL test that depends on DB collation type
* Upgrade to boot 2.7.10
* Upgrade snakeyaml to 1.33
* Upgrade Spring Security OAuth2 to version 5.7.7
* Remove obsolete exclusion of junit-vintage-engine
* Upgrade jackson-bom to 2.14.2
This commit is contained in:
Stefan Behl
2023-03-28 07:16:25 +02:00
committed by GitHub
parent f21925d59b
commit 4a3a79aa6b
71 changed files with 741 additions and 593 deletions

View File

@@ -21,7 +21,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Representation of an Action Id as a Json Object with link to the Action resource
* Representation of an Action Id as a Json Object with link to the Action
* resource
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -34,14 +35,15 @@ public class MgmtActionId extends RepresentationModel<MgmtActionId> {
/**
* Constructor
*
* @param actionId
* the actionId
* the actionId
* @param controllerId
* the controller Id
* the controller Id
*/
public MgmtActionId(final String controllerId, final long actionId) {
this.actionId = actionId;
add(linkTo(methodOn(MgmtTargetRestApi.class).getAction(controllerId, actionId)).withSelfRel());
add(linkTo(methodOn(MgmtTargetRestApi.class).getAction(controllerId, actionId)).withSelfRel().expand());
}
@JsonProperty("id")

View File

@@ -15,13 +15,12 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST API providing (read-only) access to actions.
*/
@RequestMapping(MgmtRestConstants.ACTION_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtActionRestApi {
/**
@@ -47,7 +46,8 @@ public interface MgmtActionRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtAction>> getActions(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -56,13 +56,16 @@ public interface MgmtActionRestApi {
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT) String representationModeParam);
/**
* Handles the GET request of retrieving a specific Action by <code>actionId</code>
* Handles the GET request of retrieving a specific {@link MgmtAction} by
* its <code>actionId</code>.
*
* @param actionId
* The ID of the requested action
*
* @return the action
* @return the {@link MgmtAction}
*/
@GetMapping(value = "/{actionId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtAction> getAction(
@PathVariable("actionId") Long actionId);
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/{actionId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtAction> getAction(@PathVariable("actionId") Long actionId);
}

View File

@@ -13,19 +13,19 @@ import org.springframework.hateoas.MediaTypes;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Api for handling basic auth user validation
*/
@RequestMapping(MgmtRestConstants.AUTH_V1_REQUEST_MAPPING)
@SuppressWarnings("squid:S1609")
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtBasicAuthRestApi {
/**
* Handles the GET request of basic auth.
*
* @return the userinfo with status OK.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.AUTH_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtUserInfo> validateBasicAuth();
}

View File

@@ -33,13 +33,12 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for DistributionSet CRUD operations.
*/
@RequestMapping(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtDistributionSetRestApi {
/**
@@ -61,7 +60,8 @@ public interface MgmtDistributionSetRestApi {
* status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -77,8 +77,8 @@ public interface MgmtDistributionSetRestApi {
* @return a single DistributionSet with status OK.
*
*/
@GetMapping(value = "/{distributionSetId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSet> getDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
/**
@@ -92,8 +92,9 @@ public interface MgmtDistributionSetRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtDistributionSet>> createDistributionSets(List<MgmtDistributionSetRequestBodyPost> sets);
/**
@@ -104,7 +105,7 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if delete as successful.
*
*/
@DeleteMapping(value = "/{distributionSetId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}")
ResponseEntity<Void> deleteDistributionSet(@PathVariable("distributionSetId") Long distributionSetId);
/**
@@ -118,9 +119,9 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if update as successful with updated content.
*
*/
@PutMapping(value = "/{distributionSetId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/{distributionSetId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE })
ResponseEntity<MgmtDistributionSet> updateDistributionSet(@PathVariable("distributionSetId") Long distributionSetId,
MgmtDistributionSetRequestBodyPut toUpdate);
@@ -146,8 +147,9 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if get request is successful with the paged list of
* targets
*/
@GetMapping(value = "/{distributionSetId}/assignedTargets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/assignedTargets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(@PathVariable("distributionSetId") Long distributionSetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -176,8 +178,9 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if get request is successful with the paged list of
* targets
*/
@GetMapping(value = "/{distributionSetId}/installedTargets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/installedTargets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getInstalledTargets(@PathVariable("distributionSetId") Long distributionSetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -206,8 +209,9 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if get request is successful with the paged list of
* targets
*/
@GetMapping(value = "/{distributionSetId}/autoAssignTargetFilters", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/autoAssignTargetFilters", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTargetFilterQuery>> getAutoAssignTargetFilterQueries(
@PathVariable("distributionSetId") Long distributionSetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@@ -231,9 +235,10 @@ public interface MgmtDistributionSetRestApi {
* complex return body which contains information about the assigned
* targets and the already assigned targets counters
*/
@PostMapping(value = "/{distributionSetId}/assignedTargets", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/assignedTargets", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
@PathVariable("distributionSetId") Long distributionSetId,
final List<MgmtTargetAssignmentRequestBody> targetIds,
@@ -259,8 +264,9 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if get request is successful with the paged list of
* meta data
*/
@GetMapping(value = "/{distributionSetId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtMetadata>> getMetadata(@PathVariable("distributionSetId") Long distributionSetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -277,7 +283,8 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if get request is successful with the value of the meta
* data
*/
@GetMapping(value = "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtMetadata> getMetadataValue(@PathVariable("distributionSetId") Long distributionSetId,
@PathVariable("metadataKey") String metadataKey);
@@ -293,8 +300,9 @@ public interface MgmtDistributionSetRestApi {
* @return status OK if the update request is successful and the updated
* meta data result
*/
@PutMapping(value = "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtMetadata> updateMetadata(@PathVariable("distributionSetId") Long distributionSetId,
@PathVariable("metadataKey") String metadataKey, MgmtMetadataBodyPut metadata);
@@ -307,7 +315,8 @@ public interface MgmtDistributionSetRestApi {
* the key of the meta data to delete
* @return status OK if the delete request is successful
*/
@DeleteMapping(value = "/{distributionSetId}/metadata/{metadataKey}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/metadata/{metadataKey}")
ResponseEntity<Void> deleteMetadata(@PathVariable("distributionSetId") Long distributionSetId,
@PathVariable("metadataKey") String metadataKey);
@@ -321,8 +330,10 @@ public interface MgmtDistributionSetRestApi {
* @return status created if post request is successful with the value of
* the created meta data
*/
@PostMapping(value = "/{distributionSetId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtMetadata>> createMetadata(@PathVariable("distributionSetId") Long distributionSetId,
List<MgmtMetadata> metadataRest);
@@ -336,8 +347,10 @@ public interface MgmtDistributionSetRestApi {
* @return http status
*
*/
@PostMapping(value = "/{distributionSetId}/assignedSM", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/assignedSM", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> assignSoftwareModules(@PathVariable("distributionSetId") Long distributionSetId,
List<MgmtSoftwareModuleAssigment> softwareModuleIDs);
@@ -352,7 +365,8 @@ public interface MgmtDistributionSetRestApi {
* set
* @return status OK if rejection was successful.
*/
@DeleteMapping(value = "/{distributionSetId}/assignedSM/{softwareModuleId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/assignedSM/{softwareModuleId}")
ResponseEntity<Void> deleteAssignSoftwareModules(@PathVariable("distributionSetId") Long distributionSetId,
@PathVariable("softwareModuleId") Long softwareModuleId);
@@ -374,8 +388,9 @@ public interface MgmtDistributionSetRestApi {
* @return a list of the assigned software modules of a distribution set
* with status OK, if none is assigned than {@code null}
*/
@GetMapping(value = "/{distributionSetId}/assignedSM", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/assignedSM", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtSoftwareModule>> getAssignedSoftwareModules(
@PathVariable("distributionSetId") Long distributionSetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@@ -391,9 +406,10 @@ public interface MgmtDistributionSetRestApi {
* the definition if rollouts and actions should be canceled
* @return status OK if the invalidation was successful
*/
@PostMapping(value = "/{distributionSetId}/invalidate", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING
+ "/{distributionSetId}/invalidate", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> invalidateDistributionSet(@PathVariable("distributionSetId") Long distributionSetId,
@Valid MgmtInvalidateDistributionSetRequestBody invalidateRequestBody);
}

View File

@@ -24,15 +24,14 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for DistributionSetTag CRUD operations.
*
*/
@RequestMapping(MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtDistributionSetTagRestApi {
/**
* Handles the GET request of retrieving all DistributionSet tags.
*
@@ -53,7 +52,8 @@ public interface MgmtDistributionSetTagRestApi {
* with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTag>> getDistributionSetTags(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -68,22 +68,23 @@ public interface MgmtDistributionSetTagRestApi {
*
* @return a single distribution set tag with status OK.
*/
@GetMapping(value = "/{distributionsetTagId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ "/{distributionsetTagId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTag> getDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId);
/**
* Handles the POST request of creating new distribution set tag. The request
* body must always be a list of tags.
* Handles the POST request of creating new distribution set tag. The
* request body must always be a list of tags.
*
* @param tags
* the distribution set tags to be created.
* @return In case all modules could successful created the ResponseEntity with
* status code 201 - Created. The Response Body contains the created
* distribution set tags but without details.
* @return In case all modules could successful created the ResponseEntity
* with status code 201 - Created. The Response Body contains the
* created distribution set tags but without details.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING, consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTag>> createDistributionSetTags(List<MgmtTagRequestBodyPut> tags);
/**
@@ -94,12 +95,13 @@ public interface MgmtDistributionSetTagRestApi {
* the ID of the distribution set tag
* @param restDSTagRest
* the request body to be updated
* @return status OK if update is successful and the updated distribution set
* tag.
* @return status OK if update is successful and the updated distribution
* set tag.
*/
@PutMapping(value = "/{distributionsetTagId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ "/{distributionsetTagId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTag> updateDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId,
MgmtTagRequestBodyPut restDSTagRest);
@@ -111,7 +113,7 @@ public interface MgmtDistributionSetTagRestApi {
* @return status OK if delete as successfully.
*
*/
@DeleteMapping(value = "/{distributionsetTagId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/{distributionsetTagId}")
ResponseEntity<Void> deleteDistributionSetTag(@PathVariable("distributionsetTagId") Long distributionsetTagId);
/**
@@ -135,8 +137,9 @@ public interface MgmtDistributionSetTagRestApi {
*
* @return the list of assigned distribution sets.
*/
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtDistributionSet>> getAssignedDistributionSets(
@PathVariable("distributionsetTagId") Long distributionsetTagId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@@ -156,8 +159,8 @@ public interface MgmtDistributionSetTagRestApi {
* @return the list of assigned distribution sets and unassigned
* distribution sets.
*/
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING
+ "/toggleTagAssignment")
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING + "/toggleTagAssignment")
ResponseEntity<MgmtDistributionSetTagAssigmentResult> toggleTagAssignment(
@PathVariable("distributionsetTagId") Long distributionsetTagId,
List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
@@ -172,9 +175,10 @@ public interface MgmtDistributionSetTagRestApi {
*
* @return the list of assigned distribution set.
*/
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING, consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(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<List<MgmtDistributionSet>> assignDistributionSets(
@PathVariable("distributionsetTagId") Long distributionsetTagId,
List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
@@ -189,8 +193,8 @@ public interface MgmtDistributionSetTagRestApi {
* the ID of the distribution set to unassign
* @return http status code
*/
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING
+ "/{distributionsetId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.DISTRIBUTIONSET_TAG_DISTRIBUTIONSETS_REQUEST_MAPPING + "/{distributionsetId}")
ResponseEntity<Void> unassignDistributionSet(@PathVariable("distributionsetTagId") Long distributionsetTagId,
@PathVariable("distributionsetId") Long distributionsetId);

View File

@@ -24,14 +24,12 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for DistributionSet CRUD operations.
*
*/
@RequestMapping(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtDistributionSetTypeRestApi {
/**
@@ -55,7 +53,8 @@ public interface MgmtDistributionSetTypeRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtDistributionSetType>> getDistributionSetTypes(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -71,8 +70,8 @@ public interface MgmtDistributionSetTypeRestApi {
*
* @return a single DS type with status OK.
*/
@GetMapping(value = "/{distributionSetTypeId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING
+ "/{distributionSetTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSetType> getDistributionSetType(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
@@ -84,7 +83,7 @@ public interface MgmtDistributionSetTypeRestApi {
* @return status OK if delete is successful.
*
*/
@DeleteMapping(value = "/{distributionSetTypeId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}")
ResponseEntity<Void> deleteDistributionSetType(@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
/**
@@ -96,9 +95,10 @@ public interface MgmtDistributionSetTypeRestApi {
* the DS type to be updated.
* @return status OK if update is successful
*/
@PutMapping(value = "/{distributionSetTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING
+ "/{distributionSetTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSetType> updateDistributionSetType(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
MgmtDistributionSetTypeRequestBodyPut restDistributionSetType);
@@ -114,8 +114,9 @@ public interface MgmtDistributionSetTypeRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING, consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtDistributionSetType>> createDistributionSetTypes(
List<MgmtDistributionSetTypeRequestBodyPost> distributionSetTypes);
@@ -127,7 +128,7 @@ public interface MgmtDistributionSetTypeRestApi {
* of the DistributionSetType.
* @return Unpaged list of module types and OK in case of success.
*/
@GetMapping(value = "/{distributionSetTypeId}/"
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleType>> getMandatoryModules(
@@ -143,7 +144,8 @@ public interface MgmtDistributionSetTypeRestApi {
* of SoftwareModuleType.
* @return Unpaged list of module types and OK in case of success.
*/
@GetMapping(value = "/{distributionSetTypeId}/" + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
+ "/{softwareModuleTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleType> getMandatoryModule(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
@@ -159,7 +161,8 @@ public interface MgmtDistributionSetTypeRestApi {
* of SoftwareModuleType.
* @return Unpaged list of module types and OK in case of success.
*/
@GetMapping(value = "/{distributionSetTypeId}/" + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
+ "/{softwareModuleTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleType> getOptionalModule(
@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
@@ -173,7 +176,7 @@ public interface MgmtDistributionSetTypeRestApi {
* of the DistributionSetType.
* @return Unpaged list of module types and OK in case of success.
*/
@GetMapping(value = "/{distributionSetTypeId}/"
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleType>> getOptionalModules(
@@ -190,8 +193,8 @@ public interface MgmtDistributionSetTypeRestApi {
*
* @return OK if the request was successful
*/
@DeleteMapping(value = "/{distributionSetTypeId}/" + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
+ "/{softwareModuleTypeId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}")
ResponseEntity<Void> removeMandatoryModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
@@ -206,8 +209,8 @@ public interface MgmtDistributionSetTypeRestApi {
*
* @return OK if the request was successful
*/
@DeleteMapping(value = "/{distributionSetTypeId}/" + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
+ "/{softwareModuleTypeId}")
@DeleteMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}")
ResponseEntity<Void> removeOptionalModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
@@ -222,7 +225,7 @@ public interface MgmtDistributionSetTypeRestApi {
*
* @return OK if the request was successful
*/
@PostMapping(value = "/{distributionSetTypeId}/"
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> addMandatoryModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId,
@@ -239,7 +242,7 @@ public interface MgmtDistributionSetTypeRestApi {
*
* @return OK if the request was successful
*/
@PostMapping(value = "/{distributionSetTypeId}/"
@PostMapping(value = MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/"
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> addOptionalModule(@PathVariable("distributionSetTypeId") Long distributionSetTypeId,

View File

@@ -13,14 +13,13 @@ import java.io.InputStream;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
*
* API to download artifacts
*/
@RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
@FunctionalInterface
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtDownloadArtifactRestApi {
/**
@@ -37,7 +36,8 @@ public interface MgmtDownloadArtifactRestApi {
*
* @return responseEntity with status ok if successful
*/
@GetMapping(value = "/{softwareModuleId}/artifacts/{artifactId}/download")
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts/{artifactId}/download")
@ResponseBody
ResponseEntity<InputStream> downloadArtifact(@PathVariable("softwareModuleId") Long softwareModuleId,
@PathVariable("artifactId") Long artifactId);

View File

@@ -14,15 +14,13 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* A resource for download artifacts.
*
*/
@RequestMapping(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE)
@FunctionalInterface
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtDownloadRestApi {
/**
@@ -37,7 +35,8 @@ public interface MgmtDownloadRestApi {
* @return {@link ResponseEntity} with status {@link HttpStatus#OK} if
* successful
*/
@GetMapping(value = MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING)
@GetMapping(value = MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE
+ MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING)
@ResponseBody
ResponseEntity<InputStream> downloadArtifactByDownloadId(@PathVariable("tenant") String tenant,
@PathVariable("downloadId") String downloadId);

View File

@@ -44,7 +44,7 @@ public final class MgmtRestConstants {
*/
public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "/downloadId/{tenant}/{downloadId}";

View File

@@ -20,14 +20,12 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling rollout CRUD operations.
*
*/
@RequestMapping(MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtRolloutRestApi {
/**
@@ -52,7 +50,8 @@ public interface MgmtRolloutRestApi {
* status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@@ -67,7 +66,8 @@ public interface MgmtRolloutRestApi {
* the ID of the rollout to retrieve
* @return a single rollout with status OK.
*/
@GetMapping(value = "/{rolloutId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtRolloutResponseBody> getRollout(@PathVariable("rolloutId") Long rolloutId);
/**
@@ -80,8 +80,9 @@ public interface MgmtRolloutRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtRolloutResponseBody> create(MgmtRolloutRestRequestBody rolloutRequestBody);
/**
@@ -94,8 +95,8 @@ public interface MgmtRolloutRestApi {
* @return OK response (200) if rollout is approved now. In case of any
* exception the corresponding errors occur.
*/
@PostMapping(value = "/{rolloutId}/approve", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/approve", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> approve(@PathVariable("rolloutId") Long rolloutId,
@RequestParam(value = "remark", required = false) String remark);
@@ -109,8 +110,8 @@ public interface MgmtRolloutRestApi {
* @return OK response (200) if rollout is denied now. In case of any
* exception the corresponding errors occur.
*/
@PostMapping(value = "/{rolloutId}/deny", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deny", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> deny(@PathVariable("rolloutId") Long rolloutId,
@RequestParam(value = "remark", required = false) String remark);
@@ -122,8 +123,8 @@ public interface MgmtRolloutRestApi {
* @return OK response (200) if rollout could be started. In case of any
* exception the corresponding errors occur.
*/
@PostMapping(value = "/{rolloutId}/start", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/start", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> start(@PathVariable("rolloutId") Long rolloutId);
/**
@@ -134,8 +135,8 @@ public interface MgmtRolloutRestApi {
* @return OK response (200) if rollout could be paused. In case of any
* exception the corresponding errors occur.
*/
@PostMapping(value = "/{rolloutId}/pause", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/pause", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> pause(@PathVariable("rolloutId") Long rolloutId);
/**
@@ -146,7 +147,8 @@ public interface MgmtRolloutRestApi {
* @return OK response (200) if rollout could be deleted. In case of any
* exception the corresponding errors occur.
*/
@DeleteMapping(value = "/{rolloutId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@DeleteMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> delete(@PathVariable("rolloutId") Long rolloutId);
/**
@@ -157,8 +159,8 @@ public interface MgmtRolloutRestApi {
* @return OK response (200) if rollout could be resumed. In case of any
* exception the corresponding errors occur.
*/
@PostMapping(value = "/{rolloutId}/resume", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/resume", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> resume(@PathVariable("rolloutId") Long rolloutId);
/**
@@ -183,8 +185,8 @@ public interface MgmtRolloutRestApi {
* paged. In any failure the JsonResponseExceptionHandler is
* handling the response.
*/
@GetMapping(value = "/{rolloutId}/deploygroups", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/deploygroups", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(@PathVariable("rolloutId") Long rolloutId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -200,8 +202,9 @@ public interface MgmtRolloutRestApi {
* the groupId to retrieve the rollout group
* @return the OK response containing the MgmtRolloutGroupResponseBody
*/
@GetMapping(value = "/{rolloutId}/deploygroups/{groupId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING
+ "/{rolloutId}/deploygroups/{groupId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtRolloutGroupResponseBody> getRolloutGroup(@PathVariable("rolloutId") Long rolloutId,
@PathVariable("groupId") Long groupId);
@@ -228,8 +231,9 @@ public interface MgmtRolloutRestApi {
* @return a paged list of targets related to a specific rollout and rollout
* group.
*/
@GetMapping(value = "/{rolloutId}/deploygroups/{groupId}/targets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING
+ "/{rolloutId}/deploygroups/{groupId}/targets", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(@PathVariable("rolloutId") Long rolloutId,
@PathVariable("groupId") Long groupId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@@ -238,14 +242,15 @@ public interface MgmtRolloutRestApi {
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) String rsqlParam);
/**
* Handles the POST request to force trigger processing next group of a rollout even success threshold isn't yet met
* Handles the POST request to force trigger processing next group of a
* rollout even success threshold isn't yet met
*
* @param rolloutId
* the ID of the rollout to trigger next group.
* @return OK response (200). In case of any
* exception the corresponding errors occur.
* @return OK response (200). In case of any exception the corresponding
* errors occur.
*/
@PostMapping(value = "/{rolloutId}/triggerNextGroup", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/triggerNextGroup", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> triggerNextGroup(@PathVariable("rolloutId") Long rolloutId);
}

View File

@@ -25,7 +25,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -34,9 +33,8 @@ import org.springframework.web.multipart.MultipartFile;
/**
* REST Resource handling for SoftwareModule and related Artifact CRUD
* operations.
*
*/
@RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtSoftwareModuleRestApi {
/**
@@ -60,8 +58,9 @@ public interface MgmtSoftwareModuleRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(value = "/{softwareModuleId}/artifacts", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtArtifact> uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestPart("file") final MultipartFile file,
@RequestParam(value = "filename", required = false) final String optionalFileName,
@@ -80,8 +79,9 @@ public interface MgmtSoftwareModuleRestApi {
* with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(value = "/{softwareModuleId}/artifacts", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtArtifact>> getArtifacts(@PathVariable("softwareModuleId") final Long softwareModuleId);
/**
@@ -95,8 +95,9 @@ public interface MgmtSoftwareModuleRestApi {
*
* @return responseEntity with status ok if successful
*/
@GetMapping(value = "/{softwareModuleId}/artifacts/{artifactId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts/{artifactId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
ResponseEntity<MgmtArtifact> getArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("artifactId") final Long artifactId);
@@ -111,7 +112,8 @@ public interface MgmtSoftwareModuleRestApi {
*
* @return status OK if delete as successful.
*/
@DeleteMapping(value = "/{softwareModuleId}/artifacts/{artifactId}")
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/artifacts/{artifactId}")
@ResponseBody
ResponseEntity<Void> deleteArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("artifactId") final Long artifactId);
@@ -136,7 +138,8 @@ public interface MgmtSoftwareModuleRestApi {
* status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtSoftwareModule>> getSoftwareModules(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@@ -151,8 +154,8 @@ public interface MgmtSoftwareModuleRestApi {
*
* @return a single softwareModule with status OK.
*/
@GetMapping(value = "/{softwareModuleId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModule> getSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId);
/**
@@ -166,8 +169,9 @@ public interface MgmtSoftwareModuleRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModule>> createSoftwareModules(
final List<MgmtSoftwareModuleRequestBodyPost> softwareModules);
@@ -180,8 +184,8 @@ public interface MgmtSoftwareModuleRestApi {
* the modules to be updated.
* @return status OK if update was successful
*/
@PutMapping(value = "/{softwareModuleId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModule> updateSoftwareModule(
@PathVariable("softwareModuleId") final Long softwareModuleId,
@@ -195,7 +199,7 @@ public interface MgmtSoftwareModuleRestApi {
* @return status OK if delete was successful.
*
*/
@DeleteMapping(value = "/{softwareModuleId}")
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}")
ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId);
/**
@@ -218,8 +222,9 @@ public interface MgmtSoftwareModuleRestApi {
* @return status OK if get request is successful with the paged list of
* meta data
*/
@GetMapping(value = "/{softwareModuleId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtSoftwareModuleMetadata>> getMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@@ -237,8 +242,9 @@ public interface MgmtSoftwareModuleRestApi {
* @return status OK if get request is successful with the value of the meta
* data
*/
@GetMapping(value = "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleMetadata> getMetadataValue(
@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey);
@@ -255,8 +261,9 @@ public interface MgmtSoftwareModuleRestApi {
* @return status OK if the update request is successful and the updated
* meta data result
*/
@PutMapping(value = "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleMetadata> updateMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey, final MgmtSoftwareModuleMetadataBodyPut metadata);
@@ -270,7 +277,8 @@ public interface MgmtSoftwareModuleRestApi {
* the key of the meta data to delete
* @return status OK if the delete request is successful
*/
@DeleteMapping(value = "/{softwareModuleId}/metadata/{metadataKey}")
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata/{metadataKey}")
ResponseEntity<Void> deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey);
@@ -284,8 +292,10 @@ public interface MgmtSoftwareModuleRestApi {
* @return status created if post request is successful with the value of
* the created meta data
*/
@PostMapping(value = "/{softwareModuleId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING
+ "/{softwareModuleId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleMetadata>> createMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId,
final List<MgmtSoftwareModuleMetadata> metadataRest);

View File

@@ -22,16 +22,15 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for SoftwareModule and related Artifact CRUD
* operations.
*
*/
@RequestMapping(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtSoftwareModuleTypeRestApi {
/**
* Handles the GET request of retrieving all SoftwareModuleTypes .
*
@@ -52,7 +51,8 @@ public interface MgmtSoftwareModuleTypeRestApi {
* with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtSoftwareModuleType>> getTypes(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -67,8 +67,8 @@ public interface MgmtSoftwareModuleTypeRestApi {
*
* @return a single softwareModule with status OK.
*/
@GetMapping(value = "/{softwareModuleTypeId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING
+ "/{softwareModuleTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleType> getSoftwareModuleType(
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
@@ -80,7 +80,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
* @return status OK if delete as successfully.
*
*/
@DeleteMapping(value = "/{softwareModuleTypeId}")
@DeleteMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeId}")
ResponseEntity<Void> deleteSoftwareModuleType(@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId);
/**
@@ -92,9 +92,10 @@ public interface MgmtSoftwareModuleTypeRestApi {
* the module type to be updated.
* @return status OK if update is successful
*/
@PutMapping(value = "/{softwareModuleTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING
+ "/{softwareModuleTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSoftwareModuleType> updateSoftwareModuleType(
@PathVariable("softwareModuleTypeId") Long softwareModuleTypeId,
MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType);
@@ -110,8 +111,9 @@ public interface MgmtSoftwareModuleTypeRestApi {
* failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING, consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtSoftwareModuleType>> createSoftwareModuleTypes(
List<MgmtSoftwareModuleTypeRequestBodyPost> softwareModuleTypes);

View File

@@ -18,13 +18,11 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* System management capabilities by REST.
*
*/
@RequestMapping(MgmtRestConstants.SYSTEM_ADMIN_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtSystemManagementRestApi {
/**
@@ -34,7 +32,7 @@ public interface MgmtSystemManagementRestApi {
* to delete
* @return HttpStatus.OK
*/
@DeleteMapping(value = "/tenants/{tenant}")
@DeleteMapping(value = MgmtRestConstants.SYSTEM_ADMIN_MAPPING + "/tenants/{tenant}")
ResponseEntity<Void> deleteTenant(@PathVariable("tenant") String tenant);
/**
@@ -43,7 +41,8 @@ public interface MgmtSystemManagementRestApi {
*
* @return system usage statistics
*/
@GetMapping(value = "/usage", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SYSTEM_ADMIN_MAPPING + "/usage", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSystemStatisticsRest> getSystemUsageStats();
/**
@@ -51,7 +50,8 @@ public interface MgmtSystemManagementRestApi {
*
* @return a list of caches for all tenants
*/
@GetMapping(value = "/caches", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SYSTEM_ADMIN_MAPPING + "/caches", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Collection<MgmtSystemCache>> getCaches();
/**
@@ -59,7 +59,7 @@ public interface MgmtSystemManagementRestApi {
*
* @return a list of cache names which has been invalidated
*/
@DeleteMapping(value = "/caches")
@DeleteMapping(value = MgmtRestConstants.SYSTEM_ADMIN_MAPPING + "/caches")
ResponseEntity<Collection<String>> invalidateCaches();
}

View File

@@ -22,13 +22,12 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Api for handling target operations.
*/
@RequestMapping(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtTargetFilterQueryRestApi {
/**
@@ -39,7 +38,8 @@ public interface MgmtTargetFilterQueryRestApi {
* @return a single target with status OK.
*/
@GetMapping(value = "/{filterId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetFilterQuery> getFilter(@PathVariable("filterId") Long filterId);
/**
@@ -62,7 +62,8 @@ public interface MgmtTargetFilterQueryRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTargetFilterQuery>> getFilters(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -80,8 +81,9 @@ public interface MgmtTargetFilterQueryRestApi {
* is returned. In any failure the JsonResponseExceptionHandler is
* handling the response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetFilterQuery> createFilter(@RequestBody MgmtTargetFilterQueryRequestBody filter);
/**
@@ -98,8 +100,8 @@ public interface MgmtTargetFilterQueryRestApi {
* @return the updated target filter response which contains all fields
* including fields which have not been updated
*/
@PutMapping(value = "/{filterId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetFilterQuery> updateFilter(@PathVariable("filterId") Long filterId,
@RequestBody MgmtTargetFilterQueryRequestBody targetFilterRest);
@@ -113,7 +115,8 @@ public interface MgmtTargetFilterQueryRestApi {
* OK. In any failure the JsonResponseExceptionHandler is handling
* the response.
*/
@DeleteMapping(value = "/{filterId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> deleteFilter(@PathVariable("filterId") Long filterId);
/**
@@ -125,8 +128,8 @@ public interface MgmtTargetFilterQueryRestApi {
* @return the assigned distribution set with status OK, if none is assigned
* than {@code null} content (e.g. "{}")
*/
@GetMapping(value = "/{filterId}/autoAssignDS", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("filterId") Long filterId);
/**
@@ -140,8 +143,8 @@ public interface MgmtTargetFilterQueryRestApi {
* assignment
* @return http status
*/
@PostMapping(value = "/{filterId}/autoAssignDS", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PostMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetFilterQuery> postAssignedDistributionSet(@PathVariable("filterId") Long filterId,
@RequestBody MgmtDistributionSetAutoAssignment dsIdWithActionType);
@@ -154,7 +157,7 @@ public interface MgmtTargetFilterQueryRestApi {
* of the target to change
* @return http status
*/
@DeleteMapping(value = "/{filterId}/autoAssignDS")
@DeleteMapping(value = MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/{filterId}/autoAssignDS")
ResponseEntity<Void> deleteAssignedDistributionSet(@PathVariable("filterId") Long filterId);
}

View File

@@ -34,13 +34,12 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Api for handling target operations.
* API for handling target operations.
*/
@RequestMapping(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtTargetRestApi {
/**
@@ -50,7 +49,8 @@ public interface MgmtTargetRestApi {
* the ID of the target to retrieve
* @return a single target with status OK.
*/
@GetMapping(value = "/{targetId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTarget> getTarget(@PathVariable("targetId") String targetId);
/**
@@ -73,7 +73,8 @@ public interface MgmtTargetRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getTargets(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -91,8 +92,9 @@ public interface MgmtTargetRestApi {
* entities. In any failure the JsonResponseExceptionHandler is
* handling the response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTarget>> createTargets(List<MgmtTargetRequestBody> targets);
/**
@@ -109,8 +111,8 @@ public interface MgmtTargetRestApi {
* @return the updated target response which contains all fields also fields
* which have not updated
*/
@PutMapping(value = "/{targetId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTarget> updateTarget(@PathVariable("targetId") String targetId,
MgmtTargetRequestBody targetRest);
@@ -124,7 +126,7 @@ public interface MgmtTargetRestApi {
* In any failure the JsonResponseExceptionHandler is handling the
* response.
*/
@DeleteMapping(value = "/{targetId}")
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}")
ResponseEntity<Void> deleteTarget(@PathVariable("targetId") String targetId);
/**
@@ -136,7 +138,8 @@ public interface MgmtTargetRestApi {
* In any failure the JsonResponseExceptionHandler is handling the
* response.
*/
@DeleteMapping(value = MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING)
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING)
ResponseEntity<Void> unassignTargetType(@PathVariable("targetId") String targetId);
/**
@@ -148,8 +151,9 @@ public interface MgmtTargetRestApi {
* In any failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PostMapping(value = MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TARGET_TYPE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> assignTargetType(@PathVariable("targetId") String targetId, MgmtId targetTypeId);
/**
@@ -160,8 +164,8 @@ public interface MgmtTargetRestApi {
* the ID of the target to retrieve the attributes.
* @return the target attributes as map response with status OK
*/
@GetMapping(value = "/{targetId}/attributes", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/attributes", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetAttributes> getAttributes(@PathVariable("targetId") String targetId);
/**
@@ -185,8 +189,8 @@ public interface MgmtTargetRestApi {
* status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(value = "/{targetId}/actions", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtAction>> getActionHistory(@PathVariable("targetId") String targetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -203,8 +207,8 @@ public interface MgmtTargetRestApi {
* to load
* @return the action
*/
@GetMapping(value = "/{targetId}/actions/{actionId}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtAction> getAction(@PathVariable("targetId") String targetId,
@PathVariable("actionId") Long actionId);
@@ -220,7 +224,7 @@ public interface MgmtTargetRestApi {
* optional parameter, which indicates a force cancel
* @return status no content in case cancellation was successful
*/
@DeleteMapping(value = "/{targetId}/actions/{actionId}")
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}")
ResponseEntity<Void> cancelAction(@PathVariable("targetId") String targetId,
@PathVariable("actionId") Long actionId,
@RequestParam(value = "force", required = false, defaultValue = "false") boolean force);
@@ -236,8 +240,8 @@ public interface MgmtTargetRestApi {
* to update the action
* @return status no content in case cancellation was successful
*/
@PutMapping(value = "/{targetId}/actions/{actionId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtAction> updateAction(@PathVariable("targetId") String targetId,
@PathVariable("actionId") Long actionId, MgmtActionRequestBodyPut actionUpdate);
@@ -263,8 +267,9 @@ public interface MgmtTargetRestApi {
* with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(value = "/{targetId}/actions/{actionId}/status", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING
+ "/{targetId}/actions/{actionId}/status", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtActionStatus>> getActionStatusList(@PathVariable("targetId") String targetId,
@PathVariable("actionId") Long actionId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@@ -281,8 +286,8 @@ public interface MgmtTargetRestApi {
* @return the assigned distribution set with status OK, if none is assigned
* than {@code null} content (e.g. "{}")
*/
@GetMapping(value = "/{targetId}/assignedDS", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/assignedDS", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("targetId") String targetId);
/**
@@ -300,8 +305,8 @@ public interface MgmtTargetRestApi {
* complex return body which contains information about the assigned
* targets and the already assigned targets counters
*/
@PostMapping(value = "/{targetId}/assignedDS", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/assignedDS", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetAssignmentResponseBody> postAssignedDistributionSet(
@PathVariable("targetId") String targetId, MgmtDistributionSetAssignments dsAssignments,
@@ -316,8 +321,8 @@ public interface MgmtTargetRestApi {
* @return the assigned installed set with status OK, if none is installed
* than {@code null} content (e.g. "{}")
*/
@GetMapping(value = "/{targetId}/installedDS", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/installedDS", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtDistributionSet> getInstalledDistributionSet(@PathVariable("targetId") String targetId);
/**
@@ -340,8 +345,8 @@ public interface MgmtTargetRestApi {
* @return status OK if get request is successful with the paged list of
* meta data
*/
@GetMapping(value = "/{targetId}/metadata", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtMetadata>> getMetadata(@PathVariable("targetId") String targetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -358,7 +363,8 @@ public interface MgmtTargetRestApi {
* @return status OK if get request is successful with the value of the meta
* data
*/
@GetMapping(value = "/{targetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}", produces = {
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtMetadata> getMetadataValue(@PathVariable("targetId") String targetId,
@PathVariable("metadataKey") String metadataKey);
@@ -374,8 +380,8 @@ public interface MgmtTargetRestApi {
* @return status OK if the update request is successful and the updated
* meta data result
*/
@PutMapping(value = "/{targetId}/metadata/{metadataKey}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PutMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtMetadata> updateMetadata(@PathVariable("targetId") String targetId,
@PathVariable("metadataKey") String metadataKey, MgmtMetadataBodyPut metadata);
@@ -388,7 +394,7 @@ public interface MgmtTargetRestApi {
* the key of the meta data to delete
* @return status OK if the delete request is successful
*/
@DeleteMapping(value = "/{targetId}/metadata/{metadataKey}")
@DeleteMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata/{metadataKey}")
ResponseEntity<Void> deleteMetadata(@PathVariable("targetId") String targetId,
@PathVariable("metadataKey") String metadataKey);
@@ -399,10 +405,11 @@ public interface MgmtTargetRestApi {
* the ID of the targetId to create meta data for
* @param metadataRest
* the list of meta data entries to create
* @return status created if post request is successful with the value of the
* created meta data
* @return status created if post request is successful with the value of
* the created meta data
*/
@PostMapping(value = "/{targetId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE,
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/metadata", consumes = {
MediaType.APPLICATION_JSON_VALUE,
MediaTypes.HAL_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtMetadata>> createMetadata(@PathVariable("targetId") String targetId,
List<MgmtMetadata> metadataRest);
@@ -414,8 +421,8 @@ public interface MgmtTargetRestApi {
* to check the state for
* @return the current state as {@link MgmtTargetAutoConfirm}
*/
@GetMapping(value = "/{targetId}/autoConfirm", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetAutoConfirm> getAutoConfirmStatus(@PathVariable("targetId") String targetId);
/**
@@ -425,9 +432,10 @@ public interface MgmtTargetRestApi {
* to activate auto-confirm on
* @param update
* properties to update
* @return {@link org.springframework.http.HttpStatus#OK} in case of a success
* @return {@link org.springframework.http.HttpStatus#OK} in case of a
* success
*/
@PostMapping(value = "/{targetId}/autoConfirm/activate")
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm/activate")
ResponseEntity<Void> activateAutoConfirm(@PathVariable("targetId") String targetId,
@RequestBody(required = false) MgmtTargetAutoConfirmUpdate update);
@@ -437,9 +445,10 @@ public interface MgmtTargetRestApi {
* @param targetId
* to deactivate auto-confirm on
*
* @return {@link org.springframework.http.HttpStatus#OK} in case of a success
* @return {@link org.springframework.http.HttpStatus#OK} in case of a
* success
*/
@PostMapping(value = "/{targetId}/autoConfirm/deactivate")
@PostMapping(value = MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/autoConfirm/deactivate")
ResponseEntity<Void> deactivateAutoConfirm(@PathVariable("targetId") String targetId);
}

View File

@@ -24,14 +24,12 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for TargetTag CRUD operations.
*
*/
@RequestMapping(MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtTargetTagRestApi {
/**
@@ -53,7 +51,8 @@ public interface MgmtTargetTagRestApi {
* with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTag>> getTargetTags(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -68,7 +67,8 @@ public interface MgmtTargetTagRestApi {
*
* @return a single target tag with status OK.
*/
@GetMapping(value = "/{targetTagId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTag> getTargetTag(@PathVariable("targetTagId") Long targetTagId);
/**
@@ -81,8 +81,9 @@ public interface MgmtTargetTagRestApi {
* with status code 201 - Created. The Response Body are the created
* target tags but without ResponseBody.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTag>> createTargetTags(List<MgmtTagRequestBodyPut> tags);
/**
@@ -95,8 +96,8 @@ public interface MgmtTargetTagRestApi {
* the the request body to be updated
* @return status OK if update is successful and the updated target tag.
*/
@PutMapping(value = "/{targetTagId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTag> updateTargetTag(@PathVariable("targetTagId") Long targetTagId,
MgmtTagRequestBodyPut restTargetTagRest);
@@ -109,7 +110,7 @@ public interface MgmtTargetTagRestApi {
* @return status OK if delete as successfully.
*
*/
@DeleteMapping(value = "/{targetTagId}")
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/{targetTagId}")
ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") Long targetTagId);
/**
@@ -133,8 +134,9 @@ public interface MgmtTargetTagRestApi {
*
* @return the list of assigned targets.
*/
@GetMapping(value = MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(@PathVariable("targetTagId") Long targetTagId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -152,9 +154,10 @@ public interface MgmtTargetTagRestApi {
*
* @return the list of assigned targets and unassigned targets.
*/
@PostMapping(value = MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/toggleTagAssignment", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/toggleTagAssignment", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetTagAssigmentResult> toggleTagAssignment(@PathVariable("targetTagId") Long targetTagId,
List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
@@ -168,9 +171,10 @@ public interface MgmtTargetTagRestApi {
*
* @return the list of assigned targets.
*/
@PostMapping(value = MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTarget>> assignTargets(@PathVariable("targetTagId") Long targetTagId,
List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
@@ -183,7 +187,8 @@ public interface MgmtTargetTagRestApi {
* the ID of the target to unassign
* @return http status code
*/
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/{controllerId}")
@DeleteMapping(value = MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING
+ MgmtRestConstants.TARGET_TAG_TARGETS_REQUEST_MAPPING + "/{controllerId}")
ResponseEntity<Void> unassignTarget(@PathVariable("targetTagId") Long targetTagId,
@PathVariable("controllerId") String controllerId);
}

View File

@@ -24,25 +24,24 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for TargetType CRUD operations.
*
*/
@RequestMapping(MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtTargetTypeRestApi {
/**
* Handles the GET request of retrieving all TargetTypes.
*
* @param pagingOffsetParam
* the offset of list of target types for pagination, might not be
* present in the rest request then default value will be applied
* the offset of list of target types for pagination, might not
* be present in the rest request then default value will be
* applied
* @param pagingLimitParam
* the limit of the paged request, might not be present in the rest
* request then default value will be applied
* the limit of the paged request, might not be present in the
* rest request then default value will be applied
* @param sortParam
* the sorting parameter in the request URL, syntax
* {@code field:direction, field:direction}
@@ -50,11 +49,12 @@ public interface MgmtTargetTypeRestApi {
* the search parameter in the request URL, syntax
* {@code q=name==abc}
*
* @return a list of all TargetTypes for a defined or default page request with
* status OK. The response is always paged. In any failure the
* @return a list of all TargetTypes for a defined or default page request
* with status OK. The response is always paged. In any failure the
* JsonResponseExceptionHandler is handling the response.
*/
@GetMapping(produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<PagedList<MgmtTargetType>> getTargetTypes(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) int pagingLimitParam,
@@ -69,7 +69,8 @@ public interface MgmtTargetTypeRestApi {
*
* @return a single target type with status OK.
*/
@GetMapping(value = "/{targetTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetType> getTargetType(@PathVariable("targetTypeId") Long targetTypeId);
/**
@@ -80,7 +81,7 @@ public interface MgmtTargetTypeRestApi {
* @return status OK if delete is successful.
*
*/
@DeleteMapping(value = "/{targetTypeId}")
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}")
ResponseEntity<Void> deleteTargetType(@PathVariable("targetTypeId") Long targetTypeId);
/**
@@ -92,15 +93,15 @@ public interface MgmtTargetTypeRestApi {
* the target type to be updated.
* @return status OK if update is successful
*/
@PutMapping(value = "/{targetTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtTargetType> updateTargetType(@PathVariable("targetTypeId") Long targetTypeId,
MgmtTargetTypeRequestBodyPut restTargetType);
/**
* Handles the POST request of creating new Target Types. The request body must
* always be a list of types.
* Handles the POST request of creating new Target Types. The request body
* must always be a list of types.
*
* @param targetTypes
* the target types to be created.
@@ -109,26 +110,28 @@ public interface MgmtTargetTypeRestApi {
* ResponseBody. In any failure the JsonResponseExceptionHandler is
* handling the response.
*/
@PostMapping(consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtTargetType>> createTargetTypes(List<MgmtTargetTypeRequestBodyPost> targetTypes);
/**
* Handles the GET request of retrieving the list of compatible distribution set
* types in that target type.
* Handles the GET request of retrieving the list of compatible distribution
* set types in that target type.
*
* @param targetTypeId
* of the TargetType.
* @return Unpaged list of distribution set types and OK in case of success.
*/
@GetMapping(value = "/{targetTypeId}/" + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/"
+ MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<List<MgmtDistributionSetType>> getCompatibleDistributionSets(
@PathVariable("targetTypeId") Long targetTypeId);
/**
* Handles DELETE request for removing the compatibility of a distribution set
* type from the target type.
* Handles DELETE request for removing the compatibility of a distribution
* set type from the target type.
*
* @param targetTypeId
* of the TargetType.
@@ -137,13 +140,14 @@ public interface MgmtTargetTypeRestApi {
*
* @return OK if the request was successful
*/
@DeleteMapping(value = "/{targetTypeId}/" + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES + "/{distributionSetTypeId}")
@DeleteMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/"
+ MgmtRestConstants.TARGETTYPE_V1_DS_TYPES + "/{distributionSetTypeId}")
ResponseEntity<Void> removeCompatibleDistributionSet(@PathVariable("targetTypeId") Long targetTypeId,
@PathVariable("distributionSetTypeId") Long distributionSetTypeId);
/**
* Handles the POST request for adding the compatibility of a distribution set
* type to a target type.
* Handles the POST request for adding the compatibility of a distribution
* set type to a target type.
*
* @param targetTypeId
* of the TargetType.
@@ -152,8 +156,9 @@ public interface MgmtTargetTypeRestApi {
*
* @return OK if the request was successful
*/
@PostMapping(value = "/{targetTypeId}/" + MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING + "/{targetTypeId}/"
+ MgmtRestConstants.TARGETTYPE_V1_DS_TYPES, consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> addCompatibleDistributionSets(@PathVariable("targetTypeId") final Long targetTypeId,
final List<MgmtDistributionSetTypeAssignment> distributionSetTypeIds);
}

View File

@@ -19,13 +19,11 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* REST Resource for handling tenant specific configuration operations.
*
*/
@RequestMapping(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING)
// no request mapping specified here to avoid CVE-2021-22044 in Feign client
public interface MgmtTenantManagementRestApi {
/**
@@ -34,7 +32,8 @@ public interface MgmtTenantManagementRestApi {
*
* @return a map of all configuration values.
*/
@GetMapping(value = "/configs", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Map<String, MgmtSystemTenantConfigurationValue>> getTenantConfiguration();
/**
@@ -47,8 +46,8 @@ public interface MgmtTenantManagementRestApi {
* OK. In any failure the JsonResponseExceptionHandler is handling
* the response.
*/
@DeleteMapping(value = "/configs/{keyName}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@DeleteMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<Void> deleteTenantConfigurationValue(@PathVariable("keyName") String keyName);
/**
@@ -61,8 +60,8 @@ public interface MgmtTenantManagementRestApi {
* In any failure the JsonResponseExceptionHandler is handling the
* response.
*/
@GetMapping(value = "/configs/{keyName}", produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSystemTenantConfigurationValue> getTenantConfigurationValue(
@PathVariable("keyName") String keyName);
@@ -78,8 +77,8 @@ public interface MgmtTenantManagementRestApi {
* In any failure the JsonResponseExceptionHandler is handling the
* response.
*/
@PutMapping(value = "/configs/{keyName}", consumes = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
@PutMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", consumes = {
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE,
MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<MgmtSystemTenantConfigurationValue> updateTenantConfigurationValue(
@PathVariable("keyName") String keyName, MgmtSystemTenantConfigurationValueRequest configurationValueRest);